The key to understanding expanding brackets is to understand that we need to multipy EVERYTHING in the first bracket by EVERYTHING in the second bracket.
We can think of the calculation
The cosine rule is used to find the length of a side or size of an angle.
Take a look at the triangle below: