# $\int \frac{x^3+2}{(x-1)^2}dx$

In order to integrate $$\int \frac{x^3+2}{(x-1)^2}dx$$ I did:

$$\frac{x^3+2}{(x-1)^2} = x+2+3\frac{x}{(x-1)^2}\implies$$ $$\int \frac{x^3+2}{(x-1)^2} dx= \int x+2+3\frac{x}{(x-1)^2}dx$$

But I'm having trouble integrating the last part:

$$\int \frac{x}{(x-1)^2}dx$$

Wolfram alpra said me that:

$$\frac{x}{(x-1)^2} = \frac{1}{(x-1)} + \frac{1}{(x-1)^2}$$

How to intuitively think about this partial fraction expansion? I've seen some examples but suddenly these conter intuitive examples opo out and I get confused. I can check that his is true but I couldn't find this expansion by myself

Then:

$$\int \frac{x}{(x-1)^2} dx = \int \frac{1}{(x-1)} + \frac{1}{(x-1)^2}dx = \ln (x-1) + (x-1)^{-1}$$

Then:

$$\int \frac{x^3+2}{(x-1)^2} dx= \int x+2+\frac{x}{(x-1)^2}dx = \frac{x^2}{2} + 2x + 3[\ln(x-1)+(x-1)^{-1}]$$ but wolfram alpha gives another answer. What I did wrong?

• Nobody is answering the questions you asked.... please see en.wikipedia.org/wiki/Partial_fraction_decomposition . Also the antiderivative of the last term should be negative... – JP McCarthy Feb 8 '15 at 16:04
• +1 Congradualtions JP Mccarthy for discovering why I down voted everyone. – John Joy Feb 8 '15 at 16:06
• Yeah, every time I ask something here and ask for my mistake, everyone simply just hrow another solution in my face... – Guerlando OCs Feb 8 '15 at 16:08
• Your two mistakes are forgetting the $3$ and the minus sign (I put them in red in my answer). I gave some terse explanation as to why partial fraction decomposition is possible, but you still need to be able to employ the method in practice. If you learn to do that, you will be able to expand things like $x/(x-1)^2$. – whacka Feb 8 '15 at 16:58
• @JohnJoy, instead of boasting that you downvoted everyone, why don't you writeup your ideal solution. that would be constructive. – abel Feb 8 '15 at 18:26

First off, you should have gotten

$$\frac{x^3+2}{(x-1)^2}=x+2+\frac{\color{Red}{3}x}{(x-1)^2}.$$

How did you get this anyway? Did you have a process? There is a process for breaking down rational functions into summands of a certain type. You've done some of the work, but you need to go further because this is not the finished partial fraction expansion.

Secondly, the antiderivative of $(x-1)^{-2}$ is $\color{Red}{-}(x-1)^{-1}$.

Given any polynomial $f(x)$ and any complex number $a\in\Bbb C$ we can write $f$ as a polynomial in the variable $x-a$, that is $f(x)=g(x-a)$ for some polynomial $g$. Essentially, this changes the "base" of the polynomial from $x$ to $x-a$, much like we can convert a number from base $10$ to base $2$.

Now, if we start with a rational function $f(x)/(x-a)^n$ (with $\deg f<n$) we may write $f$ as a polynomial in the base $x-a$ as $g(x-a)=c_0+c_1(x-a)+\cdots+c_d(x-a)^d$ and so

$$\frac{f(x)}{(x-a)^n}=\frac{c_0}{(x-a)^n}+\frac{c_1}{(x-a)^{n-1}}+\cdots+\frac{c_d}{(x-a)^{n-d}}.$$

There are two things that can make the situation more complicated: (1) if you're not working over the complex numbers $\Bbb C$, there are going to be irreducible polynomials that are not linear - of the form $x-a$ for some scalar - and then (2) if the rational function you begin with has multiple different irreducible factors present in the full factorization of its denominator.

Let's talk about partial fraction decomposition over the complex numbers. Say we have $f(x)/g(x)$. Without loss of generality we may assume that $\deg f<\deg g$, since otherwise we can invoke polynomial long division. Factor $g(x)=(x-u_1)^{e_1}\cdots(x-u_d)^{e_d}$. Since we know we can expand

$$\frac{1}{(x-u)(x-v)}=\frac{1}{u-v}\left[\frac{1}{x-u}-\frac{1}{x-v}\right],$$

we could use this inductively until we eventually will obtain an expansion of the form

$$a_1(x)/(x-u_1)^{e_1}+\cdots+a_d(x)/(x-u_d)^{e_d}$$

for some numerators $a_i(x)$. But note that $a_i(x)=b_i(x-u_i)$ for some polynomials $b_i$, so ultimately we should be able to write

