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.873863, antiderivative size = 87, normalized size of antiderivative = 1., 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 2056
Rule 6733
Rule 1698
Rule 205
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.915921, 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) \text{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]
________________________________________________________________________________________
Maple [C] time = 0.034, size = 206, normalized size = 2.4 \begin{align*} -2\,{\frac{{a}^{2}}{\sqrt{-{a}^{2}{x}^{2}+{a}^{2}x+{x}^{3}-{x}^{2}}}\sqrt{-{\frac{-{a}^{2}+x}{{a}^{2}}}}\sqrt{{\frac{-1+x}{{a}^{2}-1}}}\sqrt{{\frac{x}{{a}^{2}}}}{\it EllipticF} \left ( \sqrt{-{\frac{-{a}^{2}+x}{{a}^{2}}}},\sqrt{{\frac{{a}^{2}}{{a}^{2}-1}}} \right ) }-4\,{\frac{{a}^{3}}{\sqrt{-{a}^{2}{x}^{2}+{a}^{2}x+{x}^{3}-{x}^{2}} \left ({a}^{2}-a \right ) }\sqrt{-{\frac{-{a}^{2}+x}{{a}^{2}}}}\sqrt{{\frac{-1+x}{{a}^{2}-1}}}\sqrt{{\frac{x}{{a}^{2}}}}{\it EllipticPi} \left ( \sqrt{-{\frac{-{a}^{2}+x}{{a}^{2}}}},{\frac{{a}^{2}}{{a}^{2}-a}},\sqrt{{\frac{{a}^{2}}{{a}^{2}-1}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} -\int \frac{a + x}{\sqrt{a^{2} x -{\left (a^{2} + 1\right )} x^{2} + x^{3}}{\left (a - x\right )}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.35953, size = 193, normalized size = 2.22 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{a + x}{\sqrt{x \left (- a^{2} + x\right ) \left (x - 1\right )} \left (- a + x\right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{a + x}{\sqrt{a^{2} x -{\left (a^{2} + 1\right )} x^{2} + x^{3}}{\left (a - x\right )}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]