# How do you integrate f(x)=(x^2+1)/((x^2+6)(x-4)(x-9)) using partial fractions?

Jun 16, 2018

Alright, here goes... I got:

$\int \frac{{x}^{2} + 1}{\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)} \mathrm{dx}$

$= - \frac{65}{3828} \ln | {x}^{2} + 6 | - \frac{25}{319 \sqrt{6}} \arctan \left(\frac{x}{\sqrt{6}}\right) - \frac{17}{110} \ln | x - 4 | + \frac{82}{435} \ln | x - 9 | + \text{const}$

$\int \frac{{x}^{2} + 1}{\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)} \mathrm{dx}$

$= \int \frac{A x + B}{{x}^{2} + 6} + \frac{C}{x - 4} + \frac{D}{x - 9} \mathrm{dx}$

GETTING THE SYSTEM OF EQUATIONS

Now, let's focus on the integrand... get common denominators, and then multiply through by that denominator, $\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)$, to get:

$0 {x}^{3} + {x}^{2} + 0 x + 1$

$= \left(A x + B\right) \left(x - 4\right) \left(x - 9\right) + C \left({x}^{2} + 6\right) \left(x - 9\right) + D \left({x}^{2} + 6\right) \left(x - 4\right)$

Now consider only the right-hand side, and distribute terms...

$= \left(A x + B\right) \left({x}^{2} - 13 x + 36\right) + C \left({x}^{3} - 9 {x}^{2} + 6 x - 54\right) + D \left({x}^{3} - 4 {x}^{2} + 6 x - 24\right)$

Keep going...

$= A {x}^{3} - 13 A {x}^{2} + 36 A x + B {x}^{2} - 13 B x + 36 B + C {x}^{3} - 9 C {x}^{2} + 6 C x - 54 C + D {x}^{3} - 4 D {x}^{2} + 6 D x - 24 D$

Now, group terms by exponent, so that you get $a {x}^{3} + b {x}^{2} + c x + d$, making sure that you write it in terms of addition:

$= \textcolor{g r e e n}{A {x}^{3} + C {x}^{3} + D {x}^{3}} \textcolor{red}{- 13 A {x}^{2} + B {x}^{2} - 9 C {x}^{2} - 4 D {x}^{2}} \textcolor{\mathmr{and} a n \ge}{+ 36 A x - 13 B x + 6 C x + 6 D x} + \textcolor{\mathrm{da} r k b l u e}{36 B - 54 C - 24 D}$

Now, factor it into the proper coefficients to get:

$0 {x}^{3} + {x}^{2} + 0 x + 1 = \left(\textcolor{g r e e n}{A + C + D}\right) {x}^{3} + \left(\textcolor{red}{- 13 A + B - 9 C - 4 D}\right) {x}^{2} + \left(\textcolor{\mathmr{and} a n \ge}{36 A - 13 B + 6 C + 6 D}\right) x + \left(\textcolor{\mathrm{da} r k b l u e}{36 B - 54 C - 24 D}\right)$

From this, we get four equations:

$\text{ } 1 A + 0 B + 1 C + 1 D = 0$
$- 13 A + 1 B - 9 C - 4 D = 1$
$\text{ } 36 A - 13 B + 6 C + 6 D = 0$
$\text{ } 0 A + 36 B - 54 C - 24 D = 1$

SOLVING THE SYSTEM OF EQUATIONS

It may be easier to rewrite this into an augmented matrix:

$\left[\begin{matrix}1 & 0 & 1 & 1 & | & 0 \\ - 13 & 1 & - 9 & - 4 & | & 1 \\ 36 & - 13 & 6 & 6 & | & 0 \\ 0 & 36 & - 54 & - 24 & | & 1\end{matrix}\right]$

If we reduce this down using elementary row operations, we can then more easily obtain each constant $A$, $B$, $C$, $D$.

Denote $c {R}_{i} + {R}_{j}$ being to multiply row $i$ by a constant $c$ and adding the result to row $j$. Then:

$\stackrel{- 36 {R}_{1} + {R}_{3} \text{ }}{\to} \left[\begin{matrix}1 & 0 & 1 & 1 & | & 0 \\ - 13 & 1 & - 9 & - 4 & | & 1 \\ 0 & - 13 & - 30 & - 30 & | & 0 \\ 0 & 36 & - 54 & - 24 & | & 1\end{matrix}\right]$

