Integration of e^x Cos x

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

The integration of the form

I =  \int {{e^x}\cos xdx} \,\,\,\,{\text{ -  -  - }}\left( {\text{i}} \right)

Here first function is f\left(  x \right) = {e^x} and second function will be g\left( x \right) = \cos x
By using 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 becomes

\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 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}