Is there a general solution to the integral
$$\int \frac{1}{x^n +1}dx$$ where $x ∈ ℝ$ and $n ∈ ℤ$?
Is there a general solution to the integral
$$\int \frac{1}{x^n +1}dx$$ where $x ∈ ℝ$ and $n ∈ ℤ$?
$$\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)$$
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.