# General rule for integrals of irrational functions involving $r = \sqrt{a^2 + x^2}$

Browsing the List of integrals of irrational functions I found out that if $$r=\sqrt{(a^2+x^2)}$$ then $$\int{rdx}=\frac12(xr+a^2\ln{(x+r)})$$ $$\int{r^3dx}=\frac14xr^3+\frac38a^2xr+\frac38a^4\ln(x+r)$$ $$\int{r^5dx}=\frac16xr^5+\frac{5}{24}a^2xr^3+\frac{5}{16}a^4xr+\frac{5}{16}a^6\ln(x+r)$$

Is there any general rule for defining $$\int{r^ndx}, \quad n=2k+1, \quad k\in\mathbb{N}$$ If so, then how to derive the formula? Thank you.

Assume $$a\ge0$$. From $$r^2=a^2+x^2$$ we obtain $$rdr=xdx$$. Therefore bu substituting we can write$$\int r^ndx=\int {r^{n+1}dr\over \sqrt{r^2-a^2}}$$Now by defining $$r=a\cosh u$$ we have$$I{=\int a^{n+1}\cosh^{n+1}udu\\=\left({a\over 2}\right)^{n+1}\int (e^u+e^{-u})^{n+1}du\\=\left({a\over 2}\right)^{n+1}\int \sum_{k=0}^{n+1}\binom{n+1}{k} e^{(2k-n-1)u}du\\=\left({a\over 2}\right)^{n+1}\left[\sum_{k=0\\k\ne {n+1\over 2}}^{n+1}\binom{n+1}{k} {e^{(2k-n-1)u}\over 2k-n-1}+\binom{n+1}{{n+1\over 2}}u\right]}$$also $$r=a\cosh u\iff e^u={r+x\over a}$$which by substituting yields to
$$I=\left({a\over 2}\right)^{n+1}\sum_{k=0\\k\ne {n+1\over 2}}^{n+1}\binom{n+1}{k} {\left({r+x\over a}\right)^{2k-n-1}\over 2k-n-1}+\left({a\over 2}\right)^{n+1}\binom{n+1}{n+1\over 2}\ln {r+x\over a}+C$$
• You're welcome. The answer looks good to me now, except that the coefficient $\left(\frac{a}{2}\right)^{n + 1}$ should also be multiplied by the $\ln$ term. From the examples in OP's question for odd $n > 0$ we have $$\int r^{n / 2} \,dx = x[b_n r^n + b_{n - 2} a^2 r^{n - 2} + \cdots + b_3 a^{n - 3} r^3 + b_1 a^{n - 1} r] + c a^{n + 1} \log (x + r) + C$$ for some coefficients $b_n, b_{n - 2}, \ldots, b_3, b_1, c$ that depend on $n$---it would be interesting to have explicit formulas for those coefficients (as functions of $n$). – Travis Willse Aug 18 '19 at 15:28
If we denote the integral by $$I_k=\int\left(a^2+x^2\right)^{(2k+1)/2}\mathrm{d}x$$ then we can apply integration by parts to get \begin{align} I_k &=x\left(a^2+x^2\right)^{(2k+1)/2}-(2k+1)\int x^2\left(a^2+x^2\right)^{(2k-1)/2}\mathrm{d}x\\ &=x\left(a^2+x^2\right)^{(2k+1)/2}-(2k+1)\int \left(a^2+x^2\right)^{(2k+1)/2}-a^2\left(a^2+x^2\right)^{(2k-1)/2}\mathrm{d}x\\ &=x\left(a^2+x^2\right)^{(2k+1)/2}-(2k+1)I_k+a^2(2k+1)I_{k-1}\\ \end{align} Then we have the reduction formula $$I_k=\frac1{2(k+1)}\left(x\left(a^2+x^2\right)^{(2k+1)/2}+a^2(2k+1)I_{k-1}\right)$$ So we then only need the solution to $$I_1$$ in order to calculate any other $$I_k$$. In fact it's easier to calculate $$I_{-1}$$ which is $$I_{-1}=\int\frac{\mathrm{d}x}{\sqrt{a^2+x^2}}=\ln{\left(x+\sqrt{a^2+x^2}\right)}+C=\text{arsinh}\left(\frac{x}a\right)+C$$