Evaluate $\int\frac{1+x+\sqrt{1+x^2}}{\sqrt{x+1}+\sqrt{x}}\,dx$
Question:
Solve the integral $$ \int\frac{1+x+\sqrt{1+x^2}}{\sqrt{x+1}+\sqrt{x}}\,dx $$
My solution:
Multiply both the numerator and denominator by $\sqrt{x+1}-\sqrt{x}$. This changes the integral to
$$ \begin{align} \int&\left(1+x+\sqrt{1+x^2}\right)\left(\sqrt{x+1}-\sqrt{x}\right)\,dx\\ &= \int{(1+x)^{3/2}}\,dx-\int{\sqrt{(1+x)(1+x^2)}}\,dx-\int{\sqrt{x}(1+x)}\,dx-\int{\sqrt{x}\sqrt{1+x^2}}\,dx\\ & = \frac{2}{5}(1+x)^{5/2}-I-\frac{2}{3}x^{3/2}-\frac{2}{5}x^{5/2}-J \end{align} $$
where $I = \int{(1+x)^{1/2}(1+x^2)^{1/2}}\,dx$ and $J = \int{x^{1/2}(1+x^2)^{1/2}}\,dx$.
How can I solve the integrals $I$ and $J$?
Solution 1:
One can be brought to the form $\int u^a (1-u)^b \mathrm{d}u$ which is discussed in this answer of mine: $$\begin{eqnarray} J &=& \int \sqrt{x} \sqrt{1+x^2} \mathrm{d}x \stackrel{u=x^2}{=} \frac{1}{2} \int u^{-1/4} (1+u)^{1/2} \mathrm{d} u \\ &=& \frac{2}{3} u^{3/4} \cdot {}_2F_1\left(-\frac{1}{2}, \frac{3}{4}; \frac{7}{4}; -u\right) +\text{const.} = \frac{2}{3} x^{3/2} \cdot {}_2F_1\left(-\frac{1}{2}, \frac{3}{4}; \frac{7}{4}; -x^2\right) +\text{const.} \end{eqnarray} $$ The other integral is an elliptic integral: $$\begin{eqnarray} I &=& \frac{4}{15} \sqrt{2\alpha} \left(\alpha \operatorname{F}\left( \arcsin \left( \frac{x-\frac{1}{\alpha}}{x+\alpha}\right) ,-\alpha^2\right) -\frac{1}{\alpha} \operatorname{E}\left(\arcsin \left( \frac{x-\frac{1}{\alpha}}{x+\alpha}\right) ,-\alpha^2\right)\right) \\ && + \frac{2}{15} \sqrt{1+x}\sqrt{1+x^2} \left(3x+1 + \frac{4}{x+\alpha}\right) + \text{const.} \end{eqnarray} $$ where $\alpha = \sqrt{2}+1$ and $$ \operatorname{E}\left(\phi, m\right) = \int_0^\phi \sqrt{1-m \sin^2\varphi}\, \mathrm{d}\varphi, \quad \operatorname{F}\left(\phi, m\right) = \int_0^\phi \frac{\mathrm{d}\varphi}{\sqrt{1-m \sin^2\varphi}} $$ It can be evaluated using the Jacobi elliptic functions substitution: $$ \operatorname{sn}\left(t, -\alpha^2\right) = \frac{x-\frac{1}{\alpha}}{x+\alpha} $$ as described in Byrd and Friedman.
Solution 2:
For any real number of $x$ ,
When $|x|\leq1$ ,
$J=\int x^\frac{1}{2}(1+x^2)^\frac{1}{2}$
$=\int x^\frac{1}{2}\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{2n}}{4^n(n!)^2(1-2n)}dx$
$=\int\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{2n+\frac{1}{2}}}{4^n(n!)^2(1-2n)}dx$
$=\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{2n+\frac{3}{2}}}{4^n(n!)^2(1-2n)\left(2n+\dfrac{3}{2}\right)}+C$
$=\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{2n+\frac{3}{2}}}{2^{2n-1}(n!)^2(1-2n)(4n+3)}+C$
$I=\int(1+x)^\frac{1}{2}(1+x^2)^\frac{1}{2}$
$=\int(x+1)^\frac{1}{2}\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{2n}}{4^n(n!)^2(1-2n)}dx$
$=\int(x+1)^\frac{1}{2}\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!(x+1-1)^{2n}}{4^n(n!)^2(1-2n)}dx$
$=\int(x+1)^\frac{1}{2}\sum\limits_{n=0}^\infty\sum\limits_{k=0}^{2n}\dfrac{(-1)^{-n}(2n)!C_k^{2n}(-1)^{2n-k}(x+1)^k}{4^n(n!)^2(1-2n)}dx$
$=\int\sum\limits_{n=0}^\infty\sum\limits_{k=0}^{2n}\dfrac{(-1)^{n-k}((2n)!)^2(x+1)^{k+\frac{1}{2}}}{4^n(n!)^2k!(2n-k)!(1-2n)}dx$
$=\sum\limits_{n=0}^\infty\sum\limits_{k=0}^{2n}\dfrac{(-1)^{n-k}((2n)!)^2(x+1)^{k+\frac{3}{2}}}{4^n(n!)^2k!(2n-k)!(1-2n)\left(k+\frac{3}{2}\right)}+C$
$=\sum\limits_{n=0}^\infty\sum\limits_{k=0}^{2n}\dfrac{(-1)^{n-k}((2n)!)^2(x+1)^{k+\frac{3}{2}}}{2^{2n-1}(n!)^2k!(2n-k)!(1-2n)(2k+3)}+C$
When $|x|\geq1$ ,
$J=\int x^\frac{1}{2}(1+x^2)^\frac{1}{2}$
$=\int x^\frac{1}{2}\left(x^2\left(\dfrac{1}{x^2}+1\right)\right)^\frac{1}{2}$
$=\int x^\frac{3}{2}\left(1+\dfrac{1}{x^2}\right)^\frac{1}{2}$
$=\int x^\frac{3}{2}\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{-2n}}{4^n(n!)^2(1-2n)}dx$
$=\int\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{\frac{3}{2}-2n}}{4^n(n!)^2(1-2n)}dx$
$=\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^{\frac{5}{2}-2n}}{4^n(n!)^2(1-2n)\left(\dfrac{5}{2}-2n\right)}+C$
$=\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!}{2^{2n-1}(n!)^2(2n-1)(4n-5)x^{2n-\frac{5}{2}}}+C$