Cosine addition formula (source code)

= Cosine addition formula
{title2=$\cos(x+y)=\cos x\cos y-\sin x\sin y$}

The cosine addition formula gives the horizontal coordinate after two successive <rotations>:
$$
\boxed{\cos(x+y)=\cos x\cos y-\sin x\sin y.}
$$
The minus sign comes from the way a counterclockwise <rotation> mixes horizontal and vertical coordinates:
$$
\begin{pmatrix}\cos y&-\sin y\\ \sin y&\cos y\end{pmatrix}
\begin{pmatrix}\cos x\\ \sin x\end{pmatrix}
=\begin{pmatrix}\cos(x+y)\\ \sin(x+y)\end{pmatrix}.
$$
The two rows recover the <cosine addition formula> and <sine addition formula> together.

\Image[/trigonometric-angle-addition-rotation.png]
{title=Adding angles rotates a coordinate pair and mixes its sine and cosine components}

With $x=\pi/6$ and $y=\pi/4$, the resulting <angle> is $5\pi/12$, and
$$
\cos(5\pi/12)=\frac{\sqrt6-\sqrt2}{4},\qquad
\sin(5\pi/12)=\frac{\sqrt6+\sqrt2}{4}.
$$
Although the horizontal coordinate becomes small, the vertical one approaches one; their squared sum still obeys the <Pythagorean trigonometric identity>. Taking $y=-x$ in the <cosine addition formula>, together with the <even function> property of <cosine> and <odd function> property of <sine>, also recovers that identity.