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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {6742, 195, 216} \[ \sqrt {1-x^2} x+2 x+\sin ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + x*Sqrt[1 - x^2] + ArcSin[x]

Rule 195

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(x*(a + b*x^n)^p)/(n*p + 1), x] + Dist[(a*n*p)/(n*p + 1),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

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 6742

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 18, normalized size = 0.95 \[ x \left (\sqrt {1-x^2}+2\right )+\sin ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 40, normalized size = 2.11 \[ \sqrt {x + 1} x \sqrt {-x + 1} + 2 \, x - 2 \, \arctan \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, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.20, size = 48, normalized size = 2.53 \[ \sqrt {x + 1} {\left (x - 2\right )} \sqrt {-x + 1} + 2 \, x + 2 \, \sqrt {x + 1} \sqrt {-x + 1} + 2 \, \arcsin \left (\frac {1}{2} \, \sqrt {2} \sqrt {x + 1}\right ) + 2 \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.01, size = 58, normalized size = 3.05 \[ 2 x +\frac {\sqrt {\left (x +1\right ) \left (-x +1\right )}\, \arcsin \relax (x )}{\sqrt {-x +1}\, \sqrt {x +1}}-\sqrt {x +1}\, \left (-x +1\right )^{\frac {3}{2}}+\sqrt {-x +1}\, \sqrt {x +1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.42, size = 17, normalized size = 0.89 \[ \sqrt {-x^{2} + 1} x + 2 \, x + \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, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 7.72, size = 206, normalized size = 10.84 \[ 2\,x-4\,\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-\frac {\frac {4\,\left (\sqrt {1-x}-1\right )}{\sqrt {x+1}-1}-\frac {28\,{\left (\sqrt {1-x}-1\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}+\frac {28\,{\left (\sqrt {1-x}-1\right )}^5}{{\left (\sqrt {x+1}-1\right )}^5}-\frac {4\,{\left (\sqrt {1-x}-1\right )}^7}{{\left (\sqrt {x+1}-1\right )}^7}}{\frac {4\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}+\frac {6\,{\left (\sqrt {1-x}-1\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}+\frac {4\,{\left (\sqrt {1-x}-1\right )}^6}{{\left (\sqrt {x+1}-1\right )}^6}+\frac {{\left (\sqrt {1-x}-1\right )}^8}{{\left (\sqrt {x+1}-1\right )}^8}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - 4*atan(((1 - x)^(1/2) - 1)/((x + 1)^(1/2) - 1)) - ((4*((1 - x)^(1/2) - 1))/((x + 1)^(1/2) - 1) - (28*((1
 - x)^(1/2) - 1)^3)/((x + 1)^(1/2) - 1)^3 + (28*((1 - x)^(1/2) - 1)^5)/((x + 1)^(1/2) - 1)^5 - (4*((1 - x)^(1/
2) - 1)^7)/((x + 1)^(1/2) - 1)^7)/((4*((1 - x)^(1/2) - 1)^2)/((x + 1)^(1/2) - 1)^2 + (6*((1 - x)^(1/2) - 1)^4)
/((x + 1)^(1/2) - 1)^4 + (4*((1 - x)^(1/2) - 1)^6)/((x + 1)^(1/2) - 1)^6 + ((1 - x)^(1/2) - 1)^8/((x + 1)^(1/2
) - 1)^8 + 1)

________________________________________________________________________________________

sympy [A]  time = 31.43, size = 44, normalized size = 2.32 \[ 2 x + 4 \left (\begin {cases} \frac {x \sqrt {1 - x} \sqrt {x + 1}}{4} + \frac {\operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{2} & \text {for}\: x \geq -1 \wedge x < 1 \end {cases}\right ) + 2 \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x + 4*Piecewise((x*sqrt(1 - x)*sqrt(x + 1)/4 + asin(sqrt(2)*sqrt(x + 1)/2)/2, (x >= -1) & (x < 1))) + 2

________________________________________________________________________________________