Optimal. Leaf size=87 \[ -\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}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.54, 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 = {2081, 6865,
1712, 211} \begin {gather*} -\frac {2 \sqrt {x} \sqrt {-\left (a^2+1\right ) x+a^2+x^2} \text {ArcTan}\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}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 1712
Rule 2081
Rule 6865
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 ) \text {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 ) \text {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] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 18.69, size = 159, normalized size = 1.83 \begin {gather*} -\frac {2 i \left (a^2-x\right )^{3/2} \sqrt {\frac {-1+x}{-a^2+x}} \sqrt {\frac {x}{-a^2+x}} \left ((1+a) F\left (i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right )|1-\frac {1}{a^2}\right )-2 \Pi \left (\frac {-1+a}{a};i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right )|1-\frac {1}{a^2}\right )\right )}{(-1+a) \sqrt {-a^2} \sqrt {(-1+x) x \left (-a^2+x\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.10, size = 206, normalized size = 2.37
method | result | size |
default | \(-\frac {2 a^{2} \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {-1+x}{a^{2}-1}}\, \sqrt {\frac {x}{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}}}-\frac {4 a^{3} \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {-1+x}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, \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 )}\) | \(206\) |
elliptic | \(-\frac {2 a^{2} \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {-1+x}{a^{2}-1}}\, \sqrt {\frac {x}{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}}}-\frac {4 a^{3} \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {-1+x}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, \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 )}\) | \(206\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.22, size = 85, normalized size = 0.98 \begin {gather*} \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} \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 \frac {a + x}{\sqrt {x \left (- a^{2} + x\right ) \left (x - 1\right )} \left (- a + x\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.17, size = 217, normalized size = 2.49 \begin {gather*} \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}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________