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

Optimal. Leaf size=25 \[ -\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]
time = 0.02, 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 = {1607, 1634} \begin {gather*} \frac {x^2}{2}-\frac {1}{x}-2 \log (1-x)+2 \log (x) \end {gather*}

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 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*} \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.00, size = 25, normalized size = 1.00 \begin {gather*} -\frac {1}{x}+\frac {x^2}{2}-2 \log (1-x)+2 \log (x) \end {gather*}

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]

________________________________________________________________________________________

Maple [A]
time = 0.23, size = 22, normalized size = 0.88

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 21, normalized size = 0.84 \begin {gather*} \frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left (x - 1\right ) + 2 \, \log \left (x\right ) \end {gather*}

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)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 22, normalized size = 0.88 \begin {gather*} \frac {x^{3} - 4 \, x \log \left (x - 1\right ) + 4 \, x \log \left (x\right ) - 2}{2 \, x} \end {gather*}

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

________________________________________________________________________________________

Sympy [A]
time = 0.03, size = 19, normalized size = 0.76 \begin {gather*} \frac {x^{2}}{2} + 2 \log {\left (x \right )} - 2 \log {\left (x - 1 \right )} - \frac {1}{x} \end {gather*}

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

________________________________________________________________________________________

Giac [A]
time = 2.34, size = 23, normalized size = 0.92 \begin {gather*} \frac {1}{2} \, x^{2} - \frac {1}{x} - 2 \, \log \left ({\left | x - 1 \right |}\right ) + 2 \, \log \left ({\left | x \right |}\right ) \end {gather*}

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

________________________________________________________________________________________

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

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

________________________________________________________________________________________