# Dot Products

The first type of vector multiplication is called the dot product. The dot product of vectors $$\vec A$$ and $$\vec B$$ is the sum of the products of each pair of components. That is,

$$\vec A\cdot\vec B=A_xB_x+A_yB_y+A_zB_z$$
Notice that the result of the dot product is a scalar, not a vector; it is sometimes called scalar multiplication for this reason. The dot product of two vectors is also equal to
$$\vec A\cdot\vec B=\abs{\vec A}\abs{\vec B}\cos\theta$$
where θ is the angle between the two vectors. This gives the dot product some interesting features:
• If two vectors point in the same direction (θ = 0°), then their dot product is just the product of their magnitudes. In particular
$$\vec A\cdot\vec A=\abs{\vec A}^2$$
• If two vectors point in the same-ish direction (that is, if the angle between them is less than 90°), then their dot product is positive because the cosine of an acute angle is positive.
• The dot product of two vectors at right angles to each other is zero. For example, $$\hat x\cdot\hat y=0$$.
• If the angle between two vectors is obtuse (i.e. greater than 90°), so that they point in opposite-ish directions, then their dot product is negative.

Find the dot product of $$(3\hat x+\hat y)$$ and $$(-\hat x+4\hat y)$$. Do the two vectors point in the same-ish or opposite-ish directions?
Multiply the like components and add them together: $$(3)(-1)+(1)(4)=-3+4=\fbox{1}$$ The dot product is positive, so the vectors point in the same-ish direction (that is, the angle between them is acute.)
Find the angle between the vectors $$\hat y$$ and $$3\hat x+4\hat y$$.
The dot product of the two vectors is $$(3)(0)+(1)(4)=4$$ But the dot product is also the product of the magnitude of the two vectors times the cosine of the angle between them. Thus $$4=|\hat y||3\hat x+4\hat y|\cos\theta$$ The magnitude of $$\hat y$$ is 1, and the magnitude of $$3\hat x+4\hat y$$ is $$\sqrt{3^2+4^2}=5$$, and so $$4=5\cos\theta \implies \cos\theta={4\over5}$$ $$\implies \theta=\cos^{-1}0.8=\fbox{36.9^\circ}$$
Vectors $$3\hat x+4\hat y$$ and $$4\hat x+a\hat y$$ are perpendicular; find $$a$$.
If they are perpendicular, their dot product must be zero: $$\begin{eqnarray} 0&=&(3\hat x+4\hat y)\cdot(4\hat x+a\hat y)\cr &=&12+4a\cr 4a&=&-12\cr a&=&\fbox{-3}\cr \end{eqnarray}$$ Therefore $$3\hat x+4\hat y$$ and $$4\hat x-3\hat y$$ are perpendicular to each other. In general, if you have a vector $$a\hat x+b\hat y$$ and you need another vector which is perpendicular to it, you can use $$b\hat x-a\hat y$$.

Find the angle θ between a face diagonal of a cube and a body diagonal of a cube, as shown.
The vector $$\vec F=\hat x+\hat z$$ points along the face diagonal, and the vector $$\vec B=\hat x+\hat y+\hat z$$ points along the body diagonal; thus the angle between these two vectors is the angle θ we seek. From the definition of the dot product $$\vec F\cdot\vec B=|\vec F||\vec B|\cos\theta \implies \theta=\cos^{-1}\left(\frac{\vec F\cdot\vec B}{|\vec F||\vec B|}\right)$$ The magnitude of $$\vec F$$ is $$|{\vec F}|=\sqrt{1^2+0^2+1^2}=\sqrt{2}$$; the magnitude of $$\vec B$$ is $$\sqrt{3}$$. The dot product between the two is $$(\hat x+\hat z)\cdot(\hat x+\hat y+\hat z)=1(1)+0(1)+1(1)=2$$. Thus $$\theta=\cos^{-1}\left(\frac{2}{\sqrt{2}\sqrt{3}}\right)=\cos^{-1}0.8165=\fbox{35.2^\circ}$$

In the demo below, you can rotate the two arrows around and see how the dot product of the two is calculated.
Interactive 1.4.1