Angle between vectors? Here's the problem from my homework:


If the vector $\vec{a}+\vec{b}$ is perpendicular to the vector $7\vec{a}-5\vec{b}$, and if the vector $\vec{a}-4\vec{b}$ is perpendicular to the vector $7\vec{a}-2\vec{b}$, what is the angle between vectors $\vec{a}$ and $\vec{b}$?


So, if I use the fact that $\vec{a} \perp \vec{b} \iff\vec{a} \cdot \vec{b}=0$ I get these two equations:
$ (\vec{a}+\vec{b})\cdot(7\vec{a}-5\vec{b})=7|\vec{a}|^2+2\vec{a}\cdot \vec{b}-5|\vec{b}|^2=0$
$(\vec{a}-4\vec{b}) \cdot (7\vec{a}-2\vec{b})=7|\vec{a}|^2-30\vec{a}\cdot \vec{b}+8|\vec{b}|^2=0$
Also, Iknow that $cos(\varphi)=\frac{\vec{a}\cdot \vec{b}}{|\vec{a}||\vec{b}|}$, but I don't know what to do next?
 A: You correctly got:$$(\vec{a}+\vec{b})\cdot(7\vec{a}-5\vec{b})=7|\vec{a}|^2+2\vec{a}\cdot \vec{b}-5|\vec{b}|^2=0$$$$(\vec{a}-4\vec{b}) \cdot (7\vec{a}-2\vec{b})=7|\vec{a}|^2-30\vec{a}\cdot \vec{b}+8|\vec{b}|^2=0$$If you now rearrange these you get:$$2\vec{a}\cdot \vec{b}=5|\vec{b}|^2-7|\vec{a}|^2\tag{1}$$$$30\vec{a}\cdot \vec{b}=7|\vec{a}|^2+8|\vec{b}|^2\tag{2}$$Now just add equations (1) and (2) to obtain:$$32\vec{a}\cdot \vec{b}=13|\vec{b}|^2$$$$\therefore\vec{a}\cdot \vec{b}=\frac{13|\vec{b}|^2}{32}$$And we also know that:$$\vec{a}\cdot \vec{b}=|\vec{a}|\cdot|\vec{b}|\cdot\cos(\theta)$$$$\therefore\vec{a}\cdot \vec{b}=\frac{13|\vec{b}|^2}{32}=|\vec{a}|\cdot|\vec{b}|\cdot\cos(\theta)$$$$\therefore\cos(\theta)=\frac{13|\vec{b}|^2}{32|\vec{a}|\cdot|\vec{b}|}=\frac{13|\vec{b}|}{32|\vec{a}|}\tag{3}$$You can then use equations (1) and (2) to eliminate $\vec{a}\cdot \vec{b}$ which will give you a value for $\frac{|\vec{b}|}{|\vec{a}|}$ which can be used in equation (3) to obtain the final answer.
A: Let $\vec{a} = \langle a_1, a_2 \rangle$ and $\vec{b} = \langle b_1, b_2 \rangle$. Then, since $\vec{a} + \vec{b}$ and $7\vec{a} - 5\vec{b}$ are perpendicular, their dot product is $0$, so $$(a_1+b_1)(7a_1-5b_1)+(a_2+b_2)(7a_2-5b_2)=0.$$ $$7a_1^2+2a_1b_1-5b_1^2+7a_2^2+2a_2b_2-5b_2^2 = 0$$ $$7(a_1^2+a_2^2)^2+2(a_1b_1+a_2b_2) -5(b_1^2+b_2^2) = 0$$ $$7|\vec{a}|^2+2(\vec{a} \cdot \vec{b})-5|\vec{b}|^2=0 \tag{1}.$$
Also, since $\vec{a} - 4\vec{b}$ and $7\vec{a}- 2\vec{b}$ are perpendicular, their dot product is $0$, so $$(a_1-4b_1)(7a_1-2b_1)+(a_2-4b_2)(7a_2-2b_2) = 0$$ $$7a_1^2 - 30a_1b_1 + 8b_1^2+7a_2-30a_2b_2+8b_2^2 = 0$$ $$7(a_1^2+a_2^2) -30(a_1b_1+a_2b_2) + 8(b_1^2 + b_2^2) = 0$$ 
$$7|\vec{a}|^2 - 30(\vec{a} \cdot \vec{b}) + 8|\vec{b}|^2 = 0. \tag{2}$$
Now, since $\vec{a} \cdot \vec{b} = |\vec{a}|\cdot|\vec{b}|\cdot \cos\theta$, where $\theta$ is the angle in between them,  we are solving for $\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}| \cdot |\vec{b}|}$. Subtracting $(2)$ from $(1)$ yields: $$32(\vec{a} \cdot \vec{b}) = 13|\vec{b}|^2$$ $$\vec{a} \cdot \vec{b} = \frac{13|\vec{b}|^2}{32}$$
which we can plug in to get $$\cos \theta = \frac{13|\vec{b}|^2}{32|\vec{a}| \cdot |\vec{b}|} = \frac{13|\vec{b}|}{32|\vec{a}|}.$$
Now, to find $|\vec{b}|/|\vec{a}|$ note that $(1)$ is equivalent to $105|\vec{a}|+30(\vec{a} \cdot \vec{b})-75|\vec{b}|^2 = 0,$ so combining with $2$ yields $$112|\vec{a}|^2 - 67|\vec{b}^2| = 0$$ $$112|\vec{a}|^2 = 67|\vec{b}|^2$$ $$\frac{|\vec{b}|}{|\vec{a}|} = \sqrt{\frac{67}{112}}$$
So, finally, we have $$\cos \theta = \frac{13\sqrt{67}}{32\sqrt{112}}$$
which implies that $\theta \approx 71.69^{\circ}.$ It's likely that I've made an algebra mistake somewhere in here, so it's probably worthwhile to check my work. The method of solution should work, however.
