# Trigonometry/For Enthusiasts/Transformation of products into sums

In this section, we shall see how to convert a product of two trigonometric functions into a sum or difference of two such functions, and vice versa.

## Product into sumEdit

$\displaystyle \sin(A) \cos(B) + \cos(A) \sin(B) = \sin(A+B)$

and

$\displaystyle \sin(A) \cos(B) - \cos(A) \sin(B) = \sin(A-B)$.

Adding these two equations and dividing both sides by 2, we get

$\displaystyle \sin(A) \cos(B) = \frac{1}{2} (\sin(A+B) + \sin(A-B))$

Subtracting the second from the first equation and dividing both sides by 2, we get

$\displaystyle \cos(A) \sin(B) = \frac{1}{2} (\sin(A+B) - \sin(A-B))$

We also know that

$\displaystyle \cos(A) \cos(B) - \sin(A) \sin(B) = \cos(A+B)$

and

$\displaystyle \cos(A) \cos(B) + \sin(A) \sin(B) = \cos(A-B)$.

Adding these two equations and dividing both sides by 2, we get

$\displaystyle \cos(A) \cos(B) = \frac{1}{2} (\cos(A+B) + \cos(A-B))$

Subtracting the first from the second equation and dividing both sides by 2, we get

$\displaystyle \sin(A) \sin(B) = \frac{1}{2} (\cos(A-B) - \cos(A+B))$

Thus we can express:

1. The product of a sine and cosine as the sum or difference of two sines;
2. The product of two cosines as the sum of two cosines;
3. The product of two sines as the difference of two sines.

## Sum into productEdit

Let C = A+B and D = A-B. Then

$\displaystyle A = \frac{1}{2} (C+D); \,\,\,\, B = \frac{1}{2} (C-D)$

Substituting into the above expressions and multiplying both sides by two in each of them, we have:

$\displaystyle \sin(C) + \sin(D) = 2 \sin(\frac{C+D}{2}) \cos(\frac{C-D}{2})$
$\displaystyle \sin(C) - \sin(D) = 2 \cos(\frac{C+D}{2}) \sin(\frac{C-D}{2})$
$\displaystyle \cos(C) + \cos(D) = 2 \cos(\frac{C+D}{2}) \cos(\frac{C-D}{2})$
$\displaystyle \cos(C) - \cos(D) = -2 \sin(\frac{C+D}{2}) \sin(\frac{C-D}{2})$