$\stackrel{13 {R}_{1} + {R}_{2} \text{ }}{\to} \left[\begin{matrix}1 & 0 & 1 & 1 & | & 0 \\ 0 & 1 & 4 & 9 & | & 1 \\ 0 & - 13 & - 30 & - 30 & | & 0 \\ 0 & 36 & - 54 & - 24 & | & 1\end{matrix}\right]$

$\stackrel{13 {R}_{2} + {R}_{3} \text{ }}{\to} \left[\begin{matrix}1 & 0 & 1 & 1 & | & 0 \\ 0 & 1 & 4 & 9 & | & 1 \\ 0 & 0 & 22 & 87 & | & 13 \\ 0 & 36 & - 54 & - 24 & | & 1\end{matrix}\right]$

$\stackrel{- 36 {R}_{2} + {R}_{4} \text{ }}{\to} \left[\begin{matrix}1 & 0 & 1 & 1 & | & 0 \\ 0 & 1 & 4 & 9 & | & 1 \\ 0 & 0 & 22 & 87 & | & 13 \\ 0 & 0 & - 198 & - 348 & | & - 35\end{matrix}\right]$

I got tired of reducing it, so we currently have:

$A + C + D = 0$
$B + 4 C + 9 D = 1$
$22 C + 87 D = 13$
$198 C + 348 D = 35$

Solving more explicitly, take the third equation:

$C = \frac{13}{22} - \frac{87}{22} D$

Plug into the fourth:

$198 \left(\frac{13}{22} - \frac{87}{22} D\right) + 348 D = 35$

$117 - 783 D + 348 D = 35$

$82 = 435 D$

$\textcolor{g r e e n}{D = \frac{82}{435}}$

Yikes. Now, find $C$:

$22 C + 87 \left(\frac{82}{435}\right) = 13$

$22 C + \frac{82}{5} = 13$

$\textcolor{g r e e n}{C} = \frac{65 - 82}{5} / 22$

$= \textcolor{g r e e n}{- \frac{17}{110}}$

Now plug into the first equation to get $A$:

$\textcolor{g r e e n}{A} = - C - D = \frac{17}{110} - \frac{82}{435}$

$= \frac{7395}{47850} - \frac{9020}{47850}$

$= - \frac{1625}{47850}$

$= \textcolor{g r e e n}{- \frac{65}{1914}}$

Lastly, find $B$:

$B + 4 \left(- \frac{17}{110}\right) + 9 \left(\frac{82}{435}\right) = 1$

$\textcolor{g r e e n}{B} = 1 + \frac{68}{110} - \frac{738}{435}$

$= \frac{47850}{47850} + \frac{29580 - 81180}{47850}$

$= - \frac{3750}{47850}$

$= \textcolor{g r e e n}{- \frac{25}{319}}$

SETTING UP THE RESULTANT INTEGRAL

So far, we have found:

$\left(A , B , C , D\right) = \left(- \frac{65}{1914} , - \frac{25}{319} , - \frac{17}{110} , \frac{82}{435}\right)$

Therefore, the resultant integral is:

$\int \frac{{x}^{2} + 1}{\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)} \mathrm{dx}$

$= \int \frac{- \frac{65}{1914} x - \frac{25}{319}}{{x}^{2} + 6} - \frac{17}{110} \frac{1}{x - 4} + \frac{82}{435} \frac{1}{x - 9} \mathrm{dx}$

$= - \int \frac{\frac{65}{1914} x + \frac{25}{319}}{{x}^{2} + 6} \mathrm{dx} - \frac{17}{110} \int \frac{1}{x - 4} \mathrm{dx} + \frac{82}{435} \int \frac{1}{x - 9} \mathrm{dx}$

SOLVING EACH PART OF THE BEGINNING INTEGRAL

Call these integrals ${I}_{1}$, ${I}_{2}$, and ${I}_{3}$, i.e. let:

$\int \frac{{x}^{2} + 1}{\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)} \mathrm{dx} = - {I}_{1} - {I}_{2} + {I}_{3} + \text{const}$

INTEGRALS 2 AND 3

The last two are straightforward:

${I}_{2} = \frac{17}{110} \ln | x - 4 |$

${I}_{3} = \frac{82}{435} \ln | x - 9 |$

