1, 2, 3, Horror

Last updated 2025 June 5

This is an easy integral, just straight-up layer cake:

 1x+1 dx= ln(x+1)+cegin{align*} & int rac{1}{x+1} dx \ =& lnleft(x+1 ight) + c end{align*}

Add an exponent of 22, and we get a very different integral:

 1x2+1 dx= tan1x+cegin{align*} & int rac{1}{x^2+1} dx \ =& an^{-1}{x} + c end{align*}

Change it to a 33, and now the integral is… very horrible indeed.

1x3+1 dxint rac{1}{x^3+1} dx
Try It Yourself

If you haven’t solved this integral before, why not try solving it yourself before reading this page?

I would not call this a fun integral to solve, purely due to how unergonomic the constants involved are. Questions can be complex and ‘messy’, but still nice – this is not one of them.

Factorise

First notice that the polynomial x3+1x^3 + 1 can be factorised. Letting x=1x = -1 makes the polynomial 00, so by the factor theorem (x+1)(x + 1) must be a factor of x3+1x^3 + 1. Performing the factorisation gives

x3+1=0(x+1)(x2x+1)=0egin{align*} x^3 + 1 &= 0 \ (x+1)(x^2 - x + 1) &= 0 end{align*}

Unfortunately, the quadratic quotient of x2x+1x^2 - x + 1 is not factorisable – in fact its discriminant (2-2) is negative, so its roots are complex.1

So our integral becomes

1(x+1)(x2x+1) dxint rac{1}{(x+1)(x^2-x+1)} dx

Partial Fractions

We’ll need to perform partial fractions with an irredudicible quadratic factor:

1(x+1)(x2x+1)=px+1+qx+rx2x+11=p(x2x+1)+qx(x+1)+r(x+1)egin{align*} rac{1}{(x+1)(x^2-x+1)} &= rac{p}{x+1} + rac{qx+r}{x^2-x+1} \ 1 &= p(x^2-x+1) + qx(x+1) + r(x+1) end{align*}

Let x=1x = -1:

1=p(1(1)+1)+0+03p=1p=13egin{align*} 1 &= p(1-(-1)+1) + 0 + 0 \ 3p &= 1 \ p &= rac{1}{3} end{align*}

Let x=0x = 0:

1=p(00+1)+0+r(0+1)1=p+rr=1pr=113=23egin{align*} 1 &= p(0-0+1) + 0 + r(0 + 1) \ 1 &= p + r \ r &= 1 - p \ r &= 1 - rac{1}{3} \ &= rac{2}{3} end{align*}

Equate coefficients of x2x^2:

0=p+qq=p=13egin{align*} 0 &= p + q \ q &= -p \ &= - rac{1}{3} end{align*}

Hence

1(x+1)(x2x+1)=13(x+1)+x+23(x2x+1)=13(x+1)x23(x2x+1)egin{align*} rac{1}{(x+1)(x^2-x+1)} &= rac{1}{3(x+1)} + rac{-x+2}{3(x^2-x+1)} \ &= rac{1}{3(x+1)} - rac{x-2}{3(x^2-x+1)} end{align*}

Rational

The rest is just work. We’ll continually split our integral into components we can integrate.

 1(x+1)(x2x+1) dx= 13(x+1)x23(x2x+1) dx= 131x+1 dx162x4x2x+1 dx= 13ln(x+1)162x1x2x+13x2x+1 dxegin{align*} & int rac{1}{(x+1)(x^2-x+1)} dx \ =& int rac{1}{3(x+1)} - rac{x-2}{3(x^2-x+1)} dx \ =& rac{1}{3}int rac{1}{x+1} dx - rac{1}{6}int rac{2x-4}{x^2-x+1} dx \ =& rac{1}{3}ln(x+1) - rac{1}{6}int rac{2x-1}{x^2-x+1} - rac{3}{x^2-x+1} dx end{align*}

For the right, complete the square for arctan integration.

= 13ln(x+1)16ln(x2x+1)+361(x1/2)21/4+1 dx= 13ln(x+1x2x+1)+121(x1/2)2+3/4 dx= 13ln(x+1x2x+1)+1243tan1(43(x12))= 13ln(x+1x2x+1)+33tan1(233(x12))cegin{align*} =& rac{1}{3}ln(x+1) - rac{1}{6}ln(x^2-x+1) + rac{3}{6}int rac{1}{(x-1/2)^2-1/4+1} dx \ =& rac{1}{3}lnleft( rac{x+1}{sqrt{x^2-x+1}} ight) + rac{1}{2}int rac{1}{(x-1/2)^2+3/4} dx \ =& rac{1}{3}lnleft( rac{x+1}{sqrt{x^2-x+1}} ight) + rac{1}{2}sqrt{ rac{4}{3}} an^{-1}left(sqrt{ rac{4}{3}}left(x- rac{1}{2} ight) ight) \ =& rac{1}{3}lnleft( rac{x+1}{sqrt{x^2-x+1}} ight) + rac{sqrt{3}}{3} an^{-1}left( rac{2sqrt{3}}{3}left(x- rac{1}{2} ight) ight) - c end{align*}

  1. Rearranging the polynomial equation x3+1=0x^3 + 1 = 0 gives x3=1x^3 = -1, so the roots are the negatives of the 3 roots of unity (solutions to x3=1x^3 = 1): e0i(=1),e2π3i(=eπ3i),e4π3i(=eπ3i)-e^{0i} (= -1), -e^{\frac{2\pi}{3}i} (= e^{-\frac{\pi}{3}i}), -e^{\frac{4\pi}{3}i} (= e^{\frac{\pi}{3}i}).