# Integrate using Partial Fraction decomposition, completing the square

The given problem is $\int{x\over x^3-1}dx$.

I know this equals

$${1\over3}\int {1\over x-1}-{x-1\over x^2+x+1}dx,$$ which can be separated into $${1\over3}\int {1\over x-1}dx - {1\over3}\int{x+(1/2)-(3/2)\over x^2+x+1}dx.$$ This can further be separated into $${1\over3}\int{1\over x-1}dx - {1\over3}\int{x+(1/2)\over x^2+x+1}dx + {1\over2}\int{1\over(x+(1/2))^2+(3/4)}dx.$$

I know the integral of ${1\over3}\int {1\over x-1}dx$ is $(1/3)\ln(x+1)+C$ where $C$ is an arbitrary constant. Using u-subsitution, where $u=x^2+x+1$ and $du=(2x+1)dx$ and $(1/2)du=(x+(1/2))dx$, I know the integral of $-{1\over3}\int{ x+(1/2)\over x^2+x+1 }dx$ is $(1/6)\ln(x^2+x+1)+C$. I need to get the last part, $${1\over2}\int{1\over(x+(1/2))^2+(3/4)}dx$$ to be some form of arctan. I can use u-substitution where $u=x+(1/2)$ and $du=dx$, but I don't know where to go from there.

-
I edited your answer to include TeX formatting. Also, I corrected a couple of places where "$(x-(1/2))$" (when you completed the square for $x^2+x+1$) should have been $(x+(1/2))$. Please check that everything's ok... –  David Mitra Feb 29 '12 at 20:27
Write $$\textstyle (x+(1/2))^2+{3\over4}= {3\over4}\Bigl[ \,{4\over3}(x+(1/2))^2+1\,\bigr]={3\over4}\Bigl[ \,\bigl(\,\underbrace{{2\over\sqrt3}(x+(1/2))}_u\,\bigr)^2+1\,\Bigr]$$ –  David Mitra Feb 29 '12 at 20:50
Typo: "the integral of ${1\over3}\int {1\over x-1}dx$ is $(1/3)\ln(x-1)+C$" –  Américo Tavares Feb 29 '12 at 21:27

The purpose is to get an integral of the form $\displaystyle\int \frac{1}{v^{2}+1}\,dv=\arctan v$. Using the substitution indicated by you $u=x+1/2$, $du=dx$, we obtain

$$\begin{eqnarray*} \frac{1}{2}\int \frac{1}{\left( x+1/2\right) ^{2}+3/4}dx &=&\frac{1}{2}\int \frac{1}{u^{2}+3/4}\,du \\ &=&\frac{1}{2\cdot 3/4}\int \frac{1}{\frac{u^{2}}{3/4}+1}\,du \\ &=&\frac{2}{3}\int \frac{1}{\left( \frac{u}{\sqrt{3}/2}\right) ^{2}+1}\,du, \end{eqnarray*}$$

where we have manipulated the integrand so that it is of the form $1/(v^{2}+1)$, with $v=\dfrac{u}{\sqrt{3}/2}$. Using this new substitution, since $dv=\frac{du}{\sqrt{3}/2}$, the integral becomes $$\begin{eqnarray*} \frac{2}{3}\int \frac{1}{\left( \frac{u}{\sqrt{3}/2}\right) ^{2}+1}\,du &=&% \frac{2}{3}\int \frac{1}{v^{2}+1}\cdot \frac{\sqrt{3}}{2}\,dv \\ &=&\frac{\sqrt{3}}{3}\int \frac{1}{v^{2}+1}\,dv \\ &=&\frac{\sqrt{3}}{3}\arctan v \\ &=&\frac{\sqrt{3}}{3}\arctan \left( \frac{u}{\sqrt{3}/2}\right) \\ &=&\frac{\sqrt{3}}{3}\arctan \left( \frac{x+1/2}{\sqrt{3}/2}\right) \\ &=&\frac{\sqrt{3}}{3}\arctan \left( \frac{\sqrt{3}}{3}\left( 2x+1\right) \right) +\text{Const.} \end{eqnarray*}$$

Added. We could have used the single substitution $v=\dfrac{x+1/2}{\sqrt{3}/2}$, resulting from both substitutions $v$ and $u$.

$$\begin{eqnarray*} \frac{1}{2}\int \frac{1}{\left( x+1/2\right) ^{2}+3/4}dx &=&\frac{1}{2}\int \frac{2}{3}\frac{\sqrt{3}}{v^{2}+1}\,dv \\ &=&\frac{1}{3}\sqrt{3}\arctan v=\frac{1}{3}\sqrt{3}\arctan \left( \frac{x+1/2 }{\sqrt{3}/2}\right) +\text{ Const.} \end{eqnarray*}$$

-
The explicit division of $u$ by $\frac{\sqrt{3}}{2}$ is a good idea, it helps to motivate the right substitution. –  André Nicolas Feb 29 '12 at 22:34

Use the substitution $$\frac{\sqrt{3}}{2}u=x+\frac{1}{2}.$$

Or else, if you want to do it in two steps, make the substitution $u=x+\frac{1}{2}$. You will end up with an expression that includes $u^2+\frac{3}{4}$. Then let $u=\frac{\sqrt{3}}{2}v$. The substitution that I proposed is a little faster.

Remark: Suppose that we want to find the integral $$\int\frac{dx}{x^2+k},$$ where $k$ is a positive constant. Write $k=a^2$, where $a$ is positive. Then $a=\sqrt{k}$. We are interested in $$\int\frac{dx}{x^2+a^2}.$$ Let $x=aw$ (or equivalently, $w=\frac{x}{a}$). Then $dx=a\,dw$. Substituting, we get $$\int \frac{a\,dw}{a^2w^2+a^2}, \quad\text{which is}\quad \int\frac{1}{a}\frac{dw}{w^2+1}.$$

More or less the same idea works, for example, when we want to integrate something that involves $\sqrt{k-x^2}$, where $k$ is positive. Write $k=a^2$, where we choose $a$ positive. So we are interested in $\sqrt{a^2-x^2}$. Make the substitution $u=a\sin\theta$. Or else, make the preliminary substitution $x=aw$. Then our expression becomes $\sqrt{a^2-a^2w^2}$, which is equal to $a\sqrt{1-w^2}$.

-
I'm not sure I follow your hint. I completed the square for x^2+x+1 and got (x-(1/2))^2+(3/4), but where does this "x+(1/2)" come in and how did you get (3^(1/2))/2 from that? –  Jared Feb 29 '12 at 19:12
You completed the square incorrectly. The $\frac{\sqrt{3}}{2}$ is because of the $\frac{3}{4}$ term, I took the square root. Maybe you can look at the "slower" approach that I also mentioned. –  André Nicolas Feb 29 '12 at 19:19
Typo in the second paragraph: "you will end up with an expression that includes $u^2+\frac{3}{4}$ –  Américo Tavares Feb 29 '12 at 21:48
@Américo Tavares: Thank you for spotting the typo. Fixed. –  André Nicolas Feb 29 '12 at 22:30