3.5.20 \(\int x^2 (\sqrt {1-x}+\sqrt {1+x})^2 \, dx\) [420]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {6874, 285, 327, 222} \begin {gather*} \frac {\text {ArcSin}(x)}{4}+\frac {2 x^3}{3}-\frac {1}{4} \sqrt {1-x^2} x+\frac {1}{2} \sqrt {1-x^2} x^3 \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 285

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

Rule 327

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

Rule 6874

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 59, normalized size = 1.23 \begin {gather*} \frac {1}{12} \left (8-3 x \sqrt {1-x^2}+x^3 \left (8+6 \sqrt {1-x^2}\right )+6 \tan ^{-1}\left (\frac {\sqrt {1+x}}{\sqrt {1-x}}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.22, size = 59, normalized size = 1.23

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 51, normalized size = 1.06 \begin {gather*} \frac {2}{3} \, x^{3} + \frac {1}{4} \, {\left (2 \, x^{3} - x\right )} \sqrt {x + 1} \sqrt {-x + 1} - \frac {1}{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(x^2*((1-x)^(1/2)+(1+x)^(1/2))^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 159.23, size = 270, normalized size = 5.62 \begin {gather*} - \frac {x^{4}}{4} + \frac {x^{3}}{3} + \frac {\left (x + 1\right )^{4}}{4} - \frac {2 \left (x + 1\right )^{3}}{3} + \frac {\left (x + 1\right )^{2}}{2} + 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 ) - 8 \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 ) + 4 \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}}}{3} - \frac {\sqrt {1 - x} \sqrt {x + 1} \left (- 5 x - 2 \left (x + 1\right )^{3} + 6 \left (x + 1\right )^{2} - 4\right )}{16} + \frac {5 \operatorname {asin}{\left (\frac {\sqrt {2} \sqrt {x + 1}}{2} \right )}}{8} & \text {for}\: \sqrt {x + 1} > - \sqrt {2} \wedge \sqrt {x + 1} < \sqrt {2} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x**4/4 + x**3/3 + (x + 1)**4/4 - 2*(x + 1)**3/3 + (x + 1)**2/2 + 4*Piecewise((x*sqrt(1 - x)*sqrt(x + 1)/4 + a
sin(sqrt(2)*sqrt(x + 1)/2)/2, (sqrt(x + 1) < sqrt(2)) & (sqrt(x + 1) > -sqrt(2)))) - 8*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)))) + 4*Piecewise((x*sqrt(1 - x)*sqrt(x + 1)/4 - (1 - x)**(3/2)*(x + 1)**(3/2)/3 - sqrt(
1 - x)*sqrt(x + 1)*(-5*x - 2*(x + 1)**3 + 6*(x + 1)**2 - 4)/16 + 5*asin(sqrt(2)*sqrt(x + 1)/2)/8, (sqrt(x + 1)
 < sqrt(2)) & (sqrt(x + 1) > -sqrt(2))))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (36) = 72\).
time = 4.09, size = 76, normalized size = 1.58 \begin {gather*} \frac {2}{3} \, x^{3} + \frac {1}{12} \, {\left ({\left (2 \, {\left (3 \, x - 10\right )} {\left (x + 1\right )} + 43\right )} {\left (x + 1\right )} - 39\right )} \sqrt {x + 1} \sqrt {-x + 1} + \frac {1}{3} \, {\left ({\left (2 \, x - 5\right )} {\left (x + 1\right )} + 9\right )} \sqrt {x + 1} \sqrt {-x + 1} + \frac {1}{2} \, \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(x^2*((1-x)^(1/2)+(1+x)^(1/2))^2,x, algorithm="giac")

[Out]

2/3*x^3 + 1/12*((2*(3*x - 10)*(x + 1) + 43)*(x + 1) - 39)*sqrt(x + 1)*sqrt(-x + 1) + 1/3*((2*x - 5)*(x + 1) +
9)*sqrt(x + 1)*sqrt(-x + 1) + 1/2*arcsin(1/2*sqrt(2)*sqrt(x + 1))

________________________________________________________________________________________

