Question:
Evaluate the following integrals:
$\int e^{a x} \cos b x d x$
Solution:
Let $I=e^{a x} \cos b x d x$
Integrating by parts,
$I=e^{a x} \frac{\sin b x}{b}-a \int e^{a x} \frac{\sin b x}{b} d x$
$=\frac{1}{b} e^{a x} \sin b x-\frac{a}{b} \int e^{a x} \sin b x d x$
$=\frac{1}{b} e^{a x} \sin b x-\frac{a}{b}\left[-e^{a x} \frac{\cos b x}{b}-a \int e^{a x} \frac{\cos b x}{b} d x\right]$
$=\frac{1}{b} e^{a x} \sin b x-\frac{a}{b^{2}} e^{a x} \cos b x-\frac{a^{2}}{b^{2}} \int e^{a x} \cos b x d x$
$I=\frac{e^{a x}}{b^{2}}[b \sin b x+a \cos b x]-\frac{a^{2}}{b^{2}} I+c$
$=\frac{e^{a x}}{a^{2}+b^{2}}[b \cos b x+a \cos b x]+c$