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]
________________________________________________________________________________________
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]
[Out]
Rule 222
Rule 285
Rule 327
Rule 6874
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________