Trigonometric Factorization How can I factorize this expression: $\sin(x) + \cos(y)$?  I've entered this input in Mathemetica:
TrigFactor[Sin[x] + Cos[y]]

and the output was:
$$ 2\sin\left(\frac{\pi}{4} + \frac{x}{2} - \frac{y}{2}\right)\sin\left(\frac{\pi}{4} + \frac{x}{2} + \frac{y}{2}\right). $$
I don't know how to get step-by-step solution so I don't know how to get to this  factored expression. Can someone please show me how?
 A: We use the identities:
$$
\tag{1}\cos u =\sin\Bigl({\pi\over2}-u\Bigr)
$$
and$$
\tag {2}\sin u +\sin v= { 2}\sin\Bigl({u+v\over 2} \Bigr)\cos\Bigl({u-v\over 2} \Bigr).
$$ 

We have, by (1): $$
\sin x+\cos y= \color{maroon}{ \sin x +\sin \Bigl( {\pi\over2}-y\Bigr)}.$$
From (2):$$
\eqalign{
\color{maroon}{
\sin x +\sin\Bigl ( {\pi\over2}-y\Bigr)}&=
{ 2}\sin\Bigl({{\pi\over2}+x-y\over 2} \Bigr)\cos\Bigl( {x-{\pi\over2}+ y\over 2}\Bigr  )\cr
&=\color{darkgreen}{{ 2}\sin\Bigl(\textstyle{{\pi\over4}+{x\over2}-{y\over 2}} \Bigr)
\cos\Bigl(\textstyle {{x\over2}-{\pi\over4}+ {y\over 2}}\Bigr  ) }
.
}
$$
Using (1) again:
$$\color{darkgreen}{
{ 2}\sin\Bigl(\textstyle{{\pi\over4}+{x\over2}-{y\over 2}} \Bigr)
\cos\Bigl(\textstyle {{x\over2}-{\pi\over4}+ {y\over 2}}\Bigr  ) }
= { 2}\sin\Bigl( \textstyle{{\pi\over4}+{x\over2}-{y\over 2}} \Bigr)
\color{orange}{\sin\Bigl(  {  {\pi\over4 }-{x\over2}- {y\over 2}}\Bigr  )}.
$$
Since $\sin({\pi\over2}+\theta)=\sin({\pi\over2}-\theta)$:
$$
\color{orange}{\sin\Bigl(  \textstyle{  {\pi\over4 }-{x\over2}- {y\over 2}}\Bigr  ) } 
=\sin\Bigl(  \textstyle{  {\pi\over4 }+{x\over2}+ {y\over 2}}\Bigr  )  .
$$
Putting everything together  gives your result.
