Evaluate this integral: $\displaystyle\int_{-\pi/8}^{3\pi/8}e^{2x}\sin(2x+\pi/4)dx$

calculusdefinite integralsintegrationtrigonometry

So I was actually cleaning up my stuff around 15 minutes ago when I found this random piece of paper laying around which contained the integral$$\int_{-\pi/8}^{+3\pi/8}e^{2x}\sin\left(2x+\dfrac\pi4\right)dx$$that I might have created around a month (month and a half?) ago, which is a beast of an integral in my opinion. However, I couldn't find any other pieces of paper which contained how to evaluate it, although I thought that I might still be able to evaluate it. Here is my attempt at doing so:$$\int_{-\pi/8}^{+3\pi/8}e^{2x}\sin\left(2x+\dfrac\pi4\right)dx=\dfrac{\sqrt{2}}2\int_{-\pi/8}^{+3\pi/8}e^{2x}(\sin(2x)+\cos(2x))dx$$Now, what do we do from here? This looked to me like the derivative of $e^{2x}\sin(2x)$, but we don't have a $2$ to spare to get this into$$\dfrac d{dx}f(x)g(x)=f(x)g'(x)+f'(x)g(x)$$form. Or do we? We can obviously do$$\dfrac{\sqrt{2}}2\int_{-\pi/8}^{+3\pi/8}e^{2x}(\sin(2x)+\cos(2x))dx\implies\dfrac{\sqrt2}4\int_{-\pi/8}^{+3\pi/8}2e^{2x}(\sin(2x)+\cos(2x))dx$$can we not? So our integral is now$$\dfrac{\sqrt2}4\int_{-\pi/8}^{+3\pi/8}2e^{2x}(\sin(2x)+\cos(2x))dx\implies\dfrac{\sqrt2}4\int_{-\pi/8}^{+3\pi/8}\dfrac d{dx}(e^{2x}\sin(2x))dx$$$$\implies\dfrac{\sqrt2}4\left[e^{2x}\sin(2x)\right]_{-\pi/8}^{+3\pi/8}\implies\dfrac{\sqrt2}4\left(e^{3\pi/4}\sin(3\pi/4)+\dfrac{\sin(\pi/4)}{e^{\pi/4}}\right)$$$$=\dfrac{\sqrt2e^\pi\sin(3\pi/4)+\sqrt2\sin(\pi/4)}{4e^{\pi/4}}=0.25e^{-0.25\pi}(1+e^\pi)$$$$\approx2.751665550491$$$$\therefore I=\int_{-\pi/8}^{+3\pi/8}e^{2x}\sin\left(2x+\dfrac\pi4\right)dx=0.25e^{-0.25\pi}(1+e^\pi)$$


My question


Have I evaluated this integral correctly, or what would I do to evaluate it correctly, or does the integral diverge?

Best Answer

Your result is correct but a quicker technique is the following.

First reduce to a much more usual integral, by change of variable $t=2x+\frac\pi4:$ $$I:=\int_{-\pi/8}^{+3\pi/8}e^{2x}\sin\left(2x+\dfrac\pi4\right)\,dx=\frac{e^{-\pi/4}}2J,\text{ with }J:=\int_0^\pi e^t\sin t\,dt.$$

Next, instead of doing twice an integration by parts, use that $\sin t$ is the imaginary part of $e^{it}$: $$\begin{align}J&=\operatorname{Im}\left(\int_0^\pi e^{(1+i)t}\,dt\right)\\&=\operatorname{Im}\left(\frac{e^{(1+i)\pi}-e^{(1+i)0}}{1+i}\right)\\&=\operatorname{Im}\left(\frac{(-e^\pi-1)(1-i)}2\right)\\&=\frac{e^\pi+1}2, \end{align}$$ and conclude: $$I=\frac{e^{-\pi/4}(e^\pi+1)}4.$$