# Converting Sum of Trigonometric Functions into Product

To convert sum of trigonometric functions into sum following formulas are used:

- `sin(alpha)+sin(beta)=2sin((alpha+beta)/2)cos((alpha-beta)/2)`,
- `sin(alpha)-sin(beta)=2sin((alpha-beta)/2)cos((alpha+beta)/2)`,
- `cos(alpha)+cos(beta)=2cos((alpha+beta)/2)cos((alpha-beta)/2)`,
- `cos(alpha)-cos(beta)=-2sin((alpha+beta)/2)sin((alpha-beta)/2)`,
- `tan(alpha)+tan(beta)=(sin(alpha+beta))/(cos(alpha)cos(beta))`,
- `tan(alpha)-tan(beta)=(sin(alpha-beta))/(cos(alpha)cos(beta))`.

Formulas (5) and (6) are valid when `alpha` and `beta` not equal `pi/2+pi k, k in ZZ`.

**Example**. Convert into product `cos(48^0)-cos(12^0)`.

Apply formula (4) for with `alpha=48^0,beta=12^0`:

`cos(48^0)-cos(12^0)=-2sin((48^0+12^0)/2)sin((48^0-12^0)/2)=-2sin(30^0)sin(18^0)`.

Since `sin(30^0)=1/2` then `cos(48^0)-cos(12^0)=-sin(18^0)`.