(cos(x) + cos(y))^2 + (sin(x) - sin(y))^2 Remove the brackets cos^2(x) + cos^2(y) + 2cos(x)*cos(y) + sin^2(x) - 2(sin(x)*sin(y) + sin^2(y) Combine these two in bold to make 1 because sin^2(x) + cos^2(x) = 1
1 + cos^2(y) + 2cos(x)*cos(y) - 2*sin(x)*cos(y) + sin^2(y) These two in bold also make 1
2 + 2cos(x)*cos(y) - 2*sin(X)*sin(y) Bring out a common factor of 2 2 +2(cos(x)*cos(y) - sin(x)*sin(y) )