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

Sep 14, 2016

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

#### Explanation:

$\int x {e}^{x} \sin x \mathrm{dx}$

$= m a t h c a l \left\{I\right\} \left\{\int x {e}^{x} {e}^{i x} \mathrm{dx}\right\}$

$= m a t h c a l \left\{I\right\} \left\{\textcolor{red}{\int x {e}^{\left(1 + i\right) x} \mathrm{dx}}\right\}$

working the bit in red by IBP

$\int x {e}^{\left(1 + i\right) x} \mathrm{dx}$

$= \int x \frac{d}{\mathrm{dx}} \left(\frac{1}{1 + i} {e}^{\left(1 + i\right) x}\right) \mathrm{dx}$

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

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

$= \frac{x}{1 + i} {e}^{\left(1 + i\right) x} - \frac{1}{1 + i} ^ 2 {e}^{\left(1 + i\right) x} + C$

$= \frac{1 - i}{1 - i} \frac{x}{1 + i} {e}^{\left(1 + i\right) x} - {\left(\frac{1 - i}{1 - i}\right)}^{2} \frac{1}{1 + i} ^ 2 {e}^{\left(1 + i\right) x} + C$

$= \left(1 - i\right) \frac{x}{2} {e}^{\left(1 + i\right) x} - {\left(1 - i\right)}^{2} \frac{1}{4} {e}^{\left(1 + i\right) x} + C$

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

And so we want

$= m a t h c a l \left\{I\right\} \left\{\left(1 - i\right) \frac{x}{2} {e}^{x} \left(\cos x + i \sin x\right) + \frac{i}{2} {e}^{x} \left(\cos x + i \sin x\right) + C\right\}$

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