How do you integrate int e^xsinx by integration by parts method?

Oct 17, 2016

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

Explanation:

Integration by parts can be expressed:

$\int u \left(x\right) v ' \left(x\right) \mathrm{dx} = u \left(x\right) v \left(x\right) - \int v \left(x\right) u ' \left(x\right) \mathrm{dx}$

$\textcolor{w h i t e}{}$
Let $u \left(x\right) = {e}^{x}$, $v \left(x\right) = - \cos \left(x\right)$

Then $u ' \left(x\right) = {e}^{x}$, $v ' \left(x\right) = \sin \left(x\right)$

and we find:

$\int {e}^{x} \sin x \mathrm{dx} = - {e}^{x} \cos \left(x\right) + \int {e}^{x} \cos \left(x\right) \mathrm{dx} + {C}_{1}$

$\textcolor{w h i t e}{}$
Let $u \left(x\right) = {e}^{x}$, $v \left(x\right) = \sin \left(x\right)$

Then $u ' \left(x\right) = {e}^{x}$, $v ' \left(x\right) = \cos \left(x\right)$

and we find:

$\int {e}^{x} \cos \left(x\right) \mathrm{dx} = {e}^{x} \sin \left(x\right) - \int {e}^{x} \sin \left(x\right) \mathrm{dx} + {C}_{2}$

$\textcolor{w h i t e}{}$
Combining these two results, we find:

$\int {e}^{x} \sin x \mathrm{dx} = - {e}^{x} \cos \left(x\right) + {e}^{x} \sin \left(x\right) - \int {e}^{x} \sin x \mathrm{dx} + \left({C}_{1} + {C}_{2}\right)$

and hence:

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

$\textcolor{w h i t e}{}$
Footnote

Integration by parts is very useful, but can end up leading you down a rabbit hole if you do not choose the parts appropriately.

In the example above, I would instead tend to find the integral by seeing what happens when you differentiate ${e}^{x} \sin \left(x\right)$ and ${e}^{x} \cos \left(x\right)$ then combine the results:

$\frac{d}{\mathrm{dx}} {e}^{x} \sin \left(x\right) = {e}^{x} \sin \left(x\right) + {e}^{x} \cos \left(x\right)$

$\frac{d}{\mathrm{dx}} {e}^{x} \cos \left(x\right) = {e}^{x} \cos \left(x\right) - {e}^{x} \sin \left(x\right)$

So by subtracting the second from the first of these, we find:

$\frac{d}{\mathrm{dx}} \left({e}^{x} \left(\sin \left(x\right) - \cos \left(x\right)\right)\right) = {e}^{x} \sin \left(x\right) + \textcolor{red}{\cancel{\textcolor{b l a c k}{{e}^{x} \left(\cos \left(x\right)\right)}}} - \textcolor{red}{\cancel{\textcolor{b l a c k}{{e}^{x} \left(\cos \left(x\right)\right)}}} + {e}^{x} \sin \left(x\right)$

$\textcolor{w h i t e}{\frac{d}{\mathrm{dx}} \left({e}^{x} \left(\sin \left(x\right) - \cos \left(x\right)\right)\right)} = 2 {e}^{x} \sin \left(x\right)$

Hence:

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