# Calculus/Integration techniques/Integration by Complexifying

 ← Integration techniques/Integration by Parts Calculus Integration techniques/Partial Fraction Decomposition → Integration techniques/Integration by Complexifying

This technique requires an understanding and recognition of complex numbers. Specifically Euler's formula:

${\displaystyle \cos(\theta )+i\sin(\theta )=e^{\theta i}}$

Recognize, for example, that the real portion:

${\displaystyle {\text{Re}}\left\{e^{\theta i}\right\}=\cos(\theta )}$

Given an integral of the general form:

${\displaystyle \int e^{x}\cos(2x)dx}$

We can complexify it:

${\displaystyle \int {\text{Re}}{\Big \{}e^{x}{\big (}\cos(2x)+i\sin(2x){\big )}{\Big \}}dx}$
${\displaystyle \int {\text{Re}}{\big \{}e^{x}(e^{2xi}){\big \}}dx}$

With basic rules of exponents:

${\displaystyle \int {\text{Re}}\{e^{x+2ix}\}dx}$

It can be proven that the "real portion" operator can be moved outside the integral:

${\displaystyle {\text{Re}}\left\{\int e^{x(1+2i)}dx\right\}}$

The integral easily evaluates:

${\displaystyle {\text{Re}}\left\{{\frac {e^{x(1+2i)}}{1+2i}}\right\}}$

Multiplying and dividing by ${\displaystyle 1-2i}$ :

${\displaystyle {\text{Re}}\left\{{\frac {1-2i}{5}}e^{x(1+2i)}\right\}}$

Which can be rewritten as:

${\displaystyle {\text{Re}}\left\{{\frac {1-2i}{5}}e^{x}e^{2ix}\right\}}$

Applying Euler's forumula:

${\displaystyle {\text{Re}}\left\{{\frac {1-2i}{5}}e^{x}{\big (}\cos(2x)+i\sin(2x){\big )}\right\}}$

Expanding:

${\displaystyle {\text{Re}}\left\{{\frac {e^{x}}{5}}{\big (}\cos(2x)+2\sin(2x){\big )}+i\cdot {\frac {e^{x}}{5}}{\big (}\sin(2x)-2\cos(2x){\big )}\right\}}$

Taking the Real part of this expression:

${\displaystyle {\frac {e^{x}}{5}}{\big (}\cos(2x)+2\sin(2x){\big )}}$

So:

${\displaystyle \int e^{x}\cos(2x)dx={\frac {e^{x}}{5}}{\big (}\cos(2x)+2\sin(2x){\big )}+C}$