Optimal. Leaf size=92 \[ \frac{1}{2} (b-x)^2 \sqrt{\frac{x-a}{b-x}}+\frac{1}{4} (a-5 b) (b-x) \sqrt{\frac{x-a}{b-x}}-\frac{1}{4} (a-b) (a+3 b) \tan ^{-1}\left (\sqrt{\frac{x-a}{b-x}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0589155, antiderivative size = 95, normalized size of antiderivative = 1.03, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {1960, 455, 385, 203} \[ \frac{1}{2} (b-x)^2 \sqrt{-\frac{a-x}{b-x}}+\frac{1}{4} (a-5 b) (b-x) \sqrt{-\frac{a-x}{b-x}}-\frac{1}{4} (a-b) (a+3 b) \tan ^{-1}\left (\sqrt{-\frac{a-x}{b-x}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1960
Rule 455
Rule 385
Rule 203
Rubi steps
\begin{align*} \int x \sqrt{\frac{-a+x}{b-x}} \, dx &=-\left ((2 (a-b)) \operatorname{Subst}\left (\int \frac{x^2 \left (a+b x^2\right )}{\left (1+x^2\right )^3} \, dx,x,\sqrt{\frac{-a+x}{b-x}}\right )\right )\\ &=\frac{1}{2} \sqrt{-\frac{a-x}{b-x}} (b-x)^2-\frac{1}{2} (-a+b) \operatorname{Subst}\left (\int \frac{-a+b-4 b x^2}{\left (1+x^2\right )^2} \, dx,x,\sqrt{\frac{-a+x}{b-x}}\right )\\ &=\frac{1}{4} (a-5 b) \sqrt{-\frac{a-x}{b-x}} (b-x)+\frac{1}{2} \sqrt{-\frac{a-x}{b-x}} (b-x)^2-\frac{1}{4} ((a-b) (a+3 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\sqrt{\frac{-a+x}{b-x}}\right )\\ &=\frac{1}{4} (a-5 b) \sqrt{-\frac{a-x}{b-x}} (b-x)+\frac{1}{2} \sqrt{-\frac{a-x}{b-x}} (b-x)^2-\frac{1}{4} (a-b) (a+3 b) \tan ^{-1}\left (\sqrt{-\frac{a-x}{b-x}}\right )\\ \end{align*}
Mathematica [A] time = 0.2566, size = 115, normalized size = 1.25 \[ \frac{\sqrt{\frac{x-a}{b-x}} \left ((b-x) (a-3 b-2 x) \sqrt{\frac{a-x}{a-b}}-\sqrt{a-b} (a+3 b) \sqrt{b-x} \sinh ^{-1}\left (\frac{\sqrt{b-x}}{\sqrt{a-b}}\right )\right )}{4 \sqrt{\frac{a-x}{a-b}}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.019, size = 208, normalized size = 2.3 \begin{align*}{\frac{-b+x}{8}\sqrt{-{\frac{-a+x}{-b+x}}} \left ( \arctan \left ({\frac{-a+2\,x-b}{2}{\frac{1}{\sqrt{-ab+ax+bx-{x}^{2}}}}} \right ){a}^{2}+2\,b\arctan \left ( 1/2\,{\frac{-a+2\,x-b}{\sqrt{-ab+ax+bx-{x}^{2}}}} \right ) a-3\,\arctan \left ( 1/2\,{\frac{-a+2\,x-b}{\sqrt{-ab+ax+bx-{x}^{2}}}} \right ){b}^{2}+4\,\sqrt{-ab+ax+bx-{x}^{2}}x-2\,\sqrt{-ab+ax+bx-{x}^{2}}a+6\,\sqrt{-ab+ax+bx-{x}^{2}}b \right ){\frac{1}{\sqrt{- \left ( -b+x \right ) \left ( -a+x \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.42183, size = 176, normalized size = 1.91 \begin{align*} -\frac{1}{4} \,{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} \arctan \left (\sqrt{-\frac{a - x}{b - x}}\right ) - \frac{{\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} \left (-\frac{a - x}{b - x}\right )^{\frac{3}{2}} -{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} \sqrt{-\frac{a - x}{b - x}}}{4 \,{\left (\frac{{\left (a - x\right )}^{2}}{{\left (b - x\right )}^{2}} - \frac{2 \,{\left (a - x\right )}}{b - x} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.79824, size = 165, normalized size = 1.79 \begin{align*} -\frac{1}{4} \,{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} \arctan \left (\sqrt{-\frac{a - x}{b - x}}\right ) + \frac{1}{4} \,{\left (a b - 3 \, b^{2} -{\left (a - b\right )} x + 2 \, x^{2}\right )} \sqrt{-\frac{a - x}{b - x}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09141, size = 139, normalized size = 1.51 \begin{align*} \frac{1}{8} \,{\left (a^{2} \mathrm{sgn}\left (-b + x\right ) + 2 \, a b \mathrm{sgn}\left (-b + x\right ) - 3 \, b^{2} \mathrm{sgn}\left (-b + x\right )\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 \mathrm{sgn}\left (-b + x\right ) - 3 \, b \mathrm{sgn}\left (-b + x\right ) - 2 \, x \mathrm{sgn}\left (-b + x\right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]