# How do you evaluate the integral int e^-xcosx?

Jun 6, 2017

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

#### Explanation:

Let:

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

We can use integration by parts:

Let $\left\{\begin{matrix}u & = \cos x & \implies \frac{\mathrm{du}}{\mathrm{dx}} & = - \sin x \\ \frac{\mathrm{dv}}{\mathrm{dx}} & = {e}^{- x} & \implies v & = - {e}^{x}\end{matrix}\right.$

Then plugging into the IBP formula:

$\int \setminus \left(u\right) \left(\frac{\mathrm{dv}}{\mathrm{dx}}\right) \setminus \mathrm{dx} = \left(u\right) \left(v\right) - \int \setminus \left(v\right) \left(\frac{\mathrm{du}}{\mathrm{dx}}\right) \setminus \mathrm{dx}$

gives us

$\int \setminus \left(\cos x\right) \left({e}^{- x}\right) \setminus \mathrm{dx} = \left(\cos x\right) \left(- {e}^{- x}\right) - \int \setminus \left(- {e}^{- x}\right) \left(- \sin x\right) \setminus \mathrm{dx}$
$\therefore I = - {e}^{- x} \cos x - \int \setminus {e}^{- x} \setminus \sin x \setminus \mathrm{dx}$ .... [A]

At first it appears as if we have made no progress, as now the second integral is similar to $I$, having exchanged $\cos x$ for $\sin x$, but if we apply IBP a second time then the progress will become clear:

Let $\left\{\begin{matrix}u & = \sin x & \implies \frac{\mathrm{du}}{\mathrm{dx}} & = \cos x \\ \frac{\mathrm{dv}}{\mathrm{dx}} & = {e}^{- x} & \implies v & = - {e}^{- x}\end{matrix}\right.$

Then plugging into the IBP formula, gives us:

$\int \setminus \left(\sin x\right) \left({e}^{- x}\right) \setminus \mathrm{dx} = \left(\sin x\right) \left(- {e}^{- x}\right) - \int \setminus \left(- {e}^{- x}\right) \left(\cos x\right) \setminus \mathrm{dx}$
$\therefore \int \setminus {e}^{- x} \setminus \sin x \setminus \mathrm{dx} = - {e}^{- x} \sin x + I$

Inserting this result into [A] we get:

$I = - {e}^{- x} \cos x + {e}^{- x} \sin x - I + A$

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