3.424 \(\int \frac {(\sqrt {1-x}+\sqrt {1+x})^2}{x^2} \, dx\)

Optimal. Leaf size=26 \[ -\frac {2 \sqrt {1-x^2}}{x}-\frac {2}{x}-2 \sin ^{-1}(x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {6742, 277, 216} \[ -\frac {2 \sqrt {1-x^2}}{x}-\frac {2}{x}-2 \sin ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 216

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[(Rt[-b, 2]*x)/Sqrt[a]]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 277

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[((c*x)^(m + 1)*(a + b*x^n)^p)/(c*(m +
1)), x] - Dist[(b*n*p)/(c^n*(m + 1)), Int[(c*x)^(m + n)*(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b, c}, x] &&
IGtQ[n, 0] && GtQ[p, 0] && LtQ[m, -1] &&  !ILtQ[(m + n*p + n + 1)/n, 0] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 6742

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

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 44, normalized size = 1.69 \[ \frac {2 \, {\left (2 \, x \arctan \left (\frac {\sqrt {x + 1} \sqrt {-x + 1} - 1}{x}\right ) - \sqrt {x + 1} \sqrt {-x + 1} - 1\right )}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(2*x*arctan((sqrt(x + 1)*sqrt(-x + 1) - 1)/x) - sqrt(x + 1)*sqrt(-x + 1) - 1)/x

________________________________________________________________________________________

giac [B]  time = 0.26, size = 149, normalized size = 5.73 \[ -2 \, \pi - \frac {8 \, {\left (\frac {\sqrt {2} - \sqrt {-x + 1}}{\sqrt {x + 1}} - \frac {\sqrt {x + 1}}{\sqrt {2} - \sqrt {-x + 1}}\right )}}{{\left (\frac {\sqrt {2} - \sqrt {-x + 1}}{\sqrt {x + 1}} - \frac {\sqrt {x + 1}}{\sqrt {2} - \sqrt {-x + 1}}\right )}^{2} - 4} - \frac {2}{x} - 4 \, \arctan \left (\frac {\sqrt {x + 1} {\left (\frac {{\left (\sqrt {2} - \sqrt {-x + 1}\right )}^{2}}{x + 1} - 1\right )}}{2 \, {\left (\sqrt {2} - \sqrt {-x + 1}\right )}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*pi - 8*((sqrt(2) - sqrt(-x + 1))/sqrt(x + 1) - sqrt(x + 1)/(sqrt(2) - sqrt(-x + 1)))/(((sqrt(2) - sqrt(-x +
 1))/sqrt(x + 1) - sqrt(x + 1)/(sqrt(2) - sqrt(-x + 1)))^2 - 4) - 2/x - 4*arctan(1/2*sqrt(x + 1)*((sqrt(2) - s
qrt(-x + 1))^2/(x + 1) - 1)/(sqrt(2) - sqrt(-x + 1)))

________________________________________________________________________________________

maple [B]  time = 0.02, size = 50, normalized size = 1.92 \[ -\frac {2}{x}+\frac {2 \left (-x \arcsin \relax (x )-\sqrt {-x^{2}+1}\right ) \sqrt {x +1}\, \sqrt {-x +1}}{\sqrt {-x^{2}+1}\, x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.26, size = 24, normalized size = 0.92 \[ -\frac {2 \, \sqrt {-x^{2} + 1}}{x} - \frac {2}{x} - 2 \, \arcsin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 3.79, size = 120, normalized size = 4.62 \[ 8\,\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-\frac {\frac {5\,{\left (\sqrt {1-x}-1\right )}^2}{2\,{\left (\sqrt {x+1}-1\right )}^2}-\frac {1}{2}}{\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}-\frac {{\left (\sqrt {1-x}-1\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}}-\frac {\sqrt {1-x}-1}{2\,\left (\sqrt {x+1}-1\right )}-\frac {2}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

8*atan(((1 - x)^(1/2) - 1)/((x + 1)^(1/2) - 1)) - ((5*((1 - x)^(1/2) - 1)^2)/(2*((x + 1)^(1/2) - 1)^2) - 1/2)/
(((1 - x)^(1/2) - 1)/((x + 1)^(1/2) - 1) - ((1 - x)^(1/2) - 1)^3/((x + 1)^(1/2) - 1)^3) - ((1 - x)^(1/2) - 1)/
(2*((x + 1)^(1/2) - 1)) - 2/x

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (\sqrt {1 - x} + \sqrt {x + 1}\right )^{2}}{x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((sqrt(1 - x) + sqrt(x + 1))**2/x**2, x)

________________________________________________________________________________________