# How do you integrate e^x*cos(x)?

Aug 13, 2016

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

#### Explanation:

Going to have to use integration by parts twice.

For $u \left(x\right) \mathmr{and} v \left(x\right)$, IBP is given by

$\int u v ' \mathrm{dx} = u v - \int u ' v \mathrm{dx}$

Let $u \left(x\right) = \cos \left(x\right) \implies u ' \left(x\right) = - \sin \left(x\right)$

$v ' \left(x\right) = {e}^{x} \implies v \left(x\right) = {e}^{x}$

$\int {e}^{x} \cos \left(x\right) \mathrm{dx} = {e}^{x} \cos \left(x\right) + \textcolor{red}{\int {e}^{x} \sin \left(x\right) \mathrm{dx}}$

Now use IBP on the red term.

$u \left(x\right) = \sin \left(x\right) \implies u ' \left(x\right) = \cos \left(x\right)$

$v ' \left(x\right) = {e}^{x} \implies v \left(x\right) = {e}^{x}$

$\int {e}^{x} \cos \left(x\right) \mathrm{dx} = {e}^{x} \cos \left(x\right) + \left[{e}^{x} \sin \left(x\right) - \int {e}^{x} \cos \left(x\right) \mathrm{dx}\right]$

Group the integrals together:

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

Therefore

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

Aug 13, 2016

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

We use,

The Rule of Integration by Parts $: \int u v \mathrm{dx} = u \int v \mathrm{dx} - \int \left[\frac{\mathrm{du}}{\mathrm{dx}} \int v \mathrm{dx}\right] \mathrm{dx}$.

We take, $u = \cos x , \mathmr{and} , v = {e}^{x}$.

Hence, $\frac{\mathrm{du}}{\mathrm{dx}} = - \sin x , \mathmr{and} , \int v \mathrm{dx} = {e}^{x}$. Therefore,

$I = {e}^{x} \cos x + \int {e}^{x} \sin x \mathrm{dx} = {e}^{x} \cos x + J , J = \int {e}^{x} \sin x \mathrm{dx}$.

To find $J$, we apply the same Rule, but, now, with $u = \sin x$, &,

$v = {e}^{x}$, we get,

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

Sub.ing this in $I$, we have,

$I = {e}^{x} \cos x + {e}^{x} \sin x - I$, i.e.,

$2 I = {e}^{x} \left(\cos x + \sin x\right)$, or,

$I = {e}^{x} / 2. \left(\cos x + \sin x\right)$.

Enjoy Maths.!

Aug 13, 2016

${e}^{x} / 2 \left(\cos x + \sin x\right) + C$.

#### Explanation:

Let $I = {e}^{x} \cos x \mathrm{dx} , \mathmr{and} , J = \int {e}^{x} \sin x \mathrm{dx}$

Using IBP  ;intuvdx=uintvdx-int[(du)/dxintvdx]dx, with,

$u = \cos x \mathmr{and} , v = {e}^{x}$, we get,

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

$I = {e}^{x} \cos x + J \Rightarrow I - J = {e}^{x} \cos x \ldots . \ldots \ldots \ldots \ldots \ldots . . \left(1\right)$

Again by IBP, in $J$ we get, $J = {e}^{x} \sin x - \int {e}^{x} \cos x$, thus,

$J = {e}^{x} \sin x - I \Rightarrow J + I = {e}^{x} \sin x \ldots \ldots \ldots \ldots \ldots . . \left(2\right)$

Solving (1) & (2) for $I \mathmr{and} J$, we have,

$I = {e}^{x} / 2 \left(\cos x + \sin x\right) + C , \mathmr{and} , J = {e}^{x} / 2 \left(\sin x - \cos x\right) + K$

Enjoy Maths.!