3.5.47 \(\int (-\sqrt {1-x}-\sqrt {1+x}) (\sqrt {1-x}+\sqrt {1+x}) \, dx\) [447]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {6820, 6874, 201, 222} \begin {gather*} -\text {ArcSin}(x)-\sqrt {1-x^2} x-2 x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 201

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 222

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 6820

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

Rule 6874

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 ) \left (\sqrt {1-x}+\sqrt {1+x}\right ) \, dx &=-\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 = 38, normalized size = 1.73 \begin {gather*} -2-x \left (2+\sqrt {1-x^2}\right )-2 \tan ^{-1}\left (\frac {\sqrt {1+x}}{\sqrt {1-x}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(58\) vs. \(2(20)=40\).
time = 0.25, size = 59, normalized size = 2.68

method result size
default \(-2 x -\sqrt {1-x}\, \left (1+x \right )^{\frac {3}{2}}+\sqrt {1-x}\, \sqrt {1+x}-\frac {\sqrt {\left (1-x \right ) \left (1+x \right )}\, \arcsin \left (x \right )}{\sqrt {1+x}\, \sqrt {1-x}}\) \(59\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-(1-x)^(1/2)-(1+x)^(1/2))*((1-x)^(1/2)+(1+x)^(1/2)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 20, normalized size = 0.91 \begin {gather*} -\sqrt {-x^{2} + 1} x - 2 \, x - \arcsin \left (x\right ) \end {gather*}

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]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (20) = 40\).
time = 0.37, size = 41, normalized size = 1.86 \begin {gather*} -\sqrt {x + 1} x \sqrt {-x + 1} - 2 \, x + 2 \, \arctan \left (\frac {\sqrt {x + 1} \sqrt {-x + 1} - 1}{x}\right ) \end {gather*}

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]

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

________________________________________________________________________________________

Sympy [A]
time = 21.12, size = 63, normalized size = 2.86 \begin {gather*} - 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}\: \sqrt {x + 1} > - \sqrt {2} \wedge \sqrt {x + 1} < \sqrt {2} \end {cases}\right ) - 2 \end {gather*}

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]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (20) = 40\).
time = 3.38, size = 49, normalized size = 2.23 \begin {gather*} -\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 \end {gather*}

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]

-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

________________________________________________________________________________________

Mupad [B]
time = 3.71, size = 205, normalized size = 9.32 \begin {gather*} 4\,\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-2\,x+\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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*atan(((1 - x)^(1/2) - 1)/((x + 1)^(1/2) - 1)) - 2*x + ((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)

________________________________________________________________________________________