# Trouble integrating $e^{ax}\cos bx$ and $e^{ax}\sin bx$

I have to integrate the following indefinite integrals $$\int e^{ax}\sin bxdx~~;~\int e^{ax}\cos bx$$ The procedure I used is the same for both integrals:

• Make the change of variables $bx=t$

• Use partial integration twice with $dv=e^{at/b}dt$ until the initial integral reappears and then solve.

This is the full procedure for the first integral. For the 2nd integral the result I obtain is the same except for the signs. $$\int e^{ax}\sin bxdx$$ Change of variables $bx=t$ $$\frac{1}{b}\int e^{at/b}\sin tdt$$ Partial integration $$dv=e^{at/b}dt~;~v=\frac{b}{a}e^{at/b}~;~u=\sin t~;~du=\cos tdt$$ Which leads to $$\frac{1}{a}e^{at/b}\sin t-\frac{1}{a}\int e^{at/b}\cos tdt$$ Partial integration again $$dv=e^{at/b}~;~v=\frac{b}{a}e^{at/b}~;~u=\cos t~;~du=-\sin tdt$$ Which leads to $$\frac{1}{b}I=\frac{1}{a}e^{at/b}\sin t-\frac{b}{a^2}e^{at/b}\cos t-\frac{b}{a^2}\int e^{at/b}\sin tdt$$ $$\frac{a^2+b^2}{ba^2}I=\frac{1}{a}e^{at/b}\sin t-\frac{b}{a^2}e^{at/b}\cos t$$ $$(a^2+b^2)I=bae^{at/b}\sin t-b^2e^{at/b}\cos t$$ $$I=\frac{ba}{a^2+b^2}e^{at/b}\sin t-\frac{b^2}{a^2+b^2}e^{at/b}\cos t$$ $$I=\frac{ba}{a^2+b^2}e^{ax}\sin bx-\frac{b^2}{a^2+b^2}e^{ax}\cos bx+C$$

The correct result is the one I obtained but divided by $b$ and for the love of God I can't figure out where I made the mistake.

• If you Know Complex Analysis then using residue theory all becomes easy to solve! – user8795 Mar 25 '17 at 19:41
• Hint: Write the earlier steps in terms of $I$ rather than just the last one. (You're in effect multiplying by $b$ when you should be dividing; writing the steps out more explicitly will make that clearer.) – Semiclassical Mar 25 '17 at 19:41

Then you can just read off $$\int e^{ax} \cos(bx) = \frac{e^{ax}}{a^2+b^2}[a \cos(bx) + b \sin(bx)]$$ and $$\int e^{ax} \sin(bx) = \frac{e^{ax}}{a^2+b^2}[a \sin(bx) - b \cos(bx)]$$
Let, $I=\displaystyle\int{e^{ax}\sin{bx}}\ dx$
Solving $I$ and $J$ gives the answers.