Optimal. Leaf size=87 \[ -\frac {2 \sqrt {x} \sqrt {-\left (a^2+1\right ) x+a^2+x^2} \tan ^{-1}\left (\frac {(1-a) \sqrt {x}}{\sqrt {-\left (a^2+1\right ) x+a^2+x^2}}\right )}{(1-a) \sqrt {-\left (a^2+1\right ) x^2+a^2 x+x^3}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.87, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2056, 6733, 1698, 205} \[ -\frac {2 \sqrt {x} \sqrt {-\left (a^2+1\right ) x+a^2+x^2} \tan ^{-1}\left (\frac {(1-a) \sqrt {x}}{\sqrt {-\left (a^2+1\right ) x+a^2+x^2}}\right )}{(1-a) \sqrt {-\left (a^2+1\right ) x^2+a^2 x+x^3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 1698
Rule 2056
Rule 6733
Rubi steps
\begin {align*} \int \frac {a+x}{(-a+x) \sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}} \, dx &=\frac {\left (\sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \int \frac {a+x}{\sqrt {x} (-a+x) \sqrt {a^2-\left (1+a^2\right ) x+x^2}} \, dx}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=\frac {\left (2 \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \operatorname {Subst}\left (\int \frac {a+x^2}{\left (-a+x^2\right ) \sqrt {a^2+\left (-1-a^2\right ) x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=\frac {\left (2 a \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{-a-\left (-2 a^2-a \left (-1-a^2\right )\right ) x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt {a^2-\left (1+a^2\right ) x+x^2}}\right )}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=-\frac {2 \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2} \tan ^{-1}\left (\frac {(1-a) \sqrt {x}}{\sqrt {a^2-\left (1+a^2\right ) x+x^2}}\right )}{(1-a) \sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.93, size = 159, normalized size = 1.83 \[ -\frac {2 i \left (a^2-x\right )^{3/2} \sqrt {\frac {x-1}{x-a^2}} \sqrt {\frac {x}{x-a^2}} \left ((a+1) \operatorname {EllipticF}\left (i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right ),1-\frac {1}{a^2}\right )-2 \Pi \left (\frac {a-1}{a};i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right )|1-\frac {1}{a^2}\right )\right )}{(a-1) \sqrt {-a^2} \sqrt {(x-1) x \left (x-a^2\right )}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.70, size = 85, normalized size = 0.98 \[ \frac {\arctan \left (\frac {\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a^{2} - 2 \, {\left (a^{2} - a + 1\right )} x + x^{2}\right )}}{2 \, {\left ({\left (a - 1\right )} x^{3} - {\left (a^{3} - a^{2} + a - 1\right )} x^{2} + {\left (a^{3} - a^{2}\right )} x\right )}}\right )}{a - 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int -\frac {a + x}{\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a - x\right )}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.04, size = 206, normalized size = 2.37 \[ -\frac {4 \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {x -1}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, a^{3} \EllipticPi \left (\sqrt {-\frac {-a^{2}+x}{a^{2}}}, \frac {a^{2}}{a^{2}-a}, \sqrt {\frac {a^{2}}{a^{2}-1}}\right )}{\sqrt {-a^{2} x^{2}+a^{2} x +x^{3}-x^{2}}\, \left (a^{2}-a \right )}-\frac {2 \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {x -1}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, a^{2} \EllipticF \left (\sqrt {-\frac {-a^{2}+x}{a^{2}}}, \sqrt {\frac {a^{2}}{a^{2}-1}}\right )}{\sqrt {-a^{2} x^{2}+a^{2} x +x^{3}-x^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ -\int \frac {a + x}{\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a - x\right )}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.17, size = 217, normalized size = 2.49 \[ \frac {4\,a\,\left (a^2-1\right )\,\sqrt {\frac {x}{a^2}}\,\sqrt {\frac {x-1}{a^2-1}}\,\sqrt {-\frac {x-a^2}{a^2-1}}\,\Pi \left (-\frac {a^2-1}{a-a^2};\mathrm {asin}\left (\sqrt {-\frac {x-a^2}{a^2-1}}\right )\middle |\frac {a^2-1}{a^2}\right )}{\left (a-a^2\right )\,\sqrt {a^2\,x-x^2\,\left (a^2+1\right )+x^3}}-\frac {2\,\left (a^2-1\right )\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-\frac {x-a^2}{a^2-1}}\right )\middle |\frac {a^2-1}{a^2}\right )\,\sqrt {\frac {x}{a^2}}\,\sqrt {\frac {x-1}{a^2-1}}\,\sqrt {-\frac {x-a^2}{a^2-1}}}{\sqrt {a^2\,x-x^2\,\left (a^2+1\right )+x^3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + x}{\sqrt {x \left (- a^{2} + x\right ) \left (x - 1\right )} \left (- a + x\right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________