3.452 \(\int \frac {-\sqrt {-1+x}+\sqrt {1+x}}{\sqrt {-1+x}+\sqrt {1+x}} \, dx\)

Optimal. Leaf size=33 \[ \frac {x^2}{2}-\frac {1}{2} \sqrt {x-1} \sqrt {x+1} x+\frac {1}{2} \cosh ^{-1}(x) \]

[Out]

1/2*x^2+1/2*arccosh(x)-1/2*x*(-1+x)^(1/2)*(1+x)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 4, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {2104, 6742, 38, 52} \[ \frac {x^2}{2}-\frac {1}{2} \sqrt {x-1} \sqrt {x+1} x+\frac {1}{2} \cosh ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[(-Sqrt[-1 + x] + Sqrt[1 + x])/(Sqrt[-1 + x] + Sqrt[1 + x]),x]

[Out]

x^2/2 - (Sqrt[-1 + x]*x*Sqrt[1 + x])/2 + ArcCosh[x]/2

Rule 38

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(x*(a + b*x)^m*(c + d*x)^m)/(2*m + 1)
, x] + Dist[(2*a*c*m)/(2*m + 1), Int[(a + b*x)^(m - 1)*(c + d*x)^(m - 1), x], x] /; FreeQ[{a, b, c, d}, x] &&
EqQ[b*c + a*d, 0] && IGtQ[m + 1/2, 0]

Rule 52

Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ArcCosh[(b*x)/a]/b, x] /; FreeQ[{a,
 b, c, d}, x] && EqQ[a + c, 0] && EqQ[b - d, 0] && GtQ[a, 0]

Rule 2104

Int[(u_)/((e_.)*Sqrt[(a_.) + (b_.)*(x_)] + (f_.)*Sqrt[(c_.) + (d_.)*(x_)]), x_Symbol] :> -Dist[d/(e*(b*c - a*d
)), Int[u*Sqrt[a + b*x], x], x] + Dist[b/(f*(b*c - a*d)), Int[u*Sqrt[c + d*x], x], x] /; FreeQ[{a, b, c, d, e,
 f}, x] && NeQ[b*c - a*d, 0] && EqQ[b*e^2 - d*f^2, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {align*} \int \frac {-\sqrt {-1+x}+\sqrt {1+x}}{\sqrt {-1+x}+\sqrt {1+x}} \, dx &=-\left (\frac {1}{2} \int \sqrt {-1+x} \left (-\sqrt {-1+x}+\sqrt {1+x}\right ) \, dx\right )+\frac {1}{2} \int \sqrt {1+x} \left (-\sqrt {-1+x}+\sqrt {1+x}\right ) \, dx\\ &=\frac {1}{2} \int \left (1+x-\sqrt {-1+x} \sqrt {1+x}\right ) \, dx-\frac {1}{2} \int \left (1-x+\sqrt {-1+x} \sqrt {1+x}\right ) \, dx\\ &=\frac {x^2}{2}-2 \left (\frac {1}{2} \int \sqrt {-1+x} \sqrt {1+x} \, dx\right )\\ &=\frac {x^2}{2}-2 \left (\frac {1}{4} \sqrt {-1+x} x \sqrt {1+x}-\frac {1}{4} \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx\right )\\ &=\frac {x^2}{2}-2 \left (\frac {1}{4} \sqrt {-1+x} x \sqrt {1+x}-\frac {1}{4} \cosh ^{-1}(x)\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.16, size = 58, normalized size = 1.76 \[ \frac {1}{2} \left (x^2-\sqrt {x-1} \sqrt {x+1} x+\frac {2 (x-1) \sin ^{-1}\left (\frac {\sqrt {1-x}}{\sqrt {2}}\right )}{\sqrt {-(x-1)^2}}+1\right ) \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(-Sqrt[-1 + x] + Sqrt[1 + x])/(Sqrt[-1 + x] + Sqrt[1 + x]),x]

[Out]

(1 + x^2 - Sqrt[-1 + x]*x*Sqrt[1 + x] + (2*(-1 + x)*ArcSin[Sqrt[1 - x]/Sqrt[2]])/Sqrt[-(-1 + x)^2])/2

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 37, normalized size = 1.12 \[ -\frac {1}{2} \, \sqrt {x + 1} \sqrt {x - 1} x + \frac {1}{2} \, x^{2} - \frac {1}{2} \, \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-(-1+x)^(1/2)+(1+x)^(1/2))/((-1+x)^(1/2)+(1+x)^(1/2)),x, algorithm="fricas")

[Out]

-1/2*sqrt(x + 1)*sqrt(x - 1)*x + 1/2*x^2 - 1/2*log(sqrt(x + 1)*sqrt(x - 1) - x)

________________________________________________________________________________________

giac [A]  time = 0.38, size = 41, normalized size = 1.24 \[ \frac {1}{2} \, {\left (x + 1\right )}^{2} - \frac {1}{2} \, \sqrt {x + 1} \sqrt {x - 1} x - x - \log \left (\sqrt {x + 1} - \sqrt {x - 1}\right ) - 1 \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-(-1+x)^(1/2)+(1+x)^(1/2))/((-1+x)^(1/2)+(1+x)^(1/2)),x, algorithm="giac")

[Out]

1/2*(x + 1)^2 - 1/2*sqrt(x + 1)*sqrt(x - 1)*x - x - log(sqrt(x + 1) - sqrt(x - 1)) - 1

________________________________________________________________________________________

