\(AC=a\sqrt{2}\)
\(P=\overrightarrow{AC}.\overrightarrow{CD}+\overrightarrow{AC}.\overrightarrow{CA}=\overrightarrow{AC}.\overrightarrow{CD}-\overrightarrow{AC}.\overrightarrow{AC}\)
\(=AC.CD.cos45^0-AC^2=a\sqrt{2}.a.\frac{\sqrt{2}}{2}-\left(a\sqrt{2}\right)^2=-a^2\)