Indefinite Integral of $\frac{1}{(ax^2+bx+c)^n}$

Can one do the indefinite integral of

$$\frac{1}{(ax^2+bx+c)^n}, a, b, c \in \mathbb{R}$$

quickly, without resorting to those awful recursion relations:

$$\eqalign{\int \dfrac1{(ax^2+bx+c)^n}dx&=\dfrac{2ax+b}{(n-1)(4ac-b^2)(ax^2+bx+c)^{n-1}}

or without using tricks such as writing $ax^2+bx+c$ as $x^2+1$ or something like that?

Hardy (P. 11-12) seems to claim that we can write the denominator as $[(x-\alpha)(x-\alpha^*)]^n$ and then re-write $\frac{1}{(ax^2+bx+c)^n}$ via partial fractions and integrate a bunch of $\frac{1}{(x-\alpha)^j}$ and $\frac{1}{(x-\alpha^*)^j}$ terms, but wont you end up with stuff that is necessarily complex, similar to this.

I think you’re supposed to end up with something like this:

enter image description here

which gives only real numbers, but I’m not getting that 🙁 Furthermore the answer you get when you use recursion relations involves $\arctan$ which is obviously not here 🙁


What is the integral of

$$\frac{1}{(ax^2+bx+c)^n} = \frac{1}{(x-\alpha)^n(x-\alpha^*)^n}, a, b, c \in \mathbb{R}$$

Solutions Collecting From Web of "Indefinite Integral of $\frac{1}{(ax^2+bx+c)^n}$"

I was a bit confused about what you did and did not want to involve, but in my opinion the simplest way to do this is using differentiation.

Note that:
$${\frac { \left( -1 \right) ^{n-1} }{ \left( n-1 \right) !}}{\frac {\partial }{\partial c^{n-1}}}\frac{1}{ a{x}^{2}+bx+c
} = \frac{1}{ \left(a{x}^{2}+bx+c
and that:
$$\int \! \frac{1}{ a{x}^{2}+bx+c
}{dx}=2\,\arctan \left( {
\frac {2\,ax+b}{\sqrt {4\,ca-{b}^{2}}}} \right) {\frac {1}{\sqrt {4\,c
$$\int \! \frac{1}{ \left(a{x}^{2}+bx+c
{\frac { \left( -1 \right) ^{n-1} }{ \left( n-1 \right) !}}{\frac {\partial }{\partial c^{n-1}}}
\left( 2\,\arctan \left( {\frac {2\,ax+b}{\sqrt {4\,ca-{b}^{2}}}}
\right) {\frac {1}{\sqrt {4\,ca-{b}^{2}}}} \right)

You can then use the generalized Leibniz formula to obtain a polynomial plus an arctan part, although as far as I can tell the arctan part will always be there as it begins the awful recursion.


In light of the discussion in the comments of this answer, perhaps something like this would be better…

Note that:
$${\frac {1}{ \left( x-\mu \right) ^{1
+n} \left( x-\nu \right) ^{1+n}}}=\frac{1}{(n!)^2}{\frac {\partial ^{2\,n}}{\partial {\nu}^{n}\partial {\mu}^{n}}}
\left( {\frac {1}{ \left( x-\mu \right) \left( x-\nu \right) }}
\right) \tag{1}$$
$${\frac {1}{ \left( x-\mu \right) \left( x-\nu \right) }}={\frac {1}{ \left( –
\nu+\mu \right) \left( x-\mu \right) }}-{\frac {1}{
\left( x-\nu \right) \left( -\nu+\mu \right) }} \tag{2}$$
\int{\frac {1}{ \left( x-\mu \right) ^{1+n} \left( x-\nu \right) ^{1+n}}}{dx}=
&\frac{1}{(n!)^2}{\frac {\partial ^{2\,n}}{\partial {\nu}^{n}\partial {\mu}^{n}}}\frac{1}{\left( -\nu+\mu \right)}\int
\frac {1}{ \left( x-\mu \right) }}-{\frac {1}{ \left( x-\nu \right) }}{dx}\\
&\frac{1}{(n!)^2}{\frac {\partial ^{2\,n}}{\partial {\mu}^{n}\partial {\nu}^{n}}}
\left({\frac {\ln
\left( x-\mu \right) }{-\nu+\mu}} -{\frac {\ln \left( x-\nu \right) }{-\nu+\mu}}\right) \tag{3}
Then note that, for example:
$$\frac{1}{(n!)^2}{\frac {\partial ^{2\,n}}{\partial {\mu}^{n}\partial {\nu}^{n}}}\frac {\ln \left( x-\mu \right) }{-\nu+\mu}=\frac{1}{n!}{\frac {\partial }{\partial \mu^n}} \left( {\frac {\ln \left( x-\mu \right) }{ \left( –
\nu+\mu \right) ^{1+n}}} \right) \tag{4}
and that the second term on the right of $(3)$ is just $\mu \leftrightarrow\nu$. The generalized Leibniz formula states:
$${\frac {d}{d \mu^n}}\left( f\left( \mu \right) g \left( \mu \right) \right)
=\sum _{m=0}^{n}{n\choose m} \left( {\frac {d^{m}}{d{\mu}^{m}}}f \left( \mu \right) \right)\left( {\frac {d^{n-m}}{d{\mu}^{n-m}}}g \left( \mu \right)\right) \tag{5}$$
apply $(5)$ to the right hand side of $(4)$, using the numerator as $f$ and the denominator as $g$. Pull out the zeroth order term from the sum as this contains the $\log$ term. Shift down the index on the remaining sum by $1$, applying the derivative once, to the log term in the sum. For the remaining derivatives you will need the useful formula:
$${\frac {\partial ^{k}}{\partial {\mu}^{k}}} \frac{1}{\left( –
\nu+\mu \right) ^{1+n}} ={\frac { \left( -1
\right) ^{k} \left( n+k \right) !}{n!\, \left( -\nu+\mu \right) ^{1+n
+k}}} \tag{6}$$
After some lengthy algebra, the end result is:

$$\int{\frac {1}{ \left( x-\mu \right) ^{1+n} \left( x-\nu \right) ^{1+n}}}{dx}= \frac{\left( -1 \right) ^{n}}{\left( -\nu+\mu \right) ^{1+2\,n}} \left[{2\,n\choose n}\left(\ln \left( x-\mu\right)-\ln \left( x-\nu \right)\right)-P_n(\mu,\nu,x)\right] $$
$$P_n(\mu,\nu,x)=\sum _{m=1}^{n}\frac{{2\,n-m\choose n}}{m} \left[ \left( {\frac {-\nu+\mu}
{-x+\mu}} \right) ^{m}- \left( {\frac {\nu-\mu}{-x+\nu}} \right) ^{m}
\right] \tag{7}$$

The polynomial is of generalized hypergeometric form.