maple [B]  time = 0.01, size = 62, normalized size = 1.88 \[ \frac {x^{2}}{2}+\frac {\sqrt {\left (x -1\right ) \left (x +1\right )}\, \ln \left (x +\sqrt {x^{2}-1}\right )}{2 \sqrt {x +1}\, \sqrt {x -1}}-\frac {\sqrt {x -1}\, \left (x +1\right )^{\frac {3}{2}}}{2}+\frac {\sqrt {x -1}\, \sqrt {x +1}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-(x-1)^(1/2)+(x+1)^(1/2))/((x-1)^(1/2)+(x+1)^(1/2)),x)

[Out]

-1/2*(x-1)^(1/2)*(x+1)^(3/2)+1/2*(x-1)^(1/2)*(x+1)^(1/2)+1/2*((x-1)*(x+1))^(1/2)/(x+1)^(1/2)/(x-1)^(1/2)*ln(x+
(x^2-1)^(1/2))+1/2*x^2

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sqrt {x + 1} - \sqrt {x - 1}}{\sqrt {x + 1} + \sqrt {x - 1}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-(-1+x)^(1/2)+(1+x)^(1/2))/((-1+x)^(1/2)+(1+x)^(1/2)),x, algorithm="maxima")

[Out]

integrate((sqrt(x + 1) - sqrt(x - 1))/(sqrt(x + 1) + sqrt(x - 1)), x)

________________________________________________________________________________________

mupad [B]  time = 10.85, size = 200, normalized size = 6.06 \[ \mathrm {acosh}\relax (x)-2\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )+\frac {\frac {14\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}+\frac {14\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^5}{{\left (\sqrt {x+1}-1\right )}^5}+\frac {2\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^7}{{\left (\sqrt {x+1}-1\right )}^7}+\frac {2\,\left (\sqrt {x-1}-\mathrm {i}\right )}{\sqrt {x+1}-1}}{1+\frac {6\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}-\frac {4\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^6}{{\left (\sqrt {x+1}-1\right )}^6}+\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^8}{{\left (\sqrt {x+1}-1\right )}^8}-\frac {4\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}}+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-((x - 1)^(1/2) - (x + 1)^(1/2))/((x - 1)^(1/2) + (x + 1)^(1/2)),x)

[Out]

acosh(x) - 2*atanh(((x - 1)^(1/2) - 1i)/((x + 1)^(1/2) - 1)) + ((14*((x - 1)^(1/2) - 1i)^3)/((x + 1)^(1/2) - 1
)^3 + (14*((x - 1)^(1/2) - 1i)^5)/((x + 1)^(1/2) - 1)^5 + (2*((x - 1)^(1/2) - 1i)^7)/((x + 1)^(1/2) - 1)^7 + (
2*((x - 1)^(1/2) - 1i))/((x + 1)^(1/2) - 1))/((6*((x - 1)^(1/2) - 1i)^4)/((x + 1)^(1/2) - 1)^4 - (4*((x - 1)^(
1/2) - 1i)^2)/((x + 1)^(1/2) - 1)^2 - (4*((x - 1)^(1/2) - 1i)^6)/((x + 1)^(1/2) - 1)^6 + ((x - 1)^(1/2) - 1i)^
8/((x + 1)^(1/2) - 1)^8 + 1) + x^2/2

________________________________________________________________________________________

sympy [A]  time = 31.39, size = 226, normalized size = 6.85 \[ - \frac {\left (x - 1\right )^{\frac {5}{2}}}{4 \sqrt {x + 1}} - \frac {3 \left (x - 1\right )^{\frac {3}{2}}}{4 \sqrt {x + 1}} - \frac {\sqrt {x - 1}}{2 \sqrt {x + 1}} + \frac {\left (x - 1\right )^{2}}{4} + 2 \left (\begin {cases} \frac {\left (x + 1\right )^{2}}{8} + \frac {\operatorname {acosh}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{4} - \frac {\left (x + 1\right )^{\frac {5}{2}}}{8 \sqrt {x - 1}} + \frac {3 \left (x + 1\right )^{\frac {3}{2}}}{8 \sqrt {x - 1}} - \frac {\sqrt {x + 1}}{4 \sqrt {x - 1}} & \text {for}\: \frac {\left |{x + 1}\right |}{2} > 1 \\\frac {\left (x + 1\right )^{2}}{8} - \frac {i \operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{4} + \frac {i \left (x + 1\right )^{\frac {5}{2}}}{8 \sqrt {1 - x}} - \frac {3 i \left (x + 1\right )^{\frac {3}{2}}}{8 \sqrt {1 - x}} + \frac {i \sqrt {x + 1}}{4 \sqrt {1 - x}} & \text {otherwise} \end {cases}\right ) + \frac {\operatorname {asinh}{\left (\frac {\sqrt {2} \sqrt {x - 1}}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-(-1+x)**(1/2)+(1+x)**(1/2))/((-1+x)**(1/2)+(1+x)**(1/2)),x)

[Out]

-(x - 1)**(5/2)/(4*sqrt(x + 1)) - 3*(x - 1)**(3/2)/(4*sqrt(x + 1)) - sqrt(x - 1)/(2*sqrt(x + 1)) + (x - 1)**2/
4 + 2*Piecewise(((x + 1)**2/8 + acosh(sqrt(2)*sqrt(x + 1)/2)/4 - (x + 1)**(5/2)/(8*sqrt(x - 1)) + 3*(x + 1)**(
3/2)/(8*sqrt(x - 1)) - sqrt(x + 1)/(4*sqrt(x - 1)), Abs(x + 1)/2 > 1), ((x + 1)**2/8 - I*asin(sqrt(2)*sqrt(x +
 1)/2)/4 + I*(x + 1)**(5/2)/(8*sqrt(1 - x)) - 3*I*(x + 1)**(3/2)/(8*sqrt(1 - x)) + I*sqrt(x + 1)/(4*sqrt(1 - x
)), True)) + asinh(sqrt(2)*sqrt(x - 1)/2)/2

________________________________________________________________________________________