# How to Find the Scalar Product of Two Vectors (3D)

The scalar product or dot product is one of the most important mathematical operations related to vectors, most of all because it shows whether two vectors are perpendicular ($90$° between them) to each other or not. When two vectors are perpendicular, they are said to be orthogonal. The rule looks like this:

Rule

### ScalarProductandOrthogonality

Orthogonal vectors are vectors that are perpendicular to each other:

 $\stackrel{\to }{a}\perp \stackrel{\to }{b}⇔\stackrel{\to }{a}\cdot \stackrel{\to }{b}=0$

You have an equivalence arrow between the expressions. This means that if one of them is true, the other one is also true.

There are two formulas for finding the dot product (scalar product). One is for when you have two vectors on coordinate form, and the other is used when you know the length of the vectors and the angle between them.

Formula

### ScalarProductforVectorCoordinates

$\begin{array}{llll}\hfill \stackrel{\to }{u}\cdot \stackrel{\to }{v}& =\phantom{\rule{-0.17em}{0ex}}\left({x}_{1},{y}_{1},{z}_{1}\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left({x}_{2},{y}_{2},{z}_{2}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={x}_{1}{x}_{2}+{y}_{1}{y}_{2}+{z}_{1}{z}_{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

 $\stackrel{\to }{u}\cdot \stackrel{\to }{v}=\phantom{\rule{-0.17em}{0ex}}\left({x}_{1},{y}_{1},{z}_{1}\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left({x}_{2},{y}_{2},{z}_{2}\right)={x}_{1}{x}_{2}+{y}_{1}{y}_{2}+{z}_{1}{z}_{2}$

Formula

### ScalarProductwhentheAngleIsGiven

 $\stackrel{\to }{u}\cdot \stackrel{\to }{v}=\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|\cdot \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|\cdot \mathrm{cos}\alpha ,\phantom{\rule{2em}{0ex}}\alpha =\angle \phantom{\rule{-0.17em}{0ex}}\left(\stackrel{\to }{u},\stackrel{\to }{v}\right)$

Example 1

Decide whether the vectors $\phantom{\rule{-0.17em}{0ex}}\left(-4,5,3\right)$ and $\phantom{\rule{-0.17em}{0ex}}\left(2,3,-1\right)$ are orthogonal.

$\begin{array}{llll}\hfill & \phantom{\rule{-0.17em}{0ex}}\left(-4,5,3\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2,3,-1\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=-4\cdot 2+5\cdot 3+3\cdot \left(-1\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=-8+15-3\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}=4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}\ne 0.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

$\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}\left(-4,5,3\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2,3,-1\right)& =-4\cdot 2+5\cdot 3+3\cdot \left(-1\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =-8+15-3\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \ne 0.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Because the dot product is not equal to 0, you know that the vectors are not orthogonal.

Example 2

Find the dot product of the vectors $\stackrel{\to }{u}$ and $\stackrel{\to }{v}$ with lengths $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|=3$ and $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|=5$, when the angle between them is $\angle \phantom{\rule{-0.17em}{0ex}}\left(\stackrel{\to }{u},\stackrel{\to }{v}\right)=\text{}90\text{}\text{°}$.

 $\stackrel{\to }{u}\cdot \stackrel{\to }{v}=\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|\cdot \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|\cdot \mathrm{cos}90\text{°}=3\cdot 5\cdot 0=0$

As the dot product is $0$, you know that $\stackrel{\to }{u}$ and $\stackrel{\to }{v}$ are perpendicular, which is in line with the assumption that the angle between them is $90$°.

Example 3

Find $t$ such that $\phantom{\rule{-0.17em}{0ex}}\left(-2,5,2\right)$ and $\phantom{\rule{-0.17em}{0ex}}\left(2t,9,-1\right)$ are orthogonal.

For two vectors to be orthogonal, their dot product has to be $0$. $\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}\left(-2,5,2\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2t,9,-1\right)& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill -4t+45-2& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill t& =\frac{43}{4}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

When $t=\frac{43}{4}$, the vectors are orthogonal. In that case, the vector is

 $\phantom{\rule{-0.17em}{0ex}}\left(2t,9,-1\right)=\phantom{\rule{-0.17em}{0ex}}\left(\frac{43}{2},9,-1\right).$

Rule

### TheAngleBetweenTwoVectors

The angle $\alpha$ between two vectors $\stackrel{\to }{u}$ and $\stackrel{\to }{v}$ is

 $\mathrm{cos}\alpha =\frac{\stackrel{\to }{u}\cdot \stackrel{\to }{v}}{\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|\cdot \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|},\phantom{\rule{2em}{0ex}}\alpha \in \phantom{\rule{-0.17em}{0ex}}\left[0\text{°},180\text{°}\right].$

Example 4

Find the angle between $\stackrel{\to }{u}=\phantom{\rule{-0.17em}{0ex}}\left(3,3,3\right)$ and $\stackrel{\to }{v}=\phantom{\rule{-0.17em}{0ex}}\left(2,1,6\right)$.

You start by calculating the length of the two vectors: $\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|& =\sqrt{{3}^{2}+{3}^{2}+{3}^{2}}=\sqrt{27}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|& =\sqrt{{2}^{2}+{1}^{2}+{6}^{2}}=\sqrt{41}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Next, you find the dot product:

$\begin{array}{llll}\hfill \stackrel{\to }{u}\cdot \stackrel{\to }{v}& =\phantom{\rule{-0.17em}{0ex}}\left(3,3,3\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2,1,6\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =3\cdot 2+3\cdot 1+3\cdot 6\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =27\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

 $\stackrel{\to }{u}\cdot \stackrel{\to }{v}=\phantom{\rule{-0.17em}{0ex}}\left(3,3,3\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2,1,6\right)=3\cdot 2+3\cdot 1+3\cdot 6=27$

Then you insert the numbers into the formula in order to find the cosine of the angle: $\begin{array}{llll}\hfill \mathrm{cos}\alpha & =\frac{\stackrel{\to }{u}\cdot \stackrel{\to }{v}}{\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|\cdot \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{27}{\sqrt{27}\cdot \sqrt{41}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\sqrt{\frac{27}{41}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Finally, you can use this to find the angle, which is

 $\alpha ={\mathrm{cos}}^{-1}\sqrt{\frac{27}{41}}\approx 35.76\text{°}.$

Example 5

Let $\stackrel{\to }{u}=\stackrel{\to }{a}+\stackrel{\to }{b}$ and $\stackrel{\to }{v}=2\stackrel{\to }{a}-\stackrel{\to }{b}$, where $\stackrel{\to }{a}$ and $\stackrel{\to }{b}$ are two relatively unknown vectors. All you know is that $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{a}|=2$, $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{b}|=3$, and that the angle between $\stackrel{\to }{a}$ and $\stackrel{\to }{b}$ is $\text{}60\text{}\text{°}$. What is the angle between $\stackrel{\to }{u}$ and $\stackrel{\to }{v}$?

Like in Example 4, you start by finding the lengths of the two vectors. This time, you also have to use some rules when you are cleaning up dot products and parentheses, and especially that

 $\stackrel{\to }{a}\cdot \stackrel{\to }{a}={\stackrel{\to }{a}}^{2}=\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{a}|}^{2}.$

Recall that $\mathrm{cos}60\text{°}=\frac{1}{2}$. You get that $\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{u}|}^{2}& =\phantom{\rule{-0.17em}{0ex}}\left(\stackrel{\to }{a}+\stackrel{\to }{b}\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(\stackrel{\to }{a}+\stackrel{\to }{b}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={\stackrel{\to }{a}}^{2}+2\stackrel{\to }{a}\cdot \stackrel{\to }{b}+{\stackrel{\to }{b}}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{a}|}^{2}+2\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{a}|\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{b}|\mathrm{cos}60\text{°}+\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{b}|}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={2}^{2}+2\cdot 2\cdot 3\cdot \frac{1}{2}+{3}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =4+6+9\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =19,\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{v}|}^{2}& =\phantom{\rule{-0.17em}{0ex}}\left(2\stackrel{\to }{a}-\stackrel{\to }{b}\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2\stackrel{\to }{a}-\stackrel{\to }{b}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =4{\stackrel{\to }{a}}^{2}-4\stackrel{\to }{a}\cdot \stackrel{\to }{b}+{\stackrel{\to }{b}}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =4\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{a}|}^{2}-4\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{a}|\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{b}|\mathrm{cos}60\text{°}+\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{b}|}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =4\cdot {2}^{2}-4\cdot 2\cdot 3\cdot \frac{1}{2}+{3}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =16-12+9\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =13.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Next, you find the dot product in the same way: $\begin{array}{llll}\hfill \stackrel{\to }{u}\cdot \stackrel{\to }{v}& =\phantom{\rule{-0.17em}{0ex}}\left(\stackrel{\to }{a}+\stackrel{\to }{b}\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(2\stackrel{\to }{a}-\stackrel{\to }{b}\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =2{\stackrel{\to }{a}}^{2}+2\stackrel{\to }{a}\cdot \stackrel{\to }{b}-\stackrel{\to }{b}\cdot \stackrel{\to }{a}-{\stackrel{\to }{b}}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =2\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{a}|}^{2}+\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{a}|\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{b}|\mathrm{cos}60\text{°}-\phantom{\rule{-0.17em}{0ex}}{|\stackrel{\to }{b}|}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =2\cdot {2}^{2}+2\cdot 3\cdot \frac{1}{2}-{3}^{2}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =8+3-9\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =2.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

You insert these values into the formula to find the cosine of the angle: $\begin{array}{llll}\hfill \mathrm{cos}\alpha & =\frac{\stackrel{\to }{u}\cdot \stackrel{\to }{v}}{\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{u}|\cdot \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{v}|}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{2}{\sqrt{19}\cdot \sqrt{13}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{2}{\sqrt{247}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

That finally gets you the angle, which is

 $\alpha ={\mathrm{cos}}^{-1}\phantom{\rule{-0.17em}{0ex}}\left(\frac{2}{\sqrt{247}}\right)\approx 82.51\text{°}.$