3.5.43 \(\int \sqrt {1-x} (\sqrt {1-x}+\sqrt {1+x}) \, dx\) [443]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {6820, 201, 222} \begin {gather*} \frac {\text {ArcSin}(x)}{2}-\frac {x^2}{2}+\frac {1}{2} \sqrt {1-x^2} x+x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 45, normalized size = 1.45 \begin {gather*} x-\frac {x^2}{2}+\frac {1}{2} x \sqrt {1-x^2}-\tan ^{-1}\left (\frac {\sqrt {1-x^2}}{1+x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(62\) vs. \(2(23)=46\).
time = 0.24, size = 63, normalized size = 2.03

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 23, normalized size = 0.74 \begin {gather*} -\frac {1}{2} \, x^{2} + \frac {1}{2} \, \sqrt {-x^{2} + 1} x + x + \frac {1}{2} \, \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)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 44, normalized size = 1.42 \begin {gather*} -\frac {1}{2} \, x^{2} + \frac {1}{2} \, \sqrt {x + 1} x \sqrt {-x + 1} + x - \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)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (22) = 44\).
time = 1.19, size = 65, normalized size = 2.10 \begin {gather*} - \frac {\left (1 - x\right )^{2}}{2} - 2 \left (\begin {cases} - \frac {x \sqrt {1 - x} \sqrt {x + 1}}{4} + \frac {\operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {1 - x}}{2} \right )}}{2} & \text {for}\: \sqrt {1 - x} > - \sqrt {2} \wedge \sqrt {1 - x} < \sqrt {2} \end {cases}\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)),x)

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (23) = 46\).
time = 2.73, size = 54, normalized size = 1.74 \begin {gather*} -\frac {1}{2} \, {\left (x - 1\right )}^{2} + \frac {1}{2} \, {\left (x + 2\right )} \sqrt {x + 1} \sqrt {-x + 1} - \sqrt {x + 1} \sqrt {-x + 1} - \arcsin \left (\frac {1}{2} \, \sqrt {2} \sqrt {-x + 1}\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)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 8.12, size = 209, normalized size = 6.74 \begin {gather*} x-2\,\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-\frac {\frac {2\,\left (\sqrt {1-x}-1\right )}{\sqrt {x+1}-1}-\frac {14\,{\left (\sqrt {1-x}-1\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}+\frac {14\,{\left (\sqrt {1-x}-1\right )}^5}{{\left (\sqrt {x+1}-1\right )}^5}-\frac {2\,{\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}-\frac {x^2}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________