\(\int \frac {1}{x \sqrt [3]{(-1+x) (q-2 q x+x^2)}} \, dx\) [2635]
Optimal result
Integrand size = 21, antiderivative size = 233 \[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=-\frac {\sqrt {3} \arctan \left (\frac {\sqrt {3} \sqrt [3]{-q+3 q x+(-1-2 q) x^2+x^3}}{-2 \sqrt [3]{q}+2 \sqrt [3]{q} x+\sqrt [3]{-q+3 q x+(-1-2 q) x^2+x^3}}\right )}{2 \sqrt [3]{q}}-\frac {\log \left (\sqrt [3]{q}-\sqrt [3]{q} x+\sqrt [3]{-q+3 q x+(-1-2 q) x^2+x^3}\right )}{2 \sqrt [3]{q}}+\frac {\log \left (q^{2/3}-2 q^{2/3} x+q^{2/3} x^2+\left (-\sqrt [3]{q}+\sqrt [3]{q} x\right ) \sqrt [3]{-q+3 q x+(-1-2 q) x^2+x^3}+\left (-q+3 q x+(-1-2 q) x^2+x^3\right )^{2/3}\right )}{4 \sqrt [3]{q}}
\]
[Out]
-1/2*3^(1/2)*arctan(3^(1/2)*(-q+3*q*x+(-1-2*q)*x^2+x^3)^(1/3)/(-2*q^(1/3)+2*q^(1/3)*x+(-q+3*q*x+(-1-2*q)*x^2+x
^3)^(1/3)))/q^(1/3)-1/2*ln(q^(1/3)-q^(1/3)*x+(-q+3*q*x+(-1-2*q)*x^2+x^3)^(1/3))/q^(1/3)+1/4*ln(q^(2/3)-2*q^(2/
3)*x+q^(2/3)*x^2+(-q^(1/3)+q^(1/3)*x)*(-q+3*q*x+(-1-2*q)*x^2+x^3)^(1/3)+(-q+3*q*x+(-1-2*q)*x^2+x^3)^(2/3))/q^(
1/3)
Rubi [F]
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx
\]
[In]
Int[1/(x*((-1 + x)*(q - 2*q*x + x^2))^(1/3)),x]
[Out]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)) + x^2
)^(1/3)), x], x, (-1 - 2*q)/3 + x])/(3*(-q + 3*q*x + (-1 - 2*q)*x^2 + x^3)^(1/3))
Rubi steps \begin{align*}
\text {integral}& = \text {Subst}\left (\int \frac {1}{\left (\frac {1}{3} (1+2 q)+x\right ) \sqrt [3]{-\frac {2}{27} (1-q)^2 (1+8 q)-\frac {1}{3} (1-4 q) (1-q) x+x^3}} \, dx,x,\frac {1}{3} (-1-2 q)+x\right ) \\ & = \frac {\left (\sqrt [3]{-1-2 q-\frac {1-5 q+4 q^2+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {-(-1+q)^3 q}\right )^{2/3}}{\sqrt [3]{1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {-(-1+q)^3 q}}}+3 x} \sqrt [3]{-1+5 q-4 q^2+\frac {(1-4 q)^2 (1-q)^2}{\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}}+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}+9 \left (\frac {1}{3} (-1-2 q)+x\right )^2+\frac {\left (1-5 q+4 q^2+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}\right ) (-1-2 q+3 x)}{\sqrt [3]{1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}}}}\right ) \text {Subst}\left (\int \frac {1}{\left (\frac {1}{3} (1+2 q)+x\right ) \sqrt [3]{-\frac {1-5 q+4 q^2+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}}{3 \sqrt [3]{1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}}}+x} \sqrt [3]{\frac {1}{9} \left (-1+5 q-4 q^2+\frac {(1-4 q)^2 (1-q)^2}{\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}}+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}\right )+\frac {\left (1-5 q+4 q^2+\left (1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}\right )^{2/3}\right ) x}{3 \sqrt [3]{1+6 q-15 q^2+8 q^3+3 \sqrt {3} \sqrt {(1-q)^3 q}}}+x^2}} \, dx,x,\frac {1}{3} (-1-2 q)+x\right )}{3 \sqrt [3]{-q+3 q x-(1+2 q) x^2+x^3}} \\
\end{align*}
Mathematica [A] (verified)
Time = 2.21 (sec) , antiderivative size = 189, normalized size of antiderivative = 0.81
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\frac {\sqrt [3]{-1+x} \sqrt [3]{q-2 q x+x^2} \left (2 \sqrt {3} \arctan \left (\frac {\sqrt {3} \sqrt [3]{q} (-1+x)^{2/3}}{\sqrt [3]{q} (-1+x)^{2/3}+2 \sqrt [3]{q-2 q x+x^2}}\right )-2 \log \left (-\sqrt [3]{q} (-1+x)^{2/3}+\sqrt [3]{q-2 q x+x^2}\right )+\log \left (q^{2/3} (-1+x)^{4/3}+\sqrt [3]{q} (-1+x)^{2/3} \sqrt [3]{q-2 q x+x^2}+\left (q-2 q x+x^2\right )^{2/3}\right )\right )}{4 \sqrt [3]{q} \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}}
\]
[In]
Integrate[1/(x*((-1 + x)*(q - 2*q*x + x^2))^(1/3)),x]
[Out]
((-1 + x)^(1/3)*(q - 2*q*x + x^2)^(1/3)*(2*Sqrt[3]*ArcTan[(Sqrt[3]*q^(1/3)*(-1 + x)^(2/3))/(q^(1/3)*(-1 + x)^(
2/3) + 2*(q - 2*q*x + x^2)^(1/3))] - 2*Log[-(q^(1/3)*(-1 + x)^(2/3)) + (q - 2*q*x + x^2)^(1/3)] + Log[q^(2/3)*
(-1 + x)^(4/3) + q^(1/3)*(-1 + x)^(2/3)*(q - 2*q*x + x^2)^(1/3) + (q - 2*q*x + x^2)^(2/3)]))/(4*q^(1/3)*((-1 +
x)*(q - 2*q*x + x^2))^(1/3))
Maple [F]
\[\int \frac {1}{x {\left (\left (-1+x \right ) \left (-2 q x +x^{2}+q \right )\right )}^{\frac {1}{3}}}d x\]
[In]
int(1/x/((-1+x)*(-2*q*x+x^2+q))^(1/3),x)
[Out]
int(1/x/((-1+x)*(-2*q*x+x^2+q))^(1/3),x)
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 661 vs. \(2 (194) = 388\).
Time = 14.40 (sec) , antiderivative size = 1496, normalized size of antiderivative = 6.42
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\text {Too large to display}
\]
[In]
integrate(1/x/((-1+x)*(-2*q*x+x^2+q))^(1/3),x, algorithm="fricas")
[Out]
[1/12*(sqrt(3)*q*sqrt((-q)^(1/3)/q)*log(-((q^3 - 30*q^2 - 51*q - 1)*x^6 + 54*(q^3 + 6*q^2 + 2*q)*x^5 - 27*(17*
q^3 + 26*q^2 + 2*q)*x^4 + 486*q^3*x + 540*(2*q^3 + q^2)*x^3 - 81*q^3 - 135*(8*q^3 + q^2)*x^2 + 9*((2*q^2 - q -
1)*x^4 - 6*(q^2 - q)*x^3 + 3*(q^2 - q)*x^2)*(-(2*q + 1)*x^2 + x^3 + 3*q*x - q)^(2/3)*(-q)^(1/3) + 9*((q^2 + 7
*q + 1)*x^5 - (19*q^2 + 25*q + 1)*x^4 + 9*(7*q^2 + 3*q)*x^3 + 45*q^2*x - 9*(9*q^2 + q)*x^2 - 9*q^2)*(-(2*q + 1
)*x^2 + x^3 + 3*q*x - q)^(1/3)*(-q)^(2/3) + sqrt(3)*(3*((4*q^2 + 13*q + 1)*x^4 - 6*(7*q^2 + 5*q)*x^3 - 72*q^2*
x + 3*(31*q^2 + 5*q)*x^2 + 18*q^2)*(-(2*q + 1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 - 9*q^3 - 9*(9*q^3 + q^2)*x^2)*(-(2*q + 1)*x^2 +
x^3 + 3*q*x - q)^(1/3) - ((q^3 - 12*q^2 - 15*q - 1)*x^6 + 18*(q^3 + 6*q^2 + 2*q)*x^5 - 9*(17*q^3 + 26*q^2 + 2
*q)*x^4 + 162*q^3*x + 180*(2*q^3 + q^2)*x^3 - 27*q^3 - 45*(8*q^3 + q^2)*x^2)*(-q)^(1/3))*sqrt(-(-q)^(1/3)/q)/(
(q^3 + 24*q^2 + 3*q - 1)*x^6 - 54*(q^3 + 2*q^2)*x^5 + 81*(3*q^3 + 2*q^2)*x^4 - 162*q^3*x - 108*(4*q^3 + q^2)*x
^3 + 27*q^3 + 27*(14*q^3 + q^2)*x^2)) - 2*(-q)^(2/3)*log(((-q)^(2/3)*(q - 1)*x^2 + 3*(-(2*q + 1)*x^2 + x^3 + 3
*q*x - q)^(1/3)*(q*x - q)*(-q)^(1/3) + 3*(-(2*q + 1)*x^2 + x^3 + 3*q*x - q)^(2/3)*q)/x^2) + (-q)^(2/3)*log((3*
((2*q + 1)*x^2 - 6*q*x + 3*q)*(-(2*q + 1)*x^2 + x^3 + 3*q*x - q)^(2/3)*(-q)^(2/3) + 3*((q^2 + 2*q)*x^3 + 9*q^2
*x - (7*q^2 + 2*q)*x^2 - 3*q^2)*(-(2*q + 1)*x^2 + x^3 + 3*q*x - q)^(1/3) - ((q^2 + 7*q + 1)*x^4 - 18*(q^2 + q)
*x^3 - 36*q^2*x + 9*(5*q^2 + q)*x^2 + 9*q^2)*(-q)^(1/3))/x^4))/q]
Sympy [F]
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\int \frac {1}{x \sqrt [3]{\left (x - 1\right ) \left (- 2 q x + q + x^{2}\right )}}\, dx
\]
[In]
integrate(1/x/((-1+x)*(-2*q*x+x**2+q))**(1/3),x)
[Out]
Integral(1/(x*((x - 1)*(-2*q*x + q + x**2))**(1/3)), x)
Maxima [F]
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\int { \frac {1}{\left (-{\left (2 \, q x - x^{2} - q\right )} {\left (x - 1\right )}\right )^{\frac {1}{3}} x} \,d x }
\]
[In]
integrate(1/x/((-1+x)*(-2*q*x+x^2+q))^(1/3),x, algorithm="maxima")
[Out]
integrate(1/((-(2*q*x - x^2 - q)*(x - 1))^(1/3)*x), x)
Giac [F]
\[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\int { \frac {1}{\left (-{\left (2 \, q x - x^{2} - q\right )} {\left (x - 1\right )}\right )^{\frac {1}{3}} x} \,d x }
\]
[In]
integrate(1/x/((-1+x)*(-2*q*x+x^2+q))^(1/3),x, algorithm="giac")
[Out]
integrate(1/((-(2*q*x - x^2 - q)*(x - 1))^(1/3)*x), x)
Mupad [F(-1)]
Timed out. \[
\int \frac {1}{x \sqrt [3]{(-1+x) \left (q-2 q x+x^2\right )}} \, dx=\int \frac {1}{x\,{\left (\left (x-1\right )\,\left (x^2-2\,q\,x+q\right )\right )}^{1/3}} \,d x
\]
[In]
int(1/(x*((x - 1)*(q - 2*q*x + x^2))^(1/3)),x)
[Out]
int(1/(x*((x - 1)*(q - 2*q*x + x^2))^(1/3)), x)