Help with $\int\frac{1}{1+x^8}dx$

I'm not sure how to proceed. I tried factoring like you do to evaluate $\int\frac{1}{1+x^4}dx$, and since it came out nasty I checked out WolframAlpha to see if I was on the right track. In fact, Wolfram doesn't have a step-by-step solution for the integral in question, but the primitive is full of trig expressions like $\csc\frac{\pi}{8}$ and I'm not sure where these would come from.


Solution 1:

You have a vile lecturer. I had to find $\displaystyle \int \dfrac{1}{1+x^4}dx$ when I took my analysis II course and I actually wrote on my notes: you just don't wish this antiderivative on anyone. It took me one page and a half (A4) to find this antiderivative and I didn't prove all the details. Yours is much more troublesome.

Hint: For all $x\in \Bbb R$, the following equality holds:$$1+x^8=\left(x^2+\left(\sqrt{2-\sqrt 2}\right)x+1\right)\left(x^2-\left(\sqrt{2-\sqrt 2}\right)x+1\right)\\\left(x^2+\left(\sqrt{2+\sqrt 2}\right)x+1\right)\left(x^2-\left(\sqrt{2+\sqrt 2}\right)x+1\right).$$

You can then use partial fractions and find the antiderivatives.

Here's the Wolfram Alpha confirmation of the above equality.

Solution 2:

If we write $$ \begin{eqnarray*} x^{8}+1 &=&(x^{4}+px^{2}+1)(x^{4}-px^{2}+1)=x^{8}+\left( 2-p^{2}\right) x^{4}+1 \\ &\Rightarrow &2-p^{2}=0\Leftrightarrow p=\pm \sqrt{2}, \end{eqnarray*} $$ we get $$ \begin{equation*} x^{8}+1=\left( x^{4}+\sqrt{2}x^{2}+1\right) \left( x^{4}-\sqrt{2} x^{2}+1\right) . \end{equation*} $$ Similarly, $$ \begin{eqnarray*} x^{4}+\sqrt{2}x^{2}+1 &=&(x^{2}+qx+1)(x^{2}-qx+1)=x^{4}+\left( 2-q^{2}\right) x^{2}+1 \\ &\Rightarrow &2-q^{2}=\sqrt{2}\Leftrightarrow q=\pm \sqrt{2-\sqrt{2}}, \\ x^{4}+\sqrt{2}x^{2}+1 &=&(x^{2}+\sqrt{2-\sqrt{2}}x+1)(x^{2}-\sqrt{2-\sqrt{2}} x+1), \end{eqnarray*} $$ and $$ \begin{eqnarray*} x^{4}-\sqrt{2}x^{2}+1 &=&(x^{2}+rx+1)(x^{2}-rx+1)=x^{4}+\left( 2-r^{2}\right) x^{2}+1 \\ &\Rightarrow &2-r^{2}=-\sqrt{2}\Leftrightarrow r=\pm \sqrt{2+\sqrt{2}}, \\ x^{4}-\sqrt{2}x^{2}+1 &=&(x^{2}+\sqrt{2+\sqrt{2}}x+1)(x^{2}-\sqrt{2+\sqrt{2}} x+1). \end{eqnarray*} $$ Consequently, $$ \begin{eqnarray*} x^{8}+1 &=&(x^{2}+\sqrt{2-\sqrt{2}}x+1)(x^{2}-\sqrt{2-\sqrt{2}}x+1) \\ &&\times (x^{2}+\sqrt{2+\sqrt{2}}x+1)(x^{2}-\sqrt{2+\sqrt{2}}x+1). \end{eqnarray*} $$ Since the expansion of the integrand into partial fractions yields $$ \begin{eqnarray*} \frac{1}{x^{8}+1} &=&\frac{1}{8}\frac{\sqrt{2-\sqrt{2}}x+2}{x^{2}+\sqrt{2- \sqrt{2}}x+1}+\frac{1}{8}\frac{-\sqrt{2-\sqrt{2}}x+2}{x^{2}-\sqrt{2-\sqrt{2}} x+1} \\ && \\ &&+\frac{1}{8}\frac{\sqrt{2+\sqrt{2}}x+2}{x^{2}+\sqrt{2+\sqrt{2}}x+1}+\frac{1 }{8}\frac{-\sqrt{2+\sqrt{2}}x+2}{x^{2}-\sqrt{2+\sqrt{2}}x+1}, \end{eqnarray*} $$ we have $$ \begin{eqnarray*} I &=&\int \frac{dx}{x^{8}+1}=I_{1}+I_{2}+I_{3}+I_{4} \\ && \\ &=&\frac{1}{8}\int \frac{\sqrt{2-\sqrt{2}}x+2}{x^{2}+\sqrt{2-\sqrt{2}}x+1}dx+ \frac{1}{8}\int \frac{-\sqrt{2-\sqrt{2}}x+2}{x^{2}-\sqrt{2-\sqrt{2}}x+1}dx \\ && \\ &&+\frac{1}{8}\int \frac{\sqrt{2+\sqrt{2}}x+2}{x^{2}+\sqrt{2+\sqrt{2}}x+1}dx+ \frac{1}{8}\int \frac{-\sqrt{2+\sqrt{2}}x+2}{x^{2}-\sqrt{2+\sqrt{2}}x+1}dx. \end{eqnarray*} $$ These four integrals are all of the form $\int \frac{Ax+B}{x^{2}+bx+1}dx$. So we need to evaluate $\int \frac{1}{x^{2}+bx+1}dx$ and $\int \frac{x\,dx}{ax^{2}+bx+c}$. The first integral is computable by completing the square in the denominator and making a linear change of variables:

