Expanding each square on the left side, you have
(x cos(A) + y sin(A))² = x² cos²(A) + 2xy cos(A) sin(A) + y² sin²(A)
(x sin(A) - y cos(A))² = x² sin²(A) - 2xy sin(A) cos(A) + y² cos²(A)
so that adding them together eliminates the identical middle terms and reduces to the sum to
x² cos²(A) + y² sin²(A) + x² sin²(A) + y² cos²(A)
Collecting terms to factorize gives us
(y² + x²) sin²(A) + (x² + y²) cos²(A)
(x² + y²) (sin²(A) + cos²(A))
and sin²(A) + cos²(A) = 1 for any A, so we end up with
x² + y²
as required.