# General solution to $\int \frac{1}{x^n +1}dx$ where $n$ is an integer? [closed]

Is there a general solution to the integral

$$\int \frac{1}{x^n +1}dx$$ where $$x ∈ ℝ$$ and $$n ∈ ℤ$$?

• According to integral-calculator.com no Elementry closed form exits Commented Dec 2, 2022 at 5:02
• @mathandphysicsforever Integral-calculator.com assumes n ∈ ℝ I think which might change things. Commented Dec 2, 2022 at 5:12
• Is this what you are looking for $$A_n = \int_0^u \frac {dx}{x^n + 1}$$? Commented Dec 2, 2022 at 6:13
• @DarshanP. from a to b, instead of 0, u. But evaluating that. evaluating that indefinite integral. Commented Dec 2, 2022 at 6:19
• Commented Jan 4, 2023 at 6:19

\begin{align*}\color{red}{\int \frac {dx}{x^n+1}} &=\int(1+x^n)^{-1}dx \\& = \int\left(1 - x^n + x^{2n} - x^{3n} + x^{4n} - x^{5n}...\right)dx \\& = x\left(1 - \frac {x^n}{n + 1} + \frac {x^{2n}}{2n + 1} -\frac {x^{3n}}{3n + 1} + \frac {x^{4n}}{4n + 1} - \frac {x^{5n}}{5n + 1}...\right) + C \\& =x\left(1 + \frac {1.\frac 1n}{1 + \frac 1n}\frac {(-x^n)^1 }{1!}+ \frac{1.2.\left(\frac 1n (\frac 1n + 1)\right)}{\left(\frac 1n + 1\right)\left(\frac 1n + 2\right)}\frac {(-x^n)^2}{2!} + \right) +C \\& = \color{red}{x_2F_1\left(1, \frac1n;1+\frac1n;-x^n\right) +C} \end{align*} Here, I used Gaussian Hypergeometric Function as I believed $$b$$ and $$c$$ have telescopic ratio:) and $$(a)_k$$ is simply $$k!$$

or else considering a generalized form $$I = \int \frac {x^{l - 1}}{x^n + 1}dx$$

if $$n$$ is even: $$I = -\frac 1n \sum_{r = 1}^{\frac n2} \cos\left(\frac {(2r-1)l\pi}{n}\right)\log\left(x^2 - 2x\cos\left(\frac {(2r-1)\pi}{n}\right)+1\right) + \frac 2n \sum_{r = 1}^{\frac n2}\sin\left(\frac {(2r - 1)l\pi}{n}\right)\tan^{-1}\left(\frac {x - \cos((2r - 1)\pi/n)}{\sin((2r - 1 )\pi/n)}\right)$$

if $$n$$ is odd: $$I = \frac{(-1)^{l-1}}{n}\log(x+1) - \frac 1n\sum_{r = 1}^{\frac {n-1}2}\cos\left(\frac {(2r - 1)l\pi}n\right)\log\left(x^2 - 2x\cos\left(\frac {(2r-1)\pi}n\right) + 1\right) + \frac 2n\sum_{r = 1}^{\frac {n-1}2}\sin\left(\frac{(2r-1)l\pi}n\right)\tan^{-1}\left(\frac {x - \cos((2r-1)\pi/n)}{\sin((2r - 1)\pi/n)}\right)$$

• How did you find this as a solution? Commented Dec 2, 2022 at 6:07
• I’m not quite sure what you are looking for in being more specific. A general solution where x is a real number and n is an integer, so the evaluation of the integral as a function of x and n and one can simply substitute whatever n getting the correct integral. Commented Dec 2, 2022 at 6:17
• If replacing n = 1 in the first one is equivalent to replacing n = 1 in the third one, if replacing n = 2 in the first one is equivalent to replacing n = 2 in the second one, and so on for all real n, then yes this is what I’m looking for. Commented Dec 2, 2022 at 6:46

There is a closed-form solution for each $$n \in \Bbb Z$$. If $$n \geq 0$$, The denominator factors into a product of quadratic terms and (when $$n$$ is odd) a factor of $$x+1$$. The method of partial fractions therefore yields a closed form.

If $$n \lt 0$$, the integrand is $$\dfrac {x^{\vert n \vert}}{1+ x^{\vert n \vert}}$$, and after some long division, the method of partial fractions is again available.

• And what is that closed form solution? Commented Dec 2, 2022 at 5:29
• @GeorgeXavier I don’t know. I don’t even know whether it’s easily expressible as a function of $n$. But the question was whether such a solution exists. Commented Dec 3, 2022 at 4:32