INTEGRAL 1

Now let's figure out the first one... Getting common denominators and rewriting it, we get:

${I}_{1} = \int \frac{\frac{65}{1914} x + \frac{25}{319}}{{x}^{2} + 6} \mathrm{dx}$

$= \int \frac{5 \left(13 x + 30\right)}{1914 \left({x}^{2} + 6\right)} \mathrm{dx}$

$= \frac{5}{1914} \int \frac{13 x + 30}{{x}^{2} + 6} \mathrm{dx}$

$= \frac{5}{1914} \int \frac{12 x}{{x}^{2} + 6} \mathrm{dx} + \frac{5}{1914} \int \frac{x + 30}{{x}^{2} + 6} \mathrm{dx}$

$= \frac{5}{1914} \int \frac{12 x}{{x}^{2} + 6} \mathrm{dx} + \frac{5}{3828} \int \frac{2 x + 60}{{x}^{2} + 6} \mathrm{dx}$

$= \frac{5}{1914} \int \frac{12 x}{{x}^{2} + 6} \mathrm{dx} + \frac{5}{3828} \int \frac{2 x}{{x}^{2} + 6} \mathrm{dx} + \frac{25}{319} \int \frac{1}{{x}^{2} + 6} \mathrm{dx}$

The first two parts of ${I}_{1}$ here are via $u$-substitution ($u = {x}^{2} + 6$, $\mathrm{du} = 2 x \mathrm{dx}$):

$\frac{5}{1914} \int \frac{12 x}{{x}^{2} + 6} \mathrm{dx} = \frac{15}{957} \ln | {x}^{2} + 6 |$

$\frac{5}{3828} \int \frac{2 x}{{x}^{2} + 6} \mathrm{dx} = \frac{5}{3828} \ln | {x}^{2} + 6 |$

The third part of ${I}_{1}$ will be an $\arctan$ solution of some sort, as $\frac{d}{\mathrm{du}} \left[\arctan u\right] = \frac{1}{{u}^{2} + 1}$.

$\frac{25}{319} \int \frac{1}{{x}^{2} + 6} = \frac{25}{319} \int \frac{1}{6} \frac{1}{{\left(x / \sqrt{6}\right)}^{2} + 1}$

$\implies \frac{25}{319} \int \frac{1}{{x}^{2} + 6} \mathrm{dx} = \frac{25}{319 \sqrt{6}} \arctan \left(\frac{x}{\sqrt{6}}\right)$

So, the integral ${I}_{1}$ is:

${I}_{1} = \int \frac{\frac{65}{1914} x + \frac{25}{319}}{{x}^{2} + 6} \mathrm{dx}$

$= \frac{15}{957} \ln | {x}^{2} + 6 | + \frac{5}{3828} \ln | {x}^{2} + 6 | + \frac{25}{319 \sqrt{6}} \arctan \left(\frac{x}{\sqrt{6}}\right)$

$= \frac{65}{3828} \ln | {x}^{2} + 6 | + \frac{25}{319 \sqrt{6}} \arctan \left(\frac{x}{\sqrt{6}}\right)$

OVERALL INTEGRAL

We finally put this all together:

$\textcolor{b l u e}{\int \frac{{x}^{2} + 1}{\left({x}^{2} + 6\right) \left(x - 4\right) \left(x - 9\right)} \mathrm{dx}}$

$= - \int \frac{\frac{65}{1914} x + \frac{25}{319}}{{x}^{2} + 6} \mathrm{dx} - \frac{17}{110} \int \frac{1}{x - 4} \mathrm{dx} + \frac{82}{435} \int \frac{1}{x - 9} \mathrm{dx}$

$= - {I}_{1} - {I}_{2} + {I}_{3} + \text{const}$

$= \textcolor{b l u e}{{\overbrace{- \frac{65}{3828} \ln | {x}^{2} + 6 | - \frac{25}{319 \sqrt{6}} \arctan \left(\frac{x}{\sqrt{6}}\right)}}^{- {I}_{1}} - {\overbrace{\frac{17}{110} \ln | x - 4 |}}^{{I}_{2}} + {\overbrace{\frac{82}{435} \ln | x - 9 |}}^{{I}_{3}} + \text{const}}$

Well, it worked! Wolfram Alpha agrees.