How do you integrate int e^-xcosx by parts from [0,2]?

Mar 25, 2018

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

Explanation:

Let's pick $u , \mathrm{dv}$ and solve for $v , \mathrm{du} :$

$u = {e}^{-} x$

$\mathrm{du} = - {e}^{-} x \mathrm{dx}$

$\mathrm{dv} = \cos x \mathrm{dx}$

$v = \sin x$

Thus, we apply $\int u \mathrm{dv} = u v - \int v \mathrm{du}$:

$\int {e}^{-} x \cos x \mathrm{dx} = {e}^{-} x \sin x + \int {e}^{-} x \sin x \mathrm{dx}$

This didn't yield anything solvable, let's integrate by parts once more, for $\int {e}^{-} x \sin x \mathrm{dx}$:

$u = {e}^{-} x$

$\mathrm{du} = - {e}^{-} x \mathrm{dx}$

$\mathrm{dv} = \sin x \mathrm{dx}$

$v = - \cos x$

Applying the integration by parts formula, we get

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

There's nothing here we can solve, but note how our original integral showed up again.

Now, we said

$\int {e}^{-} x \cos x \mathrm{dx} = {e}^{-} x \sin x + \int {e}^{-} x \sin x \mathrm{dx}$

So, let's plug in what we got for $\int {e}^{-} x \sin x \mathrm{dx}$ in:

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

Solve for $\int {e}^{-} x \cos x \mathrm{dx} :$

$2 \int {e}^{-} x \cos x \mathrm{dx} = {e}^{-} x \sin x - {e}^{-} x \cos x$

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

Note I have not put in a constant of integration because we're going to be taking a definite integral:

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