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

Optimal. Leaf size=32 \[ 2 \sqrt {1-x^2}-2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )+2 \log (x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {6742, 266, 50, 63, 206} \[ 2 \sqrt {1-x^2}-2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )+2 \log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*Sqrt[1 - x^2] - 2*ArcTanh[Sqrt[1 - x^2]] + 2*Log[x]

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 206

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

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

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} \, dx &=\int \left (\frac {2}{x}+\frac {2 \sqrt {1-x^2}}{x}\right ) \, dx\\ &=2 \log (x)+2 \int \frac {\sqrt {1-x^2}}{x} \, dx\\ &=2 \log (x)+\operatorname {Subst}\left (\int \frac {\sqrt {1-x}}{x} \, dx,x,x^2\right )\\ &=2 \sqrt {1-x^2}+2 \log (x)+\operatorname {Subst}\left (\int \frac {1}{\sqrt {1-x} x} \, dx,x,x^2\right )\\ &=2 \sqrt {1-x^2}+2 \log (x)-2 \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {1-x^2}\right )\\ &=2 \sqrt {1-x^2}-2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )+2 \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 32, normalized size = 1.00 \[ 2 \sqrt {1-x^2}-2 \tanh ^{-1}\left (\sqrt {1-x^2}\right )+2 \log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*Sqrt[1 - x^2] - 2*ArcTanh[Sqrt[1 - x^2]] + 2*Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 41, normalized size = 1.28 \[ 2 \, \sqrt {x + 1} \sqrt {-x + 1} + 2 \, \log \relax (x) + 2 \, \log \left (\frac {\sqrt {x + 1} \sqrt {-x + 1} - 1}{x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Warning, choosing root of [1,0,-4,0,%%%{
4,[2]%%%}] at parameters values [-93.616423693]Warning, choosing root of [1,0,-4,0,%%%{4,[2]%%%}] at parameter
s values [-17.8804557086]2*ln(abs(sqrt(x+1)-1))+2*ln(sqrt(x+1)+1)+2*sqrt(x+1)*sqrt(-x+1)-2*ln(abs(2*sqrt(x+1)/
(-2*sqrt(-x+1)+2*sqrt(2))+2-1/2*(-2*sqrt(-x+1)+2*sqrt(2))/sqrt(x+1)))+2*ln(abs(2*sqrt(x+1)/(-2*sqrt(-x+1)+2*sq
rt(2))-2-1/2*(-2*sqrt(-x+1)+2*sqrt(2))/sqrt(x+1)))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 51, normalized size = 1.59 \[ 2 \ln \relax (x )+\frac {2 \sqrt {x +1}\, \sqrt {-x +1}\, \left (-\arctanh \left (\frac {1}{\sqrt {-x^{2}+1}}\right )+\sqrt {-x^{2}+1}\right )}{\sqrt {-x^{2}+1}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.53, size = 41, normalized size = 1.28 \[ 2 \, \sqrt {-x^{2} + 1} + 2 \, \log \relax (x) - 2 \, \log \left (\frac {2 \, \sqrt {-x^{2} + 1}}{{\left | x \right |}} + \frac {2}{{\left | x \right |}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 4.10, size = 122, normalized size = 3.81 \[ 2\,\ln \left (\frac {{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}-1\right )-2\,\ln \left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )+2\,\ln \relax (x)+\frac {16\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2\,\left (\frac {2\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}+\frac {{\left (\sqrt {1-x}-1\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(((1 - x)^(1/2) - 1)^2/((x + 1)^(1/2) - 1)^2 - 1) - 2*log(((1 - x)^(1/2) - 1)/((x + 1)^(1/2) - 1)) + 2*lo
g(x) + (16*((1 - x)^(1/2) - 1)^2)/(((x + 1)^(1/2) - 1)^2*((2*((1 - x)^(1/2) - 1)^2)/((x + 1)^(1/2) - 1)^2 + ((
1 - x)^(1/2) - 1)^4/((x + 1)^(1/2) - 1)^4 + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________