Example 6 Given that $a$ and $b$ are non-zero vectors, and $a+3b$ is perpendicular to $7a-5b$, $a-4b$ is perpendicular to $7a-2b$, find the angle between $a$ and $b$.

---

The above text has been translated into English, preserving the original text's line breaks and format.
Analysis According to the necessary and sufficient conditions for perpendicularity and the angle formula to solve.
Solution Since $(a+3 b) \perp(7 a-5 b),(a-4 b) \perp(7 a-2 b)$.
We can $\left\{\begin{array}{l}(\boldsymbol{a}+3 \boldsymbol{b}) \cdot(7 \boldsymbol{a}-5 \boldsymbol{b})=0 \\ (\boldsymbol{a}-4 \boldsymbol{b}) \cdot(7 \boldsymbol{a}-2 \boldsymbol{b})=0\end{array}\right.$
That is $\left\{\begin{array}{l}7 a^{2}+16 a \cdot b-15 b^{2}=0 \\ 7 a^{2}-30 a \cdot b+8 b^{2}=0\end{array}\right.$
Solving, we get $\left\{\begin{array}{l}b^{2}=2 a \cdot b \\ a^{2}=2 a \cdot b\end{array}\right.$
That is $|\boldsymbol{a}|=|\boldsymbol{b}|=\sqrt{2 \boldsymbol{a} \cdot \boldsymbol{b}}$
Since $\cos \theta=\frac{\boldsymbol{a} \cdot \boldsymbol{b}}{|\boldsymbol{a}||\boldsymbol{b}|}=\frac{\boldsymbol{a} \cdot \boldsymbol{b}}{(\sqrt{2 \boldsymbol{a} \cdot \boldsymbol{b}})^{2}}=\frac{1}{2}$
And since $\theta \in[0, \pi]$
Therefore, the angle $\theta$ between $\boldsymbol{a}$ and $\boldsymbol{b}$ is $\frac{\pi}{3}$.