$$ \begin{eqnarray*} \int \frac{dx}{ax^{2}+bx+c} &=&\frac{1}{a}\int \frac{dx}{x^{2}+\frac{b}{a}x+ \frac{c}{a}},\qquad\qquad 4ac-b^{2}>0 \\ &=&\frac{1}{a}\int \frac{dx}{\left( x-\frac{-b}{2a}\right) ^{2}+\left( \frac{ \sqrt{4ac-b^{2}}}{2a}\right) ^{2}}, \\ &=&\frac{1}{a}\int \frac{dx}{\left( x-p\right) ^{2}+q^{2}},\quad p=\frac{-b}{ 2a},q=\frac{\sqrt{4ac-b^{2}}}{2a},\quad x=p+qt \\ &=&\frac{1}{aq}\int \frac{1}{t^{2}+1}\,dt \\ &=&\frac{2}{\sqrt{4ac-b^{2}}}\int \frac{1}{t^{2}+1}\,dt \\ &=&\frac{2}{\sqrt{4ac-b^{2}}}\arctan t,\qquad t=\frac{x-p}{q}=\frac{2ax+b}{ \sqrt{4ac-b^{2}}} \\ &=&\frac{2}{\sqrt{4ac-b^{2}}}\arctan \frac{2ax+b}{\sqrt{4ac-b^{2}}}+C.\tag{1} \end{eqnarray*} $$

The second one is more straightforward $$ \begin{eqnarray*} \int \frac{x\,dx}{ax^{2}+bx+c} &=&\frac{1}{2a}\int \frac{2ax+b-b\,}{ax^{2}+bx+c}dx \\ &=&\frac{1}{2a}\int \frac{2ax+b}{ax^{2}+bx+c}dx-\frac{b}{2a}\int \frac{1}{ax^{2}+bx+c}dx \\ &=&\frac{1}{2a}\log \left(\left\vert ax^{2}+bx+c\right\vert\right) -\frac{b}{2a}\int \frac{dx}{ax^{2}+bx+c}.\tag{2} \end{eqnarray*} $$ For $a=c=1$ and $4-b^{2}>0$ we get from $(1)$ and $(2)$

\begin{eqnarray*} \int \frac{Ax+B}{x^{2}+bx+1}dx &=&A\int \frac{x\,dx}{x^{2}+bx+1}+B\int \frac{ dx}{x^{2}+bx+1} \\ &=&\frac{2B-Ab}{\sqrt{4-b^{2}}}\arctan \frac{2x+b}{\sqrt{4-b^{2}}}+\frac{A}{2 }\log \left( \left\vert x^{2}+bx+1\right\vert \right) +C.\tag{3} \end{eqnarray*}

