\(\int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx\) [269]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 25 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=-\frac {1}{x}+\frac {x^2}{2}-2 \log (1-x)+2 \log (x) \]

[Out]

-1/x+1/2*x^2-2*ln(1-x)+2*ln(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {1607, 1634} \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=\frac {x^2}{2}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \]

[In]

Int[(-1 - x - x^3 + x^4)/(-x^2 + x^3),x]

[Out]

-x^(-1) + x^2/2 - 2*Log[1 - x] + 2*Log[x]

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1634

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-1-x-x^3+x^4}{(-1+x) x^2} \, dx \\ & = \int \left (-\frac {2}{-1+x}+\frac {1}{x^2}+\frac {2}{x}+x\right ) \, dx \\ & = -\frac {1}{x}+\frac {x^2}{2}-2 \log (1-x)+2 \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=-\frac {1}{x}+\frac {x^2}{2}-2 \log (1-x)+2 \log (x) \]

[In]

Integrate[(-1 - x - x^3 + x^4)/(-x^2 + x^3),x]

[Out]

-x^(-1) + x^2/2 - 2*Log[1 - x] + 2*Log[x]

Maple [A] (verified)

Time = 0.83 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
default \(\frac {x^{2}}{2}-\frac {1}{x}+2 \ln \left (x \right )-2 \ln \left (x -1\right )\) \(22\)
risch \(\frac {x^{2}}{2}-\frac {1}{x}+2 \ln \left (x \right )-2 \ln \left (x -1\right )\) \(22\)
norman \(\frac {-1+\frac {x^{3}}{2}}{x}+2 \ln \left (x \right )-2 \ln \left (x -1\right )\) \(23\)
parallelrisch \(\frac {x^{3}+4 \ln \left (x \right ) x -4 \ln \left (x -1\right ) x -2}{2 x}\) \(23\)
meijerg \(2 \ln \left (x \right )+2 i \pi -\frac {1}{x}+\frac {x \left (6+3 x \right )}{6}-x -2 \ln \left (1-x \right )\) \(34\)

[In]

int((x^4-x^3-x-1)/(x^3-x^2),x,method=_RETURNVERBOSE)

[Out]

1/2*x^2-1/x+2*ln(x)-2*ln(x-1)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=\frac {x^{3} - 4 \, x \log \left (x - 1\right ) + 4 \, x \log \left (x\right ) - 2}{2 \, x} \]

[In]

integrate((x^4-x^3-x-1)/(x^3-x^2),x, algorithm="fricas")

[Out]

1/2*(x^3 - 4*x*log(x - 1) + 4*x*log(x) - 2)/x

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.76 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=\frac {x^{2}}{2} + 2 \log {\left (x \right )} - 2 \log {\left (x - 1 \right )} - \frac {1}{x} \]

[In]

integrate((x**4-x**3-x-1)/(x**3-x**2),x)

[Out]

x**2/2 + 2*log(x) - 2*log(x - 1) - 1/x

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=\frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left (x - 1\right ) + 2 \, \log \left (x\right ) \]

[In]

integrate((x^4-x^3-x-1)/(x^3-x^2),x, algorithm="maxima")

[Out]

1/2*x^2 - 1/x - 2*log(x - 1) + 2*log(x)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.92 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=\frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left ({\left | x - 1 \right |}\right ) + 2 \, \log \left ({\left | x \right |}\right ) \]

[In]

integrate((x^4-x^3-x-1)/(x^3-x^2),x, algorithm="giac")

[Out]

1/2*x^2 - 1/x - 2*log(abs(x - 1)) + 2*log(abs(x))

Mupad [B] (verification not implemented)

Time = 9.33 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.76 \[ \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx=4\,\mathrm {atanh}\left (2\,x-1\right )-\frac {1}{x}+\frac {x^2}{2} \]

[In]

int((x + x^3 - x^4 + 1)/(x^2 - x^3),x)

[Out]

4*atanh(2*x - 1) - 1/x + x^2/2