<s>[INST] Find the $n$ derivative of $y= e^{2x}\sin^2 x$ We have 
\begin{align*}
y&= e^{2x}\sin^2 x\\
&= e^{2x}\left(\frac{1-\cos 2x}{2}\right)\\
&= \frac{e^{2x}}{2} - \frac{e^{2x}\cos 2x}{2}
\end{align*}
Then
\begin{align*}
y^{(n)} &= \left(\frac{e^{2x}}{2}\right)^{(n)} - \left(\frac{e^{2x}\cos 2x}{2}\right)^{(n)}\\
&= 2^{n-1}e^{2x} - \left(\frac{e^{2x}\cos 2x}{2}\right)^{(n)}
\end{align*}
I don't know how to proceed with the rightmost term. So far I've been applying the Leibniz Rule whenever I've had to find the $n$ derivative of a function of the form $f(x)g(x)$, because is clear that either $f(x)$ or $g(x)$ has a derivative a $k$ derivative ($1<k<n$) equal to zero, which simplifies the expression nicely.
But here
$$\frac{e^{2x}\cos 2x}{2}$$
both functions are infinitely differentiable on $\mathbb{R}$ which makes things a bit different.
My only attempt was to write its n derivative in this form
\begin{align*}
&=\frac{1}{2}\sum_{k=0}^n{n \choose k} \big(2^k e^{2x}\big)\bigg(2^{n-k}\cos \left[2x + \frac{\pi(n-k)}{2}\right]\bigg)\\
&=\sum_{k=0}^n {n \choose k} 2^{n-1}e^{2x}\cos \left[2x + \frac{\pi(n-k)}{2}\right]
\end{align*}
So 
\begin{align*}
y^{(n)} &= 2^{n-1}e^{2x} -\sum_{k=0}^n{n \choose k} 2^{n-1}e^{2x}\cos \left[2x + \frac{\pi(n-k)}{2}\right]\\
&= 2^{n-1}e^{2x}\left(1 -\sum_{k=0}^n{n \choose k} \cos \left[2x + \frac{\pi(n-k)}{2}\right]\right)
\end{align*}
But the textbook's answer is
$$2^{n-1}e^{2x}\left(1 -2^{n/2}\cos \left[2x + \frac{\pi n}{4}\right]\right)$$
For some reason I have the feeling that a little of modular arithmetic has to be applied on $\frac{\pi(n-k)}{2}$
 [/INST] Taking into consideration just the second part, let's call 
$$p(x)=e^{2x}\cos 2x$$
then 
\begin{align}
&p^{(1)}(x)=2e^{2x}\cos 2x-2e^{2x}\sin 2x\\
&p^{(1)}(x)=2e^{2x}(\cos 2x-\sin 2x)=2e^{2x}\sqrt{2}\left(\frac{\sqrt{2}}{2}\cos 2x-\frac{\sqrt{2}}{2}\sin 2x\right)\\
&p^{(1)}(x)=2^{3/2}e^{2x}\left(\cos(\pi/4)\cos 2x-\sin(\pi/4)\sin 2x\right)\\
&p^{(1)}(x)=2^{3/2}e^{2x}\cos\left( 2x+\pi/4 \right)
\end{align}
and following the same calculation that we just did we can conclude that 
$$p^{(2)}(x)=2^{3/2}2^{3/2}e^{2x}\cos\left( 2x+\pi/4+\pi/4 \right)$$
Now we can see the pattern. So we can prove by finite induction that 
$$p^{(n)}(x)=2^{3n/2}e^{2x}\cos\left( 2x+n\pi/4\right)$$
and finaly:
$$\left(\frac{e^{2x}\cos 2x}{2}\right)^{(n)}=2^{3n/2-1}e^{2x}\cos\left( 2x+n\pi/4\right)$$
</s>