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

Optimal. Leaf size=12 \[ \frac {1}{x}+3 \log (1-x) \]

[Out]

1/x+3*ln(1-x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {1593, 893} \[ \frac {1}{x}+3 \log (1-x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^(-1) + 3*Log[1 - x]

Rule 893

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 12, normalized size = 1.00 \[ \frac {1}{x}+3 \log (1-x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^(-1) + 3*Log[1 - x]

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 13, normalized size = 1.08 \[ \frac {3 \, x \log \left (x - 1\right ) + 1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.38, size = 11, normalized size = 0.92 \[ \frac {1}{x} + 3 \, \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/x + 3*log(abs(x - 1))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 11, normalized size = 0.92 \[ 3 \ln \left (x -1\right )+\frac {1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*ln(x-1)+1/x

________________________________________________________________________________________

maxima [A]  time = 0.71, size = 10, normalized size = 0.83 \[ \frac {1}{x} + 3 \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 10, normalized size = 0.83 \[ 3\,\ln \left (x-1\right )+\frac {1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 8, normalized size = 0.67 \[ 3 \log {\left (x - 1 \right )} + \frac {1}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________