Mupad [B]
time = 14.09, size = 563, normalized size = 11.73 \begin {gather*} \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}-\mathrm {atan}\left (\frac {\sqrt {1-x}-1}{\sqrt {x+1}-1}\right )-\frac {\frac {3\,\left (\sqrt {1-x}-1\right )}{\sqrt {x+1}-1}+\frac {23\,{\left (\sqrt {1-x}-1\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}-\frac {333\,{\left (\sqrt {1-x}-1\right )}^5}{{\left (\sqrt {x+1}-1\right )}^5}+\frac {671\,{\left (\sqrt {1-x}-1\right )}^7}{{\left (\sqrt {x+1}-1\right )}^7}-\frac {671\,{\left (\sqrt {1-x}-1\right )}^9}{{\left (\sqrt {x+1}-1\right )}^9}+\frac {333\,{\left (\sqrt {1-x}-1\right )}^{11}}{{\left (\sqrt {x+1}-1\right )}^{11}}-\frac {23\,{\left (\sqrt {1-x}-1\right )}^{13}}{{\left (\sqrt {x+1}-1\right )}^{13}}-\frac {3\,{\left (\sqrt {1-x}-1\right )}^{15}}{{\left (\sqrt {x+1}-1\right )}^{15}}}{\frac {8\,{\left (\sqrt {1-x}-1\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}+\frac {28\,{\left (\sqrt {1-x}-1\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}+\frac {56\,{\left (\sqrt {1-x}-1\right )}^6}{{\left (\sqrt {x+1}-1\right )}^6}+\frac {70\,{\left (\sqrt {1-x}-1\right )}^8}{{\left (\sqrt {x+1}-1\right )}^8}+\frac {56\,{\left (\sqrt {1-x}-1\right )}^{10}}{{\left (\sqrt {x+1}-1\right )}^{10}}+\frac {28\,{\left (\sqrt {1-x}-1\right )}^{12}}{{\left (\sqrt {x+1}-1\right )}^{12}}+\frac {8\,{\left (\sqrt {1-x}-1\right )}^{14}}{{\left (\sqrt {x+1}-1\right )}^{14}}+\frac {{\left (\sqrt {1-x}-1\right )}^{16}}{{\left (\sqrt {x+1}-1\right )}^{16}}+1}+\frac {2\,x^3}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((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) - atan(((1 - x)^(1/2) - 1)/((x + 1)^(1/2)
- 1)) - ((3*((1 - x)^(1/2) - 1))/((x + 1)^(1/2) - 1) + (23*((1 - x)^(1/2) - 1)^3)/((x + 1)^(1/2) - 1)^3 - (333
*((1 - x)^(1/2) - 1)^5)/((x + 1)^(1/2) - 1)^5 + (671*((1 - x)^(1/2) - 1)^7)/((x + 1)^(1/2) - 1)^7 - (671*((1 -
 x)^(1/2) - 1)^9)/((x + 1)^(1/2) - 1)^9 + (333*((1 - x)^(1/2) - 1)^11)/((x + 1)^(1/2) - 1)^11 - (23*((1 - x)^(
1/2) - 1)^13)/((x + 1)^(1/2) - 1)^13 - (3*((1 - x)^(1/2) - 1)^15)/((x + 1)^(1/2) - 1)^15)/((8*((1 - x)^(1/2) -
 1)^2)/((x + 1)^(1/2) - 1)^2 + (28*((1 - x)^(1/2) - 1)^4)/((x + 1)^(1/2) - 1)^4 + (56*((1 - x)^(1/2) - 1)^6)/(
(x + 1)^(1/2) - 1)^6 + (70*((1 - x)^(1/2) - 1)^8)/((x + 1)^(1/2) - 1)^8 + (56*((1 - x)^(1/2) - 1)^10)/((x + 1)
^(1/2) - 1)^10 + (28*((1 - x)^(1/2) - 1)^12)/((x + 1)^(1/2) - 1)^12 + (8*((1 - x)^(1/2) - 1)^14)/((x + 1)^(1/2
) - 1)^14 + ((1 - x)^(1/2) - 1)^16/((x + 1)^(1/2) - 1)^16 + 1) + (2*x^3)/3

________________________________________________________________________________________