Theorem: Primitive of Exponential of a x by Power of Cosine of b x

:$\ds \int e^{a x} \cos^n b x \rd x = \frac {e^{a x} \cos^{n - 1} b x} {a^2 + n^2 b^2} \paren {a \cos b x + n b \sin b x} + \frac {n \paren {n - 1} b^2} {a^2 + n^2 b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C$

Proof:
With a view to expressing the primitive in the form:
:$\ds \int u \frac {\d v} {\d x} \rd x = u v - \int v \frac {\d u} {\d x} \rd x$
let:
{{begin-eqn}}
{{eqn | l = u
      | r = \cos^n b x
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \frac {\d u} {\d x}
      | r = -n b \cos^{n - 1} b x \sin b x
      | c = Derivative of $\cos a x$, Derivative of Power, Chain Rule for Derivatives
}}
{{end-eqn}}
and let:
{{begin-eqn}}
{{eqn | l = \frac {\d v} {\d x}
      | r = e^{a x}
      | c = 
}}
{{eqn | ll= \leadsto
      | l = v
      | r = \frac {e^{a x} } a
      | c = Primitive of $e^{a x}$
}}
{{end-eqn}}
Then:
{{begin-eqn}}
{{eqn | l = \int e^{a x} \cos^n b x \rd x
      | r = \cos^n b x \paren {\frac {e^{a x} } a} - \int \paren {\frac {e^{a x} } a} \paren {-n b \cos^{n - 1} b x \sin b x} \rd x + C
      | c = Integration by Parts
}}
{{eqn | n = 1
      | r = \frac {e^{a x} \cos^n b x} a + \frac {n b} a \int e^{a x} \cos^{n - 1} b x \sin b x \rd x + C
      | c = Primitive of Constant Multiple of Function
}}
{{end-eqn}}
From Primitive of $e^{a x} \cos^{n - 1} b x \sin b x$:
:$\ds \int e^{a x} \cos^{n - 1} b x \sin b x \rd x = \frac {e^{a x} \cos^{n - 1} b x \paren {a \sin b x - b \cos b x} } {a^2 + n b^2} - \frac {\paren {n - 1} a b} {a^2 + n b^2} \paren {\int e^{a x} \cos^n b x \rd x - \int e^{a x} \cos^{n - 2} b x \rd x} + C$
Hence:
{{begin-eqn}}
{{eqn | r = \int e^{a x} \cos^n b x \rd x
      | o = 
      | c = 
}}
{{eqn | r = \frac {e^{a x} \cos^n b x} a + \frac {n b} a \int e^{a x} \cos^{n - 1} b x \sin b x \rd x + C
      | c = from $(1)$
}}
{{eqn | r = \frac {e^{a x} \cos^n b x} a + \frac {n b} {a \paren {a^2 + n b^2} } e^{a x} \cos^{n - 1} b x \paren {a \sin b x - b \cos b x}
      | c = Primitive of $e^{a x} \cos^n b x$: Lemma 1
}}
{{eqn | o = 
      | ro= -
      | r = \frac {n \paren {n - 1} b^2} {a^2 + n b^2} \int e^{a x} \cos^n b x \rd x + \frac {n \paren {n - 1} b^2} {a^2 + n b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{eqn | ll= \leadsto
      | r = \paren {1 + \frac {n \paren {n - 1} b^2} {a^2 + n b^2} } \int e^{a x} \cos^n b x \rd x
      | o = 
      | c = 
}}
{{eqn | r = \frac {e^{a x} \cos^n b x} a + \frac {n b} {a \paren {a^2 + n b^2} } e^{a x} \cos^{n - 1} b x \paren {a \sin b x - b \cos b x}
      | c = 
}}
{{eqn | o = 
      | ro= +
      | r = \frac {n \paren {n - 1} b^2} {a^2 + n b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{eqn | ll= \leadsto
      | r = \frac {a^2 + n b^2 + n^2 b^2 - n b^2} {a^2 + n b^2} \int e^{a x} \cos^n b x \rd x
      | o = 
      | c = 
}}
{{eqn | r = \frac {e^{a x} \cos^n b x} a + \frac {n b} {a \paren {a^2 + n b^2} } e^{a x} \cos^{n - 1} b x \paren {a \sin b x - b \cos b x}
      | c = 
}}
{{eqn | o = 
      | ro= +
      | r = \frac {n \paren {n - 1} b^2} {a^2 + n b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{eqn | ll= \leadsto
      | r = \paren {a^2 + n^2 b^2} \int e^{a x} \cos^n b x \rd x
      | o = 
      | c = 
}}
{{eqn | r = \frac {a^2 + n b^2} a e^{a x} \cos^n b x + \frac {n b} a e^{a x} \cos^{n - 1} b x \paren {a \sin b x - b \cos b x}
      | c = 
}}
{{eqn | o = 
      | ro= +
      | r = \paren {n \paren {n - 1} b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{eqn | r = e^{a x} \cos^{n - 1} b x \paren {a \cos b x + n b \sin b x}
      | c = Primitive of $e^{a x} \cos^n b x$: Lemma 2
}}
{{eqn | o = 
      | ro= +
      | r = \paren {n \paren {n - 1} b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{eqn | ll= \leadsto
      | r = \int e^{a x} \cos^n b x \rd x
      | o = 
      | c = 
}}
{{eqn | r = \frac {e^{a x} \cos^{n - 1} b x} {a^2 + n^2 b^2} \paren {a \cos b x + n b \sin b x} + \frac {n \paren {n - 1} b^2} {a^2 + n^2 b^2} \int e^{a x} \cos^{n - 2} b x \rd x + C
      | c = 
}}
{{end-eqn}}
{{qed}}