# How do you integrate int e^(3x)cosx by integration by parts method?

Jul 22, 2016

$\int {e}^{3 x} \cos x \mathrm{dx} = {e}^{3 x} / 10 \left(3 \cos \left(x\right) + \sin \left(x\right)\right)$

#### Explanation:

This kind of integral can be straightforward solved using Moivre's identity

${e}^{i x} = \cos x + i \sin x$ so

$\int {e}^{3 x} \cos x \mathrm{dx} = \text{Real} \left(\int {e}^{3 x} \left(\cos x + i \sin x\right) \mathrm{dx}\right)$ or
$\int {e}^{3 x} \cos x \mathrm{dx} = \text{Real"(int e^{3x+ix}dx) = "Real} \left({e}^{3 x + i x} / \left(3 + i\right)\right)$

then

$\int {e}^{3 x} \cos x \mathrm{dx} = \text{Real} \left(\left(3 - i\right) {e}^{3 x} \frac{\cos x + i \sin x}{\left(3 - i\right) \left(3 + i\right)}\right)$

Finally

$\int {e}^{3 x} \cos x \mathrm{dx} = {e}^{3 x} / 10 \left(3 \cos \left(x\right) + \sin \left(x\right)\right)$

Jul 22, 2016

We can IBP this both ways

First approach

$I = \int {e}^{3 x} \cos x \setminus \mathrm{dx}$

$= \int \frac{d}{\mathrm{dx}} \left(\frac{1}{3} {e}^{3 x}\right) \cos x \setminus \mathrm{dx}$

which by IBP

$= \frac{1}{3} {e}^{3 x} \cos x - \int \frac{1}{3} {e}^{3 x} \frac{d}{\mathrm{dx}} \left(\cos x\right) \setminus \mathrm{dx}$

$= \frac{1}{3} {e}^{3 x} \cos x + \int \frac{1}{3} {e}^{3 x} \sin x \setminus \mathrm{dx}$

preparing for second IBP

$= \frac{1}{3} {e}^{3 x} \cos x + \int \frac{d}{\mathrm{dx}} \left(\frac{1}{9} {e}^{3 x}\right) \sin x \setminus \mathrm{dx}$

by IBP
$= \frac{1}{3} {e}^{3 x} \cos x + \frac{1}{9} {e}^{3 x} \sin x - \int \frac{1}{9} {e}^{3 x} \frac{d}{\mathrm{dx}} \left(\sin x\right) \setminus \mathrm{dx}$

$= \frac{1}{3} {e}^{3 x} \cos x + \frac{1}{9} {e}^{3 x} \sin x - \int \frac{1}{9} {e}^{3 x} \cos \setminus \mathrm{dx}$

$\implies I = \frac{1}{3} {e}^{3 x} \cos x + \frac{1}{9} {e}^{3 x} \sin x - \frac{I}{9} + C$

$I = \frac{9}{10} \left(\frac{1}{3} {e}^{3 x} \cos x + \frac{1}{9} {e}^{3 x} \sin x\right) + C$

$I = {e}^{3 x} / 10 \left(3 \cos x + \sin x\right) + C$

Second Approach

$I = \int {e}^{3 x} \cos x \setminus \mathrm{dx}$

$= \int {e}^{3 x} \frac{d}{\mathrm{dx}} \left(\sin x\right) \setminus \mathrm{dx}$

$= {e}^{3 x} \sin x - \int \frac{d}{\mathrm{dx}} \left({e}^{3 x}\right) \sin x \setminus \mathrm{dx} + C$

$= {e}^{3 x} \sin x - \int 3 {e}^{3 x} \sin x \setminus \mathrm{dx} + C$

Preparing for second IBP

$= {e}^{3 x} \sin x - \int 3 {e}^{3 x} \frac{d}{\mathrm{dx}} \left(- \cos x\right) \setminus \mathrm{dx} + C$

$= {e}^{3 x} \sin x + 3 {e}^{3 x} \cos x - \int \frac{d}{\mathrm{dx}} \left(3 {e}^{3 x}\right) \cos x \setminus \mathrm{dx} + C$

$= {e}^{3 x} \sin x + 3 {e}^{3 x} \cos x - \int 9 {e}^{3 x} \cos x \setminus \mathrm{dx} + C$

$= {e}^{3 x} \sin x + 3 {e}^{3 x} \cos x - 9 I + C$

$\implies 10 I = {e}^{3 x} \sin x + 3 {e}^{3 x} \cos x + C$

$I = {e}^{3 x} / 10 \left(\sin x + 3 \cos x\right) + C$

Same result, second way maybe a little bit snappier.