<s>[INST] Integrate $\int^{\ln(2)}_0 (3e^u - e^{2u} - 2)\sin(nu)du$ I'm having trouble integrating this function
$$\begin{equation}
\begin{split}
f(x) & = \int^1_0x(1-x)\sqrt{1+x}\sqrt{1+x}\sin(n \ln(1+x))/[(1+x)^2] = \\
 & = \int^1_0x(1-x)(1+x)\sin(n\ln(1+x))/[(1+x)^2] = \\
 & = \int^1_0x(1-x)\sin(n\ln(1+x))/[1+x] = \\
 & = \int^{ln(2)}_0(e^u - 1)(1 - (e^u - 1))\sin(nu)du = \\
 & = \int^{ln(2)}_0(e^u - 1)(2 - e^u)\sin(nu)du = \\
 & = \int^{ln(2)}_0(2e^u -e^{2u} - 2 + e^u)\sin(nu)du = \\
 & = \int^{ln(2)}_0 (3e^u - e^{2u} - 2)\sin(nu)du \\
\end{split}
\end{equation}$$
Where

$$u = \ln(1+x)\quad du = \frac{1}{(1+x)}\quad e^u = 1 + x\quad x = e^u - 1$$

So this last part is where I having a lot of trouble in.
 [/INST] \begin{equation}
\begin{split}
f(x) &= \int^{\ln2}_0 (3e^u - e^{2u} - 2)\sin nu \,du\\
&=3\int^{\ln2}_0 e^u\sin nu \,du-\int^{\ln2}_0e^{2u}\sin nu \,du-2\int^{\ln2}_0\sin nu \,du\\
&=3\int^{\ln2}_0 e^u\sin nu \,du-\int^{\ln2}_0e^{2u}\sin nu \,du+\frac{2}{n}(\cos(n\ln2)-1)
\end{split}
\end{equation}
The first two integrals can be solved by using integration by parts. Let
\begin{equation}
I(a)=\int e^{ax}\sin bx\,dx
\end{equation}
Then, let
\begin{equation}
\begin{split}
u&=\sin bx\\
du&=b\cos bx\,dx
\end{split}
\end{equation}
and
\begin{equation}
\begin{split}
dv&=e^{ax}\,dx\\
v&=\frac1a e^{ax}
\end{split}
\end{equation}
Hence
\begin{equation}
I(a)=\frac1a e^{ax}\sin bx-\frac ba\int e^{ax}\cos bx\,dx
\end{equation}
Again using integration by parts to solve the RHS integral. Let
\begin{equation}
\begin{split}
u&=\cos bx\\
du&=-b\sin bx\,dx
\end{split}
\end{equation}
and
\begin{equation}
\begin{split}
dv&=e^{ax}\,dx\\
v&=\frac1a e^{ax}
\end{split}
\end{equation}
Then
\begin{equation}
\begin{split}
I(a)&=\frac1a e^{ax}\sin bx-\frac ba\left[\frac1a e^{ax}\cos bx+\frac ba\int e^{ax}\sin bx\,dx\right]\\
&=\frac1a e^{ax}\sin bx-\frac b{a^2}e^{ax}\cos bx-\frac {b^2}{a^2}I(a)\\
I(a)+\frac {b^2}{a^2}I(a)&=\frac {1}{a^2}\left(ae^{ax}\sin bx-be^{ax}\cos bx\right)\\
\frac{a^2+b^2}{a^2}I(a)&=\frac {1}{a^2}\left(ae^{ax}\sin bx-be^{ax}\cos bx\right)\\
I(a)&=\frac {ae^{ax}\sin bx-be^{ax}\cos bx}{a^2+b^2}\\
\end{split}
\end{equation}
I thing it's enough, the rest you can solve it by yourself Cloud15.
</s>