Optimal. Leaf size=71 \[ -\frac {1}{4} (a+b-2 x) \sqrt {-a b+(a+b) x-x^2}-\frac {1}{8} (a-b)^2 \tan ^{-1}\left (\frac {a+b-2 x}{2 \sqrt {-a b+(a+b) x-x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {1976, 626, 635,
210} \begin {gather*} -\frac {1}{8} (a-b)^2 \text {ArcTan}\left (\frac {a+b-2 x}{2 \sqrt {x (a+b)-a b-x^2}}\right )-\frac {1}{4} (a+b-2 x) \sqrt {x (a+b)-a b-x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 626
Rule 635
Rule 1976
Rubi steps
\begin {align*} \int \sqrt {(b-x) (-a+x)} \, dx &=\int \sqrt {-a b+(a+b) x-x^2} \, dx\\ &=-\frac {1}{4} (a+b-2 x) \sqrt {-a b+(a+b) x-x^2}+\frac {1}{8} (a-b)^2 \int \frac {1}{\sqrt {-a b+(a+b) x-x^2}} \, dx\\ &=-\frac {1}{4} (a+b-2 x) \sqrt {-a b+(a+b) x-x^2}+\frac {1}{4} (a-b)^2 \text {Subst}\left (\int \frac {1}{-4-x^2} \, dx,x,\frac {a+b-2 x}{\sqrt {-a b+(a+b) x-x^2}}\right )\\ &=-\frac {1}{4} (a+b-2 x) \sqrt {-a b+(a+b) x-x^2}-\frac {1}{8} (a-b)^2 \tan ^{-1}\left (\frac {a+b-2 x}{2 \sqrt {-a b+(a+b) x-x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 76, normalized size = 1.07 \begin {gather*} \frac {1}{4} \sqrt {(a-x) (-b+x)} \left (-a-b+2 x-\frac {(a-b)^2 \tan ^{-1}\left (\frac {\sqrt {b-x}}{\sqrt {-a+x}}\right )}{\sqrt {b-x} \sqrt {-a+x}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 68, normalized size = 0.96
method | result | size |
default | \(-\frac {\left (a +b -2 x \right ) \sqrt {-a b +\left (a +b \right ) x -x^{2}}}{4}-\frac {\left (4 a b -\left (a +b \right )^{2}\right ) \arctan \left (\frac {x -\frac {a}{2}-\frac {b}{2}}{\sqrt {-a b +\left (a +b \right ) x -x^{2}}}\right )}{8}\) | \(68\) |
risch | \(\frac {\left (b -x \right ) \left (a -x \right ) \left (a +b -2 x \right )}{4 \sqrt {-\left (-b +x \right ) \left (-a +x \right )}}-\frac {\arctan \left (\frac {x -\frac {a}{2}-\frac {b}{2}}{\sqrt {-a b +\left (a +b \right ) x -x^{2}}}\right ) a b}{4}+\frac {\arctan \left (\frac {x -\frac {a}{2}-\frac {b}{2}}{\sqrt {-a b +\left (a +b \right ) x -x^{2}}}\right ) a^{2}}{8}+\frac {\arctan \left (\frac {x -\frac {a}{2}-\frac {b}{2}}{\sqrt {-a b +\left (a +b \right ) x -x^{2}}}\right ) b^{2}}{8}\) | \(129\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 80, normalized size = 1.13 \begin {gather*} -\frac {1}{8} \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \arctan \left (-\frac {\sqrt {-a b + {\left (a + b\right )} x - x^{2}} {\left (a + b - 2 \, x\right )}}{2 \, {\left (a b - {\left (a + b\right )} x + x^{2}\right )}}\right ) - \frac {1}{4} \, \sqrt {-a b + {\left (a + b\right )} x - x^{2}} {\left (a + b - 2 \, x\right )} \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 \sqrt {\left (- a + x\right ) \left (b - x\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.45, size = 61, normalized size = 0.86 \begin {gather*} \frac {1}{8} \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \arcsin \left (\frac {a + b - 2 \, x}{a - b}\right ) \mathrm {sgn}\left (-a + b\right ) - \frac {1}{4} \, \sqrt {-a b + a x + b x - x^{2}} {\left (a + b - 2 \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sqrt {-\left (a-x\right )\,\left (b-x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________