Optimal. Leaf size=71 \[ -\frac {1}{4} (a+b-2 x) \sqrt {x (a+b)-a b-x^2}-\frac {1}{8} (a-b)^2 \tan ^{-1}\left (\frac {a+b-2 x}{2 \sqrt {x (a+b)-a b-x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, 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 = {1981, 612, 621, 204} \[ -\frac {1}{4} (a+b-2 x) \sqrt {x (a+b)-a b-x^2}-\frac {1}{8} (a-b)^2 \tan ^{-1}\left (\frac {a+b-2 x}{2 \sqrt {x (a+b)-a b-x^2}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 612
Rule 621
Rule 1981
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 \operatorname {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.16, size = 106, normalized size = 1.49 \[ \frac {(a-x) \left ((a-b)^{5/2} \sqrt {b-x} \sqrt {\frac {a-x}{a-b}} \sinh ^{-1}\left (\frac {\sqrt {b-x}}{\sqrt {a-b}}\right )-(a-x) (b-x) (a+b-2 x)\right )}{4 (x-a) \sqrt {(a-x) (x-b)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.91, size = 80, normalized size = 1.13 \[ -\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 )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 61, normalized size = 0.86 \[ \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 )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 122, normalized size = 1.72 \[ \frac {a^{2} \arctan \left (\frac {-\frac {a}{2}-\frac {b}{2}+x}{\sqrt {-a b -x^{2}+\left (a +b \right ) x}}\right )}{8}-\frac {a b \arctan \left (\frac {-\frac {a}{2}-\frac {b}{2}+x}{\sqrt {-a b -x^{2}+\left (a +b \right ) x}}\right )}{4}+\frac {b^{2} \arctan \left (\frac {-\frac {a}{2}-\frac {b}{2}+x}{\sqrt {-a b -x^{2}+\left (a +b \right ) x}}\right )}{8}-\frac {\left (a +b -2 x \right ) \sqrt {-a b -x^{2}+\left (a +b \right ) x}}{4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \sqrt {-\left (a-x\right )\,\left (b-x\right )} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {\left (- a + x\right ) \left (b - x\right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________