a: \(\overrightarrow{AB}\cdot\overrightarrow{AD}=0\)
\(\overrightarrow{AB}\cdot\overrightarrow{BD}=\overrightarrow{AB}\left(\overrightarrow{AD}-\overrightarrow{AB}\right)=-AB^2=-a^2\)
b: \(=\overrightarrow{AB}\cdot\overrightarrow{BD}+\overrightarrow{AB}\cdot\overrightarrow{BC}+\overrightarrow{AD}\cdot\overrightarrow{BD}+\overrightarrow{AD}\cdot\overrightarrow{BC}\)
\(=-a^2-\overrightarrow{BA}\cdot\overrightarrow{BC}+\overrightarrow{DA}\cdot\overrightarrow{DB}+AD^2\)
\(=-0+DA\cdot DB\cdot cos45=a\cdot a\sqrt{2}\cdot\dfrac{\sqrt{2}}{2}=a^2\)