First, we expand the equation:

Then, we combine certain terms in order to simplify them using trigonometry identities.

Note these identities:
Pythagoran relation:

Sum and Difference Formula/Identities:

Thus, if we apply these identities, the simplified equation would be:

Simplying further, the answer would be
![2[cos(A-B)+1]](https://img.qammunity.org/2017/formulas/mathematics/high-school/ewvd1z77pp61e0wly0llfcukchcl3leosz.png)