# Integration of e^x Cos x

In this tutorial we shall derive the integral of e^x into the cosine function, and this integral can be evaluated by using the integration by parts method.

The integration is of the form
$I = \int {{e^x}\cos xdx} \,\,\,\,{\text{ – – – }}\left( {\text{i}} \right)$

Here the first function is $f\left( x \right) = {e^x}$ and the second function is $g\left( x \right) = \cos x$

By using the integration by parts formula
$\int {\left[ {f\left( x \right)g\left( x \right)} \right]dx = f\left( x \right)\int {g\left( x \right)dx – \left[ {\frac{d}{{dx}}f\left( x \right)\left( {\int {g\left( x \right)} dx} \right)} \right]} dx}$

Equation (i) will become
$\begin{gathered} I = {e^x}\int {\cos xdx – \int {\left[ {\frac{d}{{dx}}{e^x}\left( {\int {\cos xdx} } \right)} \right]} dx} \\ \Rightarrow I = {e^x}\left( {\sin x} \right) – \int {\left[ {{e^x}\left( {\sin x} \right)} \right]} dx \\ \Rightarrow I = \sin x{e^x} – \int {{e^x}\sin x} dx \\ \end{gathered}$

Again using the integration by parts formula, we have
$\begin{gathered} I = \sin x{e^x} – {e^x}\int {\sin x} dx + \int {\left[ {\frac{d}{{dx}}{e^x}\left( {\int {\sin x} } \right)dx} \right]} dx \\ \Rightarrow I = \sin x{e^x} – {e^x}\cos x – \int {{e^x}\cos x} dx \\ \end{gathered}$

But using $I = \int {{e^x}\cos xdx}$, we have
$\begin{gathered} I = \sin x{e^x} – {e^x}\cos x – I \\ \Rightarrow I + I = \sin x{e^x} – {e^x}\cos x \\ \Rightarrow 2I = \sin x{e^x} – {e^x}\cos x \\ \Rightarrow I = \frac{1}{2}\left( {\sin x{e^x} – {e^x}\cos x} \right) + c \\ \Rightarrow \int {{e^x}\cos x} dx = \frac{1}{2}\left( {\sin x{e^x} – {e^x}\cos x} \right) + c \\ \end{gathered}$