3.9.15 \(\int x (1+\sqrt {1-x} \sqrt {1+x}) \, dx\) [815]

Optimal. Leaf size=23 \[ \frac {x^2}{2}-\frac {1}{3} \left (1-x^2\right )^{3/2} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {14, 267} \begin {gather*} \frac {x^2}{2}-\frac {1}{3} \left (1-x^2\right )^{3/2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x^2/2 - (1 - x^2)^(3/2)/3

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 267

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 24, normalized size = 1.04 \begin {gather*} \frac {1}{6} \left (-1+x^2\right ) \left (3+2 \sqrt {1-x^2}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.50, size = 26, normalized size = 1.13

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 17, normalized size = 0.74 \begin {gather*} \frac {1}{2} \, x^{2} - \frac {1}{3} \, {\left (-x^{2} + 1\right )}^{\frac {3}{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 25, normalized size = 1.09 \begin {gather*} \frac {1}{2} \, x^{2} + \frac {1}{3} \, {\left (x^{2} - 1\right )} \sqrt {x + 1} \sqrt {-x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 53.32, size = 139, normalized size = 6.04 \begin {gather*} - x + \frac {\left (x + 1\right )^{2}}{2} - 2 \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 \left (\begin {cases} \frac {x \sqrt {1 - x} \sqrt {x + 1}}{4} - \frac {\left (1 - x\right )^{\frac {3}{2}} \left (x + 1\right )^{\frac {3}{2}}}{6} + \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 ) - 1 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (17) = 34\).
time = 2.56, size = 54, normalized size = 2.35 \begin {gather*} \frac {1}{2} \, {\left (x + 1\right )}^{2} + \frac {1}{6} \, {\left ({\left (2 \, x - 5\right )} {\left (x + 1\right )} + 9\right )} \sqrt {x + 1} \sqrt {-x + 1} + \frac {1}{2} \, \sqrt {x + 1} {\left (x - 2\right )} \sqrt {-x + 1} - x - 1 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(x + 1)^2 + 1/6*((2*x - 5)*(x + 1) + 9)*sqrt(x + 1)*sqrt(-x + 1) + 1/2*sqrt(x + 1)*(x - 2)*sqrt(-x + 1) -
x - 1

________________________________________________________________________________________

Mupad [B]
time = 3.69, size = 35, normalized size = 1.52 \begin {gather*} \frac {x^2}{2}-\frac {\sqrt {1-x}\,\left (-\frac {x^3}{3}-\frac {x^2}{3}+\frac {x}{3}+\frac {1}{3}\right )}{\sqrt {x+1}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________