Q: Integration of $e^{ax}\cos^n bx$ and $e^{ax}\sin^n bx$
I know how to integration $e^{ax}\cos bx$ using $\cos bx=\frac{e^{ibx}+e^{-ibx}}{2}$.Using the same trick here I got $$\int e^{ax}\cos^n bx ~dx=\int e^{ax}\left(\frac{e^{ibx}+e^{-ibx}}{2}\right)^n~ dx$$But it doesn't look easy to solve.I google it and find the result only which is:
$$\int e^{ax}\cos^n bx ~dx=\frac{bn\sin (bx)+a\cos (bx)}{a^2+b^2n^2}e^{ax}\cos^{n-1}bx+\frac{b^2(n-1)n\int e^{ax}\cos^{n-2}bxdx}{a^2+b^2n^2}.$$
Can Anyone help me to figure out this. Any hints or solution will be appreciated.
Thanks in advance.