Optimal. Leaf size=46 \[ \log \left (\frac {-a^2+2 a x+x^2-2 \left (x+\sqrt {(1-x) x \left (a^2+x-2 a x\right )}\right )}{(a-x)^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 0.96, antiderivative size = 180, normalized size of antiderivative = 3.91, number of steps
used = 7, number of rules used = 7, integrand size = 51, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.137, Rules used = {2081, 6865,
1724, 1118, 430, 1234, 551} \begin {gather*} \frac {4 (1-a) \sqrt {1-x} \sqrt {x} \sqrt {\frac {(1-2 a) x}{a^2}+1} \Pi \left (\frac {1}{a};\text {ArcSin}\left (\sqrt {x}\right )|-\frac {1-2 a}{a^2}\right )}{\sqrt {\left (-a^2-2 a+1\right ) x^2+a^2 x-\left ((1-2 a) x^3\right )}}-\frac {2 (1-2 a) \sqrt {1-x} \sqrt {x} \sqrt {\frac {(1-2 a) x}{a^2}+1} F\left (\text {ArcSin}\left (\sqrt {x}\right )|-\frac {1-2 a}{a^2}\right )}{\sqrt {\left (-a^2-2 a+1\right ) x^2+a^2 x-\left ((1-2 a) x^3\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 430
Rule 551
Rule 1118
Rule 1234
Rule 1724
Rule 2081
Rule 6865
Rubi steps
\begin {align*} \int \frac {-a+(-1+2 a) x}{(-a+x) \sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}} \, dx &=\frac {\left (\sqrt {x} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \int \frac {-a+(-1+2 a) x}{\sqrt {x} (-a+x) \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}} \, dx}{\sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}\\ &=\frac {\left (2 \sqrt {x} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \text {Subst}\left (\int \frac {-a+(-1+2 a) x^2}{\left (-a+x^2\right ) \sqrt {a^2+\left (1-2 a-a^2\right ) x^2+(-1+2 a) x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}\\ &=-\frac {\left (4 (1-a) a \sqrt {x} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (-a+x^2\right ) \sqrt {a^2+\left (1-2 a-a^2\right ) x^2+(-1+2 a) x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}+\frac {\left (2 (-1+2 a) \sqrt {x} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+\left (1-2 a-a^2\right ) x^2+(-1+2 a) x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}\\ &=-\frac {\left (4 (1-a) a \sqrt {1-x} \sqrt {x} \sqrt {1+\frac {(1-2 a) x}{a^2}} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \text {Subst}\left (\int \frac {1}{\left (-a+x^2\right ) \sqrt {1+\frac {2 (-1+2 a) x^2}{1-(-1+a)^2-2 a-a^2}} \sqrt {1+\frac {2 (-1+2 a) x^2}{1+(-1+a)^2-2 a-a^2}}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2+\left (1-2 a-a^2\right ) x+(-1+2 a) x^2} \sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}+\frac {\left (2 (-1+2 a) \sqrt {1-x} \sqrt {x} \sqrt {1+\frac {(1-2 a) x}{a^2}} \sqrt {a^2-\left (-1+2 a+a^2\right ) x+(-1+2 a) x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {2 (-1+2 a) x^2}{1-(-1+a)^2-2 a-a^2}} \sqrt {1+\frac {2 (-1+2 a) x^2}{1+(-1+a)^2-2 a-a^2}}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2+\left (1-2 a-a^2\right ) x+(-1+2 a) x^2} \sqrt {a^2 x-\left (-1+2 a+a^2\right ) x^2+(-1+2 a) x^3}}\\ &=-\frac {2 (1-2 a) \sqrt {1-x} \sqrt {x} \sqrt {1+\frac {(1-2 a) x}{a^2}} F\left (\sin ^{-1}\left (\sqrt {x}\right )|-\frac {1-2 a}{a^2}\right )}{\sqrt {a^2 x+\left (1-2 a-a^2\right ) x^2-(1-2 a) x^3}}+\frac {4 (1-a) \sqrt {1-x} \sqrt {x} \sqrt {1+\frac {(1-2 a) x}{a^2}} \Pi \left (\frac {1}{a};\sin ^{-1}\left (\sqrt {x}\right )|-\frac {1-2 a}{a^2}\right )}{\sqrt {a^2 x+\left (1-2 a-a^2\right ) x^2-(1-2 a) x^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 20.77, size = 133, normalized size = 2.89 \begin {gather*} \frac {2 i (-1+x)^{3/2} \sqrt {\frac {x}{-1+x}} \sqrt {-\frac {a^2+x-2 a x}{(-1+2 a) (-1+x)}} \left (-F\left (i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|-\frac {(-1+a)^2}{-1+2 a}\right )+2 a \Pi \left (1-a;i \sinh ^{-1}\left (\frac {1}{\sqrt {-1+x}}\right )|-\frac {(-1+a)^2}{-1+2 a}\right )\right )}{\sqrt {-\left ((-1+x) x \left (a^2+x-2 a x\right )\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 = 536, normalized size = 11.65
method | result | size |
elliptic | \(-\frac {2 a^{2} \sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}\, \sqrt {\frac {-1+x}{\frac {a^{2}}{-1+2 a}-1}}\, \sqrt {\frac {x \left (-1+2 a \right )}{a^{2}}}\, \EllipticF \left (\sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}, \sqrt {\frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-1\right )}}\right )}{\sqrt {-a^{2} x^{2}+2 a \,x^{3}+a^{2} x -2 a \,x^{2}-x^{3}+x^{2}}}-\frac {4 a^{3} \left (a -1\right ) \sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}\, \sqrt {\frac {-1+x}{\frac {a^{2}}{-1+2 a}-1}}\, \sqrt {\frac {x \left (-1+2 a \right )}{a^{2}}}\, \EllipticPi \left (\sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}, \frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-a \right )}, \sqrt {\frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-1\right )}}\right )}{\left (-1+2 a \right ) \sqrt {-a^{2} x^{2}+2 a \,x^{3}+a^{2} x -2 a \,x^{2}-x^{3}+x^{2}}\, \left (\frac {a^{2}}{-1+2 a}-a \right )}\) | \(367\) |
default | \(-\frac {4 a^{3} \sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}\, \sqrt {\frac {-1+x}{\frac {a^{2}}{-1+2 a}-1}}\, \sqrt {\frac {x \left (-1+2 a \right )}{a^{2}}}\, \EllipticF \left (\sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}, \sqrt {\frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-1\right )}}\right )}{\left (-1+2 a \right ) \sqrt {-a^{2} x^{2}+2 a \,x^{3}+a^{2} x -2 a \,x^{2}-x^{3}+x^{2}}}+\frac {2 a^{2} \sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}\, \sqrt {\frac {-1+x}{\frac {a^{2}}{-1+2 a}-1}}\, \sqrt {\frac {x \left (-1+2 a \right )}{a^{2}}}\, \EllipticF \left (\sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}, \sqrt {\frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-1\right )}}\right )}{\left (-1+2 a \right ) \sqrt {-a^{2} x^{2}+2 a \,x^{3}+a^{2} x -2 a \,x^{2}-x^{3}+x^{2}}}-\frac {4 a^{3} \left (a -1\right ) \sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}\, \sqrt {\frac {-1+x}{\frac {a^{2}}{-1+2 a}-1}}\, \sqrt {\frac {x \left (-1+2 a \right )}{a^{2}}}\, \EllipticPi \left (\sqrt {-\frac {\left (x -\frac {a^{2}}{-1+2 a}\right ) \left (-1+2 a \right )}{a^{2}}}, \frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-a \right )}, \sqrt {\frac {a^{2}}{\left (-1+2 a \right ) \left (\frac {a^{2}}{-1+2 a}-1\right )}}\right )}{\left (-1+2 a \right ) \sqrt {-a^{2} x^{2}+2 a \,x^{3}+a^{2} x -2 a \,x^{2}-x^{3}+x^{2}}\, \left (\frac {a^{2}}{-1+2 a}-a \right )}\) | \(536\) |
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 = 0.70, size = 63, normalized size = 1.37 \begin {gather*} \log \left (-\frac {a^{2} - 2 \, {\left (a - 1\right )} x - x^{2} + 2 \, \sqrt {{\left (2 \, a - 1\right )} x^{3} + a^{2} x - {\left (a^{2} + 2 \, a - 1\right )} x^{2}}}{a^{2} - 2 \, a x + x^{2}}\right ) \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 {2 a x - a - x}{\sqrt {x \left (x - 1\right ) \left (- a^{2} + 2 a x - x\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 [F(-1)]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________