# Berk's question via email about an antiderivative

#### Prove It

##### Well-known member
MHB Math Helper
Evaluate \displaystyle \begin{align*} \int{ \mathrm{e}^{-2\,x}\cos{(3\,x)}\,\mathrm{d}x} \end{align*}
This requires using Integration By Parts twice...

\displaystyle \begin{align*} I &= \int{\mathrm{e}^{-2\,x}\cos{ \left( 3\,x \right) } \,\mathrm{d}x} \\ I &= \frac{1}{3}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} - \int{ -\frac{2}{3}\,\mathrm{e}^{-2\,x} \sin{(3\,x)}\,\mathrm{d}x } \\ I &= \frac{1}{3}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} + \frac{2}{3} \int{ \mathrm{e}^{-2\,x} \sin{(3\,x)} \,\mathrm{d}x } \\ I &= \frac{1}{3}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} + \frac{2}{3} \left[ -\frac{1}{3}\,\mathrm{e}^{-2\,x} \cos{(3\,x)} - \int{ \frac{2}{3}\,\mathrm{e}^{-2\,x} \cos{ \left( 3\,x \right) } \,\mathrm{d}x } \right] \\ I &= \frac{1}{3}\,\mathrm{e}^{-2\,x}\sin{ \left( 3\,x \right) } - \frac{2}{9}\,\mathrm{e}^{-2\,x} \cos{(3\,x)} - \frac{4}{9} \int{ \mathrm{e}^{-2\,x} \cos{(3\,x)} \,\mathrm{d}x } \\ I &= \frac{1}{3}\,\mathrm{e}^{-2\,x} \sin{ \left( 3\,x \right) } - \frac{2}{9} \,\mathrm{e}^{-2\,x} \cos{ \left( 3\,x \right) } - \frac{4}{9}\,I \\ \frac{13}{9}\,I &= \frac{3}{9}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} - \frac{2}{9}\,\mathrm{e}^{-2\,x} \cos{ \left( 3\, x\right) } \\ I &= \frac{3}{13}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} - \frac{2}{13}\,\mathrm{e}^{-2\,x} \cos{ \left( 3\,x \right) } \end{align*}

Thus \displaystyle \begin{align*} \int{ \mathrm{e}^{-2\,x} \cos{ \left( 3\,x \right) } \,\mathrm{d}x} = \frac{3}{13}\,\mathrm{e}^{-2\,x} \sin{(3\,x)} - \frac{2}{13}\,\mathrm{e}^{-2\,x} \cos{ \left( 3\,x \right) } + C \end{align*}

#### MarkFL

##### Pessimist Singularitarian
Staff member
Another approach would be to consider:

$$\displaystyle y=\int e^{ax}\cos(bx)\,dx$$

Thus:

$$\displaystyle \d{y}{x}=e^{ax}\cos(bx)$$

The homogeneous solution is:

$$\displaystyle y_h(x)=c_1$$

And the particular solution will take the form:

$$\displaystyle y_p(x)=e^{ax}\left(A\cos(bx)+B\sin(bx)\right)$$

Hence:

$$\displaystyle y_p'(x)=e^{ax}\left((Aa+Bb)\cos(bx)+(Ba-Ab)\sin(bx)\right)$$

Substituting into the ODE, we obtain:

$$\displaystyle e^{ax}\left((Aa+Bb)\cos(bx)+(Ba-Ab)\sin(bx)\right)=e^{ax}\cos(bx)$$

$$\displaystyle (Aa+Bb)\cos(bx)+(Ba-Ab)\sin(bx)=\cos(bx)+0\sin(bx)$$

Equating coefficients, we obtain the system:

$$\displaystyle Aa+Bb=1$$

$$\displaystyle Ba-Ab=0$$

Solving this system, we obtain:

$$\displaystyle (A,B)=\left(\frac{a}{a^2+b^2},\frac{b}{a^2+b^2}\right)$$

And so our particular solution is:

$$\displaystyle y_p(x)=\frac{e^{ax}}{a^2+b^2}\left(a\cos(bx)+b\sin(bx)\right)$$

And then by the principle of superposition, there results:

$$\displaystyle y(x)=y_h(x)+y_p(x)=c_1+\frac{e^{ax}}{a^2+b^2}\left(a\cos(bx)+b\sin(bx)\right)$$

And so we conclude:

$$\displaystyle \int e^{ax}\cos(bx)\,dx=\frac{e^{ax}}{a^2+b^2}\left(a\cos(bx)+b\sin(bx)\right)+C$$

In the given problem, we have:

$$\displaystyle a=-2,\,b=3$$

Plugging those in, we have:

$$\displaystyle \int e^{-2x}\cos(3x)\,dx=\frac{e^{-2x}}{13}\left(3\sin(bx)-2\cos(bx)\right)+C$$