$$\begin{array}{rl} \displaystyle\frac{f(x)}{g(x)} = & \displaystyle \frac{a_{1,1}}{x-u_1}+\frac{a_{1,2}}{(x-u_1)^2}+\cdots+\frac{a_{1,e_1}}{(x-u_1)^{e_1}}+\cdots\cdots \\ + & \displaystyle \frac{a_{d,1}}{x-u_d}+\frac{a_{d,2}}{(x-u_d)^2}+\cdots+\frac{a_{d,e_d}}{(x-u_d)^{e_d}} \end{array}$$

A priori one might believe we should also have a polynomial in $x$ in front of the expansion on the right, but this isn't possible because we know that $\deg f<\deg g$.

To find the coefficient of $(x-u_i)^{-k}$ (where $k\le e_i$) you can multiply the above equation by $(x-u_i)^{e_i}$, take the derivative $e_i-k$ times, evaluate at $x=u_i$. Another method is to add all of the terms above using the unknowns, equate numerators and then solve for the unknowns (as they will exist in a linear system of equations).

Here is the general spiel on how and why pfd works. Suppose we have a rational function of the form $f(x)/g(x)$ with $\deg f<\deg g$. Factor $g(x)=\pi_1(x)^{e_1}\cdots\pi_d(x)^{e_d}$. If we want to expand $f/g$ into the "initial" expansion $a_1(x)/\pi_1(x)^{e_1}+\cdots+a_d(x)/\pi_d(x)^{e_d}$ it suffices to be able to do it to $1/g(x)$, since once we do that we can multiply each $a_i(x)$ by $f(x)$.

To compute $a_i(x)$, set $f/g$ equal to this expansion, multiply both sides by $g(x)$, and then reduce "modulo $\pi_i(x)$" to obtain $f(x)\equiv a_i(x)\prod_{j\ne i}\pi_j(x)^{e_j}$ mod $\pi_i(x)$, which can be solved for in $a_i(x)$ since the other irreducible factors are all distinct from $\pi_i(x)$ and hence invertible mod $\pi_i(x)$. It might sound crazy at first that we can reduce polynomials "modulo" other polynomials, just like we do with numbers, but this is indeed possible because we still have Euclidean division.

Anyway, now we know an "initial" expansion of $f/g$ exists, to get the full partial fraction expansion we need to know how to decompose the rational functions of the form $a(x)/\pi(x)^e$ where $\pi$ is irreducible. We can't simply use the same "translation" thing as earlier. What we can do is use the Euclidean division property I just mentioned: write $a(x)=q_0(x)\pi(x)+r_0(x)$, where $q$ is the quotient and $r$ is the remainder (with $\deg r<\deg \pi$). One can continue this process on the $q_i$s, obtaining $a(x)=(q_1(x)\pi(x)+r_1(x))\pi(x)+r_0(x)$, etc. until finally we stop at the "expansion in base $\pi$" given by $a(x)=r_k(x)\pi(x)^k+\cdots+r_1(x)\pi_1(x)+r_0(x)$. Thus,

$$\frac{a(x)}{\pi(x)^e}=\frac{r_k(x)}{\pi(x)^{e-k}}+\cdots+\frac{r_0(x)}{\pi(x)^e}.$$

Your mistake is the partial fraction expansion. It should be $$\frac{x^3+2}{(x-1)^2}=x+2+\frac{3}{x-1}+\frac{3}{(x-1)^2}$$ Then the integral becomes $$x^2/2+2x+3\ln (x-1)-3(x-1)^{-1}$$

• That is not true. When you have a first degree monomial squared or raised to any power, you only need a constant $B$, in this case. (I did not downvote). Re: your edit: That's exactly what the OP found, but finds unintuitive. – Namaste Feb 8 '15 at 15:55
• Sorry, I was thinking something else and wrote something. i am changing my answer. – Samrat Mukhopadhyay Feb 8 '15 at 15:57
• @Timbuc It is indeed true for terms of the form $(ax + b)^n$: every term in its decomposition needs only a constant variable in the numerator. – Namaste Feb 8 '15 at 15:59
• I corrected my expansion, as you can see here it Works: bit.ly/1C7doCm – Guerlando OCs Feb 8 '15 at 16:21

change of variable gets you there faster. let $u = x - 1, x = 1 + u.$ then

\begin{align}\int\dfrac{x^3 + 2}{(x-1)^2}\,dx &= \int\frac{(1+u)^3+2}{u^2} \,du\\ &=\int\frac{3+3u+3u^2+u^3}{u^2}\,du\\ & = \int3u^{-2}+3u^{-1}+ 3+u \,du\\ &=-\frac{3}{u} + 3\ln u + 3u + \frac{u^2}{2} +C \end{align}

