Optimal. Leaf size=79 \[ \frac {1}{2} \sqrt {3} \tan ^{-1}\left (\frac {1}{\sqrt {3}}+\frac {2 (-1+x)}{\sqrt {3} \sqrt [3]{(-1+x) \left (q-2 x+x^2\right )}}\right )+\frac {1}{4} \log (1-x)-\frac {3}{4} \log \left (1-x+\sqrt [3]{(-1+x) \left (q-2 x+x^2\right )}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 145, normalized size of antiderivative = 1.84, number of steps
used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {2092, 2036,
335, 281, 245} \begin {gather*} \frac {\sqrt {3} \sqrt [3]{x-1} \sqrt [3]{q+(x-1)^2-1} \text {ArcTan}\left (\frac {\frac {2 (x-1)^{2/3}}{\sqrt [3]{q+(x-1)^2-1}}+1}{\sqrt {3}}\right )}{2 \sqrt [3]{(x-1)^3-(1-q) (x-1)}}-\frac {3 \sqrt [3]{x-1} \sqrt [3]{q+(x-1)^2-1} \log \left ((x-1)^{2/3}-\sqrt [3]{q+(x-1)^2-1}\right )}{4 \sqrt [3]{(x-1)^3-(1-q) (x-1)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 245
Rule 281
Rule 335
Rule 2036
Rule 2092
Rubi steps
\begin {align*} \int \frac {1}{\sqrt [3]{(-1+x) \left (q-2 x+x^2\right )}} \, dx &=\text {Subst}\left (\int \frac {1}{\sqrt [3]{-(1-q) x+x^3}} \, dx,x,-1+x\right )\\ &=\frac {\left (\sqrt [3]{-1+q+(-1+x)^2} \sqrt [3]{-1+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt [3]{x} \sqrt [3]{-1+q+x^2}} \, dx,x,-1+x\right )}{\sqrt [3]{(-1+q) (-1+x)+(-1+x)^3}}\\ &=\frac {\left (3 \sqrt [3]{-1+q+(-1+x)^2} \sqrt [3]{-1+x}\right ) \text {Subst}\left (\int \frac {x}{\sqrt [3]{-1+q+x^6}} \, dx,x,\sqrt [3]{-1+x}\right )}{\sqrt [3]{(-1+q) (-1+x)+(-1+x)^3}}\\ &=\frac {\left (3 \sqrt [3]{-1+q+(-1+x)^2} \sqrt [3]{-1+x}\right ) \text {Subst}\left (\int \frac {1}{\sqrt [3]{-1+q+x^3}} \, dx,x,(-1+x)^{2/3}\right )}{2 \sqrt [3]{(-1+q) (-1+x)+(-1+x)^3}}\\ &=\frac {\sqrt {3} \sqrt [3]{-1+q+(-1+x)^2} \sqrt [3]{-1+x} \tan ^{-1}\left (\frac {1+\frac {2 (-1+x)^{2/3}}{\sqrt [3]{q-(2-x) x}}}{\sqrt {3}}\right )}{2 \sqrt [3]{(1-q) (1-x)+(-1+x)^3}}-\frac {3 \sqrt [3]{-1+q+(-1+x)^2} \sqrt [3]{-1+x} \log \left ((-1+x)^{2/3}-\sqrt [3]{q-(2-x) x}\right )}{4 \sqrt [3]{(1-q) (1-x)+(-1+x)^3}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.73, size = 145, normalized size = 1.84 \begin {gather*} \frac {\sqrt [3]{-1+x} \sqrt [3]{q+(-2+x) x} \left (2 \sqrt {3} \tan ^{-1}\left (\frac {\sqrt {3} (-1+x)^{2/3}}{(-1+x)^{2/3}+2 \sqrt [3]{q+(-2+x) x}}\right )-2 \log \left (-(-1+x)^{2/3}+\sqrt [3]{q+(-2+x) x}\right )+\log \left ((-1+x)^{4/3}+(-1+x)^{2/3} \sqrt [3]{q+(-2+x) x}+(q+(-2+x) x)^{2/3}\right )\right )}{4 \sqrt [3]{(-1+x) (q+(-2+x) x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.00, size = 0, normalized size = 0.00 \[\int \frac {1}{\left (\left (-1+x \right ) \left (x^{2}+q -2 x \right )\right )^{\frac {1}{3}}}\, dx\]
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 [B] Leaf count of result is larger than twice the leaf count of optimal. 665 vs.
\(2 (65) = 130\).
time = 1.42, size = 665, normalized size = 8.42 \begin {gather*} \frac {1}{2} \, \sqrt {3} \arctan \left (\frac {2 \, \sqrt {3} {\left (q^{12} - 18 \, q^{11} + 117 \, q^{10} - 346 \, q^{9} + 414 \, q^{8} - 18 \, q^{7} + 69 \, q^{6} - 774 \, q^{5} - 234 \, q^{4} + 1058 \, q^{3} + 621 \, q^{2} + 378 \, q - 539\right )} {\left (x^{3} + {\left (q + 2\right )} x - 3 \, x^{2} - q\right )}^{\frac {2}{3}} + 4 \, \sqrt {3} {\left (q^{12} - 12 \, q^{11} + 51 \, q^{10} - 70 \, q^{9} - 90 \, q^{8} + 288 \, q^{7} - 57 \, q^{6} + 54 \, q^{5} - 810 \, q^{4} + 320 \, q^{3} + 291 \, q^{2} - {\left (q^{12} - 12 \, q^{11} + 51 \, q^{10} - 70 \, q^{9} - 90 \, q^{8} + 288 \, q^{7} - 57 \, q^{6} + 54 \, q^{5} - 810 \, q^{4} + 320 \, q^{3} + 291 \, q^{2} + 714 \, q + 49\right )} x + 714 \, q + 49\right )} {\left (x^{3} + {\left (q + 2\right )} x - 3 \, x^{2} - q\right )}^{\frac {1}{3}} - \sqrt {3} {\left (q^{13} - 22 \, q^{12} + 177 \, q^{11} - 514 \, q^{10} - 434 \, q^{9} + 5346 \, q^{8} - 8247 \, q^{7} - 4542 \, q^{6} + 19638 \, q^{5} - 8050 \, q^{4} - 10343 \, q^{3} + {\left (q^{12} - 6 \, q^{11} - 15 \, q^{10} + 206 \, q^{9} - 594 \, q^{8} + 594 \, q^{7} - 183 \, q^{6} + 882 \, q^{5} - 1386 \, q^{4} - 418 \, q^{3} - 39 \, q^{2} + 1050 \, q + 637\right )} x^{2} + 6186 \, q^{2} - 2 \, {\left (q^{12} - 6 \, q^{11} - 15 \, q^{10} + 206 \, q^{9} - 594 \, q^{8} + 594 \, q^{7} - 183 \, q^{6} + 882 \, q^{5} - 1386 \, q^{4} - 418 \, q^{3} - 39 \, q^{2} + 1050 \, q + 637\right )} x + 1501 \, q + 32\right )}}{q^{13} - 22 \, q^{12} + 249 \, q^{11} - 1546 \, q^{10} + 4702 \, q^{9} - 4230 \, q^{8} - 10623 \, q^{7} + 25338 \, q^{6} - 3546 \, q^{5} - 31306 \, q^{4} + 18817 \, q^{3} + 9 \, {\left (q^{12} - 14 \, q^{11} + 73 \, q^{10} - 162 \, q^{9} + 78 \, q^{8} + 186 \, q^{7} - 15 \, q^{6} - 222 \, q^{5} - 618 \, q^{4} + 566 \, q^{3} + 401 \, q^{2} + 602 \, q - 147\right )} x^{2} + 9714 \, q^{2} - 18 \, {\left (q^{12} - 14 \, q^{11} + 73 \, q^{10} - 162 \, q^{9} + 78 \, q^{8} + 186 \, q^{7} - 15 \, q^{6} - 222 \, q^{5} - 618 \, q^{4} + 566 \, q^{3} + 401 \, q^{2} + 602 \, q - 147\right )} x - 995 \, q + 8}\right ) - \frac {1}{4} \, \log \left (3 \, {\left (x^{3} + {\left (q + 2\right )} x - 3 \, x^{2} - q\right )}^{\frac {1}{3}} {\left (x - 1\right )} + q - 3 \, {\left (x^{3} + {\left (q + 2\right )} x - 3 \, x^{2} - q\right )}^{\frac {2}{3}} - 1\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 {1}{\sqrt [3]{\left (x - 1\right ) \left (q + x^{2} - 2 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]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{{\left (\left (x-1\right )\,\left (x^2-2\,x+q\right )\right )}^{1/3}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________