# Help solving $\int {\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)}dx}$

$\displaystyle\int {\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)}\,\mathrm{d}x}$

I used partial fractions, solved $A = 2, C = 3$.

$$\frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2} +\frac{(Dx+E)}{(x^2+2)}$$

\begin{align*} &8x^4+15x^3+16x^2+22x+4\\ &\quad = A(x+1)^2(x^2+2)+B(x)(x+1)(x^2+2)+C(x)(x^2+2)+(Dx+E)(x)(x+1)^2 \end{align*} Substitute in $x=0$ to get $4=A(1)(2)$, so $A = 2$ $$6x^4+11x^3+10x^2+14x = B(x)(x+1)(x^2+2)+C(x)(x^2+2)+(Dx+E)(x)(x+1)^2$$ Substitute in $x=-1$ to get $$6-11+10-14 = C(-1)(1+2)$$ so $-9=-3C$, thus $C=3$.

Leaving me what I have below:

Which brings me to where I am currently stuck.

$$6x^4 +8x^3 +10x^2+8x = B(x)(x+1)(x^2+2) + (Dx + E) (x) (x+1)^2$$

Is the next best move to use substitution to solve for $B$?

• It might be helpful to see your setup for the partial fraction decomposition. – Isaac Feb 24 '11 at 4:09
• You could just multiply out the polynomials on the left and then match up the coefficients of each term (i.e. the only unknown multiplied by $x^4$ will be D, so D must be 6). This strategy will always work, although there are usually quicker ways if you use some ingenuity (as it sounds like you are). – Brian Feb 24 '11 at 4:14
• I meant 'right' instead of left above... – Brian Feb 24 '11 at 4:19
• right, for some reason I forgot to square the x+1 on my paper so I only ended up with Dx^3, now I see that I should have gotten Dx^4 so D must be 6 – Finzz Feb 24 '11 at 4:30
• Note: after the editing what I said is wrong. – Brian Feb 24 '11 at 4:54

## 5 Answers

First, I trust you used the correct partial fraction decomposition: $$\frac{8x^4+15x^3+16x^2+22x+4}{x(x+1)^2(x^2+2)} = \frac{A}{x} + \frac{B}{x+1} + \frac{C}{(x+1)^2} + \frac{Dx+E}{x^2+2}.$$ This leads to \begin{align*} &8x^4 + 15x^3 + 16x^2 + 22x + 4\\ &\qquad = A(x+1)^2(x^2+2) + Bx(x+1)(x^2+2) + Cx(x^2+2) + (Dx+E)x(x+1)^2. \end{align*} A useful "trick" is to evaluate at the zeros of the linear factors to get some information; I suspect you evaluated at $x=0$ to get $2A = 4$, from which you got $A=2$.

You can then evaluate at $x=-1$ to get $-3C = -9$, which is how you got $C=3$. Looking good.

Then you used that to simplify. $$2(x^2+2x+1)(x^2+2) +3x(x^2+2) = 2x^4 + 7x^3 + 6x^2 + 14x + 4,$$ which subtracted from $8x^4 + 15x^3 + 16x^2 + 22x + 4$ gave you $$6x^4 + 8x^3 + 10x^2 + 8x = Bx(x+1)(x^2+2) + (Dx+E)x(x+1)^2.$$ Hmmm... Which is not quite what you have. Did you use the correct decomposition, or did you forget about being careful with that $(x+1)^2$?

Anyway: here's where you go stuck because you are used to being able to solve the partial fractions problems using only the evaluation trick. But when you have irreducible quadratic factors or powers of linear factors (or worse, both), the trick doesn't get you all the way there.