note that this substitution works on any rational function of the form $\dfrac{p(x)}{(ax+b)^k}$ where $p$ is polynomial in $x.$

• Why dowvote? I'm intersting to know what is wrong here? – Emilio Novati Feb 8 '15 at 16:49
• @EmilioNovati, that makes at least two of us. op clearly states that the aim is to integrate $\frac{x^3 + 2}{(x-1)^2}.$ this seems to be a cleaner way to do it. – abel Feb 8 '15 at 16:52
• I did not downvote; having a cleaner way is useful. But a good thing to note is that while the method of partial fraction decomposition might be avoidable here, it is not avoidable in general, and so it is in the OP's best interest to learn it. – whacka Feb 8 '15 at 16:53
• I did downvote and did so because this answer does not address the OPs question. – JP McCarthy Feb 8 '15 at 21:07
• @JpMcCarthy, if you know this is not the answer, why don't you write the supposed answer. – abel Feb 8 '15 at 21:21

First: search for: $$\dfrac{x}{(x-1)^2}=\dfrac{1}{(x-1)^2}+\dfrac{A}{x-1}$$ and find: $$x=1+Ax-A \iff x(1-A)=1-A$$since this must be true $\forall x$ you must have $A-1=0$ and $A=1$.

Now integrates as you have done but be careful that you have a mistake in your work: $$\int \dfrac{1}{(x-1)^2} dx = - \dfrac{1}{x-1}$$

• Why downvote? I'm courious to know mi mistake. – Emilio Novati Feb 8 '15 at 16:36

Here's a way to find the partial fraction expansion: \begin{align} \frac{x}{(x-1)^2} &= \frac{A}{x-1} + \frac{B}{(x-1)^2}\\ (x-1)^2\frac{x}{(x-1)^2} &= (x-1)^2\frac{A}{x-1} + (x-1)^2\frac{B}{(x-1)^2}\\ x &= A(x-1) + B \end{align} You can turn this into two linear equations and solve, or you can do the following:

1. plug in $x = 1$ to get $1 = B$.
2. Take derivatives on both sides to get

$$1 = A$$

1. Plug $x = 1$ into this equation (which does nothing, but it's part of a pattern) to get $1 = A$.

In general, you plug in $x = c$ for this kind of equation [polynomial over a power of $x-c$], and for each derivative, and doing so will give you the coefficients one after another.

Is there an intuition for these partial fraction expansions? Yes, a slight one ...but it'll mostly come after you take Complex Analysis, alas.

Also: in integrating $1/(x-1)^2$, you have a sign error.

You can write $\displaystyle\frac{x}{(x-1)^2}=\frac{A}{x-1}+\frac{B}{(x-1)^2}$; then multiply by $(x-1)^2$ to get $x=A(x-1)+B$.

Letting $x=1$ gives $B=1$, and comparing the coefficients of $x$ gives $A=1$.

(Notice that $\displaystyle\int\frac{1}{(x-1)^2}=-\frac{1}{x-1}+C$.)

You could also find $\displaystyle\int\frac{x}{(x-1)^2}$ by letting $u=x-1, x=u+1, dx=du$ to get

$\hspace{.4 in}\displaystyle\int\frac{u+1}{u^2}du=\int\left(\frac{1}{u}+\frac{1}{u^2}\right) du$,

or use integration by parts with $u=x, du=dx, dv=(x-1)^{-2}dx, v=-(x-1)^{-1}$ to get

$\;\;-x(x-1)^{-1}+\ln|x-1|+C$

• Yeah, but why would I write $\frac{x}{(x-1)^2} = \frac{A}{(x-1)}+\frac{B}{(x-1)^2}$? What's the rule? – Guerlando OCs Feb 8 '15 at 16:01
• @GuerlandoOCs, the reason is you can write $x$ as a linear combination of $1$ and $(x-1$. whole thing is you are trying to find the antiderivative of $\frac{x}{(x-1)^2}$ and you know the antiderivatives of $\frac{1}{x-1}$ and $\frac{1}{(x-1)^2}$. main focus of the whole thing is finding the antiderivative not partial fractions; it is a means and not the end. – abel Feb 8 '15 at 16:08
• Yeah but it does not justify the $\frac{B}{(x-1)^2}$, why not $a/(x-1)+b/(x-1)$? – Guerlando OCs Feb 8 '15 at 16:12
• @GuerlandoOCs because that would just be $(a+b)/(x-1)$ which is just a constant over $(x-1)$. – JP McCarthy Feb 8 '15 at 16:14