Welcome to Math Help Forum!
The first identity is arrived at like this:
Let , for some values of and
Then using the addition formula ,
Compare coefficients of and :
Square (1) and (2) and add:
Divide (2) by (1):
So , where and
Does that help to clear things up?