# How to find a vector component from another vector and the angle between the two vectors?

I have two vectors, $$(-2, 3, 1)$$, and $$(-1, 2, a)$$. I know that the angle between these two vectors is $$40^\circ$$. How do I find a?

When I try to algebraically solve for a, I run into problems with the magnitudes. I understand that $$X \cdot Y = |X| |Y| cos(Z)$$. The problem is the magnitude of $$Y$$ in this case turns out to be $$\sqrt{5 + a^2}$$, and the dot product of $$X$$ and $$Y$$ is a + 8, so I can't figure out how to resolve the two to find a.

$$a + 8 = \sqrt{14} \cdot \sqrt{5 + a^2} \cdot \cos(40^\circ)$$

• Welcome to math.se. Here are some tips on how to ask a good question. Please include your thoughts on the problem. Apr 19, 2021 at 22:18
• Do you remember how angle between two vectors is defined? It has something to do with dot product. Now... describe the information you are given as a formula and algebraically solve for $a$. Apr 19, 2021 at 22:18
• When I try to algebraically solve for a, I run into problems with the magnitudes. I understand how X dot product Y = |X| * |Y| cos(Z). The problem is the magnitude of Y in this case turns out to be sqrt(5 + a^2), and the dot product of X and Y is a + 8, so I can't figure out how to resolve the two to find a. Apr 19, 2021 at 22:52
• That looks like a reasonable equation to solve for $a$. Apr 19, 2021 at 23:05
• @JoshuaLike You might need to use the general formula for the quadratic equation (en.wikipedia.org/wiki/Quadratic_formula) to solve for $a$. Apr 19, 2021 at 23:13

We know that the scalar product is defined as:

$$\mathbf{v}\bullet \mathbf{u}=vu\cos \theta\equiv v_xu_x+v_yu_y+v_zu_z$$

i.e. $$\sqrt{14}\cdot \sqrt{5+a^2}=\frac{8+a}{\cos(40^{\circ})} \iff \sqrt{14\cdot (5+a^2)}=\frac{8+a}{\cos(40^{\circ})}$$

Hence, squaring LHS and RHS,

$$70\cos ^2\left(40^{\circ}\right)+14\cos ^2\left(40^{\circ }\right)a^2=64+16a+a^2$$

and the solution are (equation of second degree or quadratic formula), being the $$70+14a^2>0, \, \forall a\in \Bbb R$$,

$$a_1=\frac{-16+\sqrt{-3920\cos ^4\left(40^{\circ}\right)+3864\cos ^2\left(40^{\circ}\right)}}{2\left(1-14\cos ^2\left(40^{\circ}\right)\right)},$$ $$a_2=-\frac{\sqrt{-3920\cos ^4\left(40^{\circ}\right)+3864\cos ^2\left(40^{\circ}\right)}+16}{2\left(1-14\cos ^2\left(40^{\circ }\right)\right)}$$

• I am at this point myself, but I cannot separate a in order to find the possible values. Is there a way to do this that I am missing? Apr 19, 2021 at 23:10
• @JoshuaLike I have finished the various edit. I hope that the steps are clear. Apr 19, 2021 at 23:25
• Thank you @Sebastiano! This was very helpful! Apr 19, 2021 at 23:51