Here, we can factor out $x$ from both sides to get $$6x^3 + 8x^2 + 10x + 8 = B(x+1)(x^2+2) + (Dx+E)(x+1)^2.$$ (We factored out $x$ from both sides and cancelled; that's how we dropped from fourth power to cube).

Edit.

We can further factor out $x+1$ from both sides: $$(x+1)(6x^2 + 2x + 8) = (x+1)(B(x^2+2) + (Dx+E)(x+1))$$ to get $$6x^2 + 2x + 8 = B(x^2+2) + (Dx+E)(x+1).$$ Contrary to your claim before, now that we had all the right terms, we cannot simply conclude that $D=6$, because there are two quadratic terms: $Bx^2$ and $Dx^2$.

You can, however, evaluate at $x=-1$ to get $12 = 3B$, or $B=4$; from this you go to $$6x^2 + 2x + 8 = 4x^2 + 8 + (Dx+E)(x+1)$$ or $$2x^2 + 2x = (Dx+E)(x+1).$$ Noting that the constant term on the right is $E$, and $0$ on the left, you get $E=0$. This gives $$2x(x+1) = Dx(x+1)$$ which, cancelling $x(x+1)$ yields $D=2$.

Alternatively, from $2x^2+2x = (Dx+E)(x+1)$, we can factor the left hand side completely to get $$2x(x+1) = (Dx+E)(x+1)$$ from which we immediately get $Dx+E = 2x$, so $D=2$ and $E=0$.

So, in summary, $A=2$, $B=4$, $C=3$, $D=2$, $E=0$.

• If you don't factor out the x and multiply out the right side, the only co-efficient to yield $x^4$ would mean D would have to be 6. because $6x^4+8x^3+10x^2+8x = Bx^3 +2Bx +Dx^4 + 2Dx^3 + Ex^3 +Ex^2 +Ex$ – Finzz Feb 24 '11 at 4:48
• @Finzz: I factored out $x$, which is how I dropped from fourth power to cube. And no, you cannot deduce that $D=6$ at this point, because if you do things correctly you'll notice that you have two terms that involve the highest power of $x$, not a single one: both the $Bx^3$, and the $Dx^3$. I have not divided through by $x-1$. – Arturo Magidin Feb 24 '11 at 4:50
• @Arturo: I accidentally skipped the part where you said you factored out the x, look at my comment again. EDIT: Nevermind, you would have $Bx^4$ wouldn't you? – Finzz Feb 24 '11 at 4:53
• @Finzz: Yes, you have two terms with highest term. Look at the edit I just did. – Arturo Magidin Feb 24 '11 at 4:56
• @Arturo: Awesome! Thanks once again, and I think you accidentally put an extra dollar sign ($) on one of your lines. – Finzz Feb 24 '11 at 5:21 Below I show how the Heaviside cover-up method generalizes to handle nonlinear denominators. With the numerator $$\rm\:f(x)\ =\ 8x^4+15x^3+16x^2+22x+4\:,\:$$ the undetermined partial fraction is $$\rm\frac{f(x)}{x(x+1)^2(x^2+2)}\ =\ \frac{a}{x}\ +\ \frac{b\ (x+1) + c}{(x+1)^2}\ +\ \frac{d\ x+e}{x^2+2}$$ To find $$\,\rm dx+e\,$$ in the $$\rm\: x^2+2\$$ fraction, clear denominators and collect factors of $$\rm\: x^2 + 2\:$$ $$\rm f(x)\ \ =\ \ x\ (x+1)^2\ (d\ x +\: e)\ \ +\ \ (x^2+\:2)\ g(x)\ ,\quad\quad some\ \ g(x) \in \mathbb Q[x]$$ Evaluating this $$\rm\bmod\, x^2 + 2\:,\$$ i.e.$$\:$$ iteratively applying the rewrite rule $$\rm\ x^2 \to -2\:,\:\:$$ yields $$\rm - 8\ x + 4\ =\: -(4\ d +\: e)\ x + 2\ d - 4\ e\quad \Rightarrow\quad d=2,\ e=0$$ Notice this method amounts to ignoring ("covering") all the undetermined partial fractions having denominator different (i.e. coprime) from the current denominator $$\rm\:p(x) = x^2+2\:$$ (i.e. having different roots) then evaluating what remains at the roots of $$\rm\,p(x)\,$$ or, $$\:$$ equivalently, $$\:$$ evaluating it $$\rm\bmod p(x).\,$$ To avoid computing inverses $$\rm\bmod p(x)\:$$ we scale to clear denominators before evaluating. This is simply the higher-degree analog of the classical Heaviside method - where covering up and evaluating at $$\rm\: x = r\:$$ is equivalent to evaluating modulo $$\rm\:x-r\:$$. Using the same method we can solve for the numerator of the $$\rm\ (x+1)^2\,$$ fraction $$\rm f(x)\ \ =\ \ x\ (x^2+2)\ (b\ (x+1) + c)\ \ +\ \ (x+1)^2\ h(x)\ ,\quad\quad some\ \ h(x) \in\mathbb Q[x]$$ Evaluating it mod $$\rm\, (x+1)^2,\,$$ i.e. iteratively applying rewrite rule $$\rm\, x^2 \to -2\ x - 1\,$$ yields $$\rm 3\ x - 6\ =\ (5\ c - 3\ b)\ x + 2\ c - 3\ b\quad \Rightarrow\quad c = 3,\ b = 4$$ • Very nice -- I didn't know about this :-) – joriki Jan 7 '12 at 11:38 • @joriki See here for another (simpler) example – Bill Dubuque May 21 '14 at 15:32 • More examples (for reference): 1 2 – Anant May 24 '14 at 18:43 Given what you have, what happens when you set$x = -1$? • I don't think I can because then the right side would be 0. EDIT: So would the right side. – Finzz Feb 24 '11 at 4:31 • @Finzz: You mean the left side will be zero? Does that give you a value for$B$? – Aryabhata Feb 24 '11 at 4:32 • There is also supposed to be an (x+1) attached (multiplied) to the B, I forgot to add it in, sorry. – Finzz Feb 24 '11 at 4:34 • @Finzz: Then do the substitution after dividing by$(x+1)$. Make sure you divide out$x+1$from the left side before trying to set$x=-1$. The$D,E$gets cancelled because of$(x+1)^2$, but the$B$term remains... – Aryabhata Feb 24 '11 at 4:36 • @Moron: What do you mean divide out x+1 from the left side? Because I would be dividing by 0 after setting x = -1 – Finzz Feb 24 '11 at 4:44 Following your original method from the point where you pose your question, here are a couple of tricks you can use, which were not mentioned in previous answers. (1) Set$x=\varepsilon -1$and neglect$\varepsilon^2$, to get$B=4$immediately. (2) Set$x=\mathrm{i}\sqrt2$and equate real and imaginary parts to find$D$and$E$(independently of$B$). For kicks, I thought I provide the end result for checking:${\huge{\displaystyle\int}} \! \dfrac {\rm{8x^4+15x^3+16x^2+22x+4}}{\rm{x(x+1)^{2}(x^2+2)}}~\mathrm{dx}~=~ {\huge{\displaystyle\int}} \! \dfrac {\rm{A}}{\rm{x}}+\dfrac {\rm B}{(\rm x+1)}+\dfrac {\rm C}{(\rm{x+1)^{2}}}+\dfrac {\rm{Dx+E}}{{\rm{(x^2+2)}}}~\mathrm{dx} ~~~~~~~~~~~~~~~ \left[ \begin{array}{ccccc} \rm{a} \\ \rm{b} \\ \rm{c} \\ \rm{d} \\ \rm{e} \end{array} \right] = \left[ \begin{array}{ccccc} \rm{2} \\ \rm{4} \\ \rm{3} \\ \rm{2} \\ \rm{0} \end{array} \right]~~~~~~~~~~\Rightarrow~~~~~~~~~~~~~~ ={\huge{\displaystyle\int}} \! \dfrac {\rm 2}{\rm x}+\dfrac {\rm 4}{{\rm{(x+1)}}}+\dfrac {\rm 3}{{\rm{(x+1)^{2}}}}+\dfrac {\rm 2x+0}{{\rm{(x^2+2)}}}~\mathrm{dx} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ={\rm{2\ln|x|-4\ln(x+1)+\dfrac {3}{x+1}+\ln(x^2+2)+K}} ~~~~~~~~~~~\Big({\rm{\ln|x^2+2|\equiv \ln(x^2+2)}}~,~\because {\rm{x^2+2\gt 0~~\forall ~x \in \mathbb{R}}}\Big); ~$via a substitution of the denominator for the last 3 integrals. • Should this not be$-\frac{3}{x+1}\$? – Zain Patel Jan 13 '15 at 0:18