4. Given that $\boldsymbol{a}$ and $\boldsymbol{b}$ are non-zero vectors, and $\boldsymbol{a}+3 \boldsymbol{b}$ is perpendicular to $7 \boldsymbol{a}-5 \boldsymbol{b}$, $\boldsymbol{a}-4 \boldsymbol{b}$ is perpendicular to $7 \boldsymbol{a}-2 \boldsymbol{b}$. Then the angle between vectors $\boldsymbol{a}$ and $\boldsymbol{b}$ is $\qquad$.
$4.60^{\circ}$.
From $(a+3 b)(7 a-5 b)=0$, we get
$$
7 a^{2}+16 a \cdot b-15 b^{2}=0 \text {. }
$$

From $(a-4 b)(7 a-2 b)=0$, we get
$$
7 a^{2}-30 a \cdot b+8 b^{2}=0 \text {. }
$$

Subtracting the two equations yields $2 \boldsymbol{a} \cdot \boldsymbol{b}=\boldsymbol{b}^{2}$.
Substituting into equation (1) or (2) gives $a^{2}=b^{2}$.
Let the angle between $a$ and $b$ be $\theta$, then
$$
\cos \theta=\frac{a \cdot b}{|a||b|}=\frac{b^{2}}{2|b|^{2}}=\frac{1}{2}, \theta=60^{\circ} .
$$