Optimal. Leaf size=89 \[ -\frac {5}{8} r^2 (r-x) \sqrt {2 r x-x^2}-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {5}{4} r^4 \tan ^{-1}\left (\frac {x}{\sqrt {2 r x-x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {684, 654, 626,
634, 209} \begin {gather*} \frac {5}{4} r^4 \text {ArcTan}\left (\frac {x}{\sqrt {2 r x-x^2}}\right )-\frac {5}{8} r^2 (r-x) \sqrt {2 r x-x^2}-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 626
Rule 634
Rule 654
Rule 684
Rubi steps
\begin {align*} \int x^2 \sqrt {2 r x-x^2} \, dx &=-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {1}{4} (5 r) \int x \sqrt {2 r x-x^2} \, dx\\ &=-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {1}{4} \left (5 r^2\right ) \int \sqrt {2 r x-x^2} \, dx\\ &=-\frac {5}{8} r^2 (r-x) \sqrt {2 r x-x^2}-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {1}{8} \left (5 r^4\right ) \int \frac {1}{\sqrt {2 r x-x^2}} \, dx\\ &=-\frac {5}{8} r^2 (r-x) \sqrt {2 r x-x^2}-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {1}{4} \left (5 r^4\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {x}{\sqrt {2 r x-x^2}}\right )\\ &=-\frac {5}{8} r^2 (r-x) \sqrt {2 r x-x^2}-\frac {5}{12} r \left (2 r x-x^2\right )^{3/2}-\frac {1}{4} x \left (2 r x-x^2\right )^{3/2}+\frac {5}{4} r^4 \tan ^{-1}\left (\frac {x}{\sqrt {2 r x-x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 74, normalized size = 0.83 \begin {gather*} \frac {1}{24} \sqrt {-x (-2 r+x)} \left (-15 r^3-5 r^2 x-2 r x^2+6 x^3-\frac {30 r^4 \tanh ^{-1}\left (\frac {\sqrt {x}}{\sqrt {-2 r+x}}\right )}{\sqrt {x} \sqrt {-2 r+x}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 83, normalized size = 0.93
method | result | size |
risch | \(-\frac {\left (15 r^{3}+5 r^{2} x +2 r \,x^{2}-6 x^{3}\right ) x \left (2 r -x \right )}{24 \sqrt {-x \left (-2 r +x \right )}}+\frac {5 r^{4} \arctan \left (\frac {x -r}{\sqrt {2 r x -x^{2}}}\right )}{8}\) | \(69\) |
default | \(-\frac {x \left (2 r x -x^{2}\right )^{\frac {3}{2}}}{4}+\frac {5 r \left (-\frac {\left (2 r x -x^{2}\right )^{\frac {3}{2}}}{3}+r \left (-\frac {\left (2 r -2 x \right ) \sqrt {2 r x -x^{2}}}{4}+\frac {r^{2} \arctan \left (\frac {x -r}{\sqrt {2 r x -x^{2}}}\right )}{2}\right )\right )}{4}\) | \(83\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 81, normalized size = 0.91 \begin {gather*} -\frac {5}{8} \, r^{4} \arcsin \left (\frac {r - x}{r}\right ) - \frac {5}{8} \, \sqrt {2 \, r x - x^{2}} r^{3} + \frac {5}{8} \, \sqrt {2 \, r x - x^{2}} r^{2} x - \frac {5}{12} \, {\left (2 \, r x - x^{2}\right )}^{\frac {3}{2}} r - \frac {1}{4} \, {\left (2 \, r x - x^{2}\right )}^{\frac {3}{2}} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.48, size = 60, normalized size = 0.67 \begin {gather*} -\frac {5}{4} \, r^{4} \arctan \left (\frac {\sqrt {2 \, r x - x^{2}}}{x}\right ) - \frac {1}{24} \, {\left (15 \, r^{3} + 5 \, r^{2} x + 2 \, r x^{2} - 6 \, x^{3}\right )} \sqrt {2 \, r x - x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} \sqrt {- x \left (- 2 r + x\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.55, size = 54, normalized size = 0.61 \begin {gather*} -\frac {5}{8} \, r^{4} \arcsin \left (\frac {r - x}{r}\right ) \mathrm {sgn}\left (r\right ) - \frac {1}{24} \, {\left (15 \, r^{3} + {\left (5 \, r^{2} + 2 \, {\left (r - 3 \, x\right )} x\right )} x\right )} \sqrt {2 \, r x - x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.32, size = 75, normalized size = 0.84 \begin {gather*} -\frac {x\,{\left (2\,r\,x-x^2\right )}^{3/2}}{4}-\frac {5\,r\,\left (\frac {\sqrt {2\,r\,x-x^2}\,\left (12\,r^2+4\,r\,x-8\,x^2\right )}{24}+\frac {r^3\,\ln \left (x-r-\sqrt {x\,\left (2\,r-x\right )}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________