Step 1: Key Formula or Approach:
Expand the dot product on the left using the distributive law: \((\vec a+\vec b)\cdot(\vec a+\vec b) = \vec a\cdot\vec a + 2\vec a\cdot\vec b + \vec b\cdot\vec b = |\vec a|^2 + 2\vec a\cdot\vec b + |\vec b|^2\).
Step 2: Setting up the "if and only if":
\[ |\vec a|^2+2\vec a\cdot\vec b+|\vec b|^2 = |\vec a|^2+|\vec b|^2 \iff 2\vec a\cdot\vec b = 0 \iff \vec a\cdot\vec b = 0 \]
Step 3: Connecting to perpendicularity:
Since \(\vec a\ne0\) and \(\vec b\ne0\), \(\vec a\cdot\vec b = |\vec a||\vec b|\cos\theta = 0\) forces \(\cos\theta=0\), i.e. \(\theta=90^\circ\). So \(\vec a\cdot\vec b=0\) exactly when \(\vec a\perp\vec b\).
Final Answer:
So \((\vec a+\vec b)\cdot(\vec a+\vec b)=|\vec a|^2+|\vec b|^2\) holds if and only if \(\vec a\perp\vec b\), which is what was to be proved.
\[ \boxed{\vec a\cdot\vec b=0 \iff \vec a\perp\vec b} \]