Differentiate $f(x)=e^x\sin x$ 
$f(x)=e^x\sin x$

$$f'(x)=e^x\sin x+e^x\cos x $$
$$=e^x\sin x+e^x\sin (\frac{\pi}{2}+x)$$
That's what I got. But, my book wrote something else.
$$f'(x)=\sqrt{2}e^x\sin (x+\frac{\pi}{4})$$
How they had taken common?

Note that$$\sqrt2\sin\left(x+\frac\pi4\right)=\sqrt2\left(\sin(x)\cos\left(\frac\pi4\right)+\cos(x)\sin\left(\frac\pi4\right)\right)=\sin(x)+\cos(x).$$
