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

Optimal. Leaf size=25 \[ \frac {x^2}{2}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {1593, 1620} \[ \frac {x^2}{2}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \]

Antiderivative was successfully verified.

[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 1593

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 1620

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*} \int \frac {-1-x-x^3+x^4}{-x^2+x^3} \, dx &=\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]  time = 0.01, size = 25, normalized size = 1.00 \[ \frac {x^2}{2}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \]

Antiderivative was successfully verified.

[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]

________________________________________________________________________________________

fricas [A]  time = 0.87, size = 22, normalized size = 0.88 \[ \frac {x^{3} - 4 \, x \log \left (x - 1\right ) + 4 \, x \log \relax (x) - 2}{2 \, x} \]

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

giac [A]  time = 0.27, size = 23, normalized size = 0.92 \[ \frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left ({\left | x - 1 \right |}\right ) + 2 \, \log \left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[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))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 22, normalized size = 0.88 \[ \frac {x^{2}}{2}+2 \ln \relax (x )-2 \ln \left (x -1\right )-\frac {1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.13, size = 21, normalized size = 0.84 \[ \frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left (x - 1\right ) + 2 \, \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

mupad [B]  time = 2.14, size = 19, normalized size = 0.76 \[ 4\,\mathrm {atanh}\left (2\,x-1\right )-\frac {1}{x}+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 19, normalized size = 0.76 \[ \frac {x^{2}}{2} + 2 \log {\relax (x )} - 2 \log {\left (x - 1 \right )} - \frac {1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________