E.g. the first integral evaluates as \begin{eqnarray*} I_{1} &=&\frac{1}{8}\int \frac{\sqrt{2-\sqrt{2}}x+2}{x^{2}+\sqrt{2-\sqrt{2}} x+1}dx \\ &=&\frac{\sqrt{2+\sqrt{2}}}{8}\arctan \frac{2x+\sqrt{2-\sqrt{2}}}{\sqrt{2+ \sqrt{2}}}+\frac{\sqrt{2-\sqrt{2}}}{16}\log \left( x^{2}+\sqrt{2-\sqrt{2}} x+1\right) +C. \end{eqnarray*}

ADDED. The entry 2.142 of Table of Integrals Series and Products by Gradshteyn and Ryzhik gives the family of integrals $\int \frac{dx}{1+x^{n}}$ for $n\in \mathbb{N}$. From the given formula the particular case for $n=2p=8$ yields

\begin{eqnarray*} \int \frac{dx}{1+x^{8}} &=&-\frac{1}{8}\sum_{k=0}^{3}\left( \log \left( x^{2}-2x\cos \left( \frac{\left( 2k+1\right) \pi }{8}\right) +1\right) \right) \times \cos \left( \frac{\left( 2k+1\right) \pi }{8}\right) \\ &&+\frac{1}{4}\sum_{k=0}^{3}\left( \arctan \left( \frac{x\sin \frac{\left( 2k+1\right) \pi }{8}}{1-x\cos \frac{\left( 2k+1\right) \pi }{8}}\right) \right) \times \sin \left( \frac{\left( 2k+1\right) \pi }{8}\right) +C. \end{eqnarray*}

ADDED 2. The values of $\sin \left( \frac{\left( 2k+1\right) \pi }{8}\right) $ and $\cos \left( \frac{\left( 2k+1\right) \pi }{8}\right) $ are quadratic irrationals: $$ \begin{eqnarray*} \sin \frac{\pi }{8} &=&\sin \frac{7\pi }{8}=\cos \frac{3\pi }{8}=\frac{1}{2} \sqrt{2-\sqrt{2}}, \\ && \\ \sin \frac{3\pi }{8} &=&\sin \frac{5\pi }{8}=\cos \frac{\pi }{8}=\frac{1}{2} \sqrt{2+\sqrt{2}}, \\ && \\ \cos \frac{5\pi }{8} &=&\cos \frac{7\pi }{8}=-\frac{1}{2}\sqrt{2-\sqrt{2}}. \end{eqnarray*} $$

Solution 3:

The roots of $1+x^8$ are 16-th roots of unity; they are $\zeta^{1+2k}$ where $\zeta$ is a primitive 16-th root of unity, and $k$ goes from $0$ to $7$.

They are all distinct, so we can use the simple formula for partial fractions decomposition of $f(x)/g(x)$ that says the coefficient on the $1/(x-a)$ term is $f(a)/g'(a)$. Therefore,

$$ \frac{1}{1+x^8} = \sum_{k=0}^7 \frac{1}{8 (\zeta^{1+2k})^7} \cdot \frac{1}{x-\zeta^{1+2k}} = \sum_{k=0}^7 \frac{1}{8 \zeta^{7-2k}} \cdot \frac{1}{x-\zeta^{1+2k}} $$

It may be of use that the summands $k$ and $7-k$ are complex conjugate. If one is so inclined, one could add those terms together; the result should be a purely real function with a linear numerator and quadratic denominator, giving you the purely real partial fraction decomposition.

Solution 4:

Perhaps the best way to get around this kind of integrals is to factor the denominator as below $$x^{n}+1=\prod_{k=0}^{n-1}\left(x-\alpha^{2k+1}\right)$$ where $$\alpha=e^{i\frac{\pi}{n}}$$ is the primitive $n$ root of $-1$. Then we can find the partial fraction expansion of the integrand as $$\frac{1}{x^n+1}=\sum_{k=0}^{n-1}\frac{A_k}{x-\alpha^{2k+1}}$$ where $$A_k=\lim_{x\rightarrow \alpha^{2k+1}}\frac{x-\alpha^{2k+1}}{x^n+1}$$ Then the integral becomes $$\sum_{k=0}^{n-1}\int \frac{A_k}{x-\alpha^{2k+1}}dx$$ But now, there are many complex terms involved, we need to collect terms together to simplify them to real rational functions. This is not easy for any arbitrary $n$, but is plausible particularly if $n$ is of the form $2^k$ for some $k\in \mathbb{Z}^+$, see here.

For the current problem, fortunately $n=8=2^3$, so this method works here.