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

   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 = 15, antiderivative size = 12 \[ \int \frac {-3+x+x^2}{(-3+x) x^2} \, dx=-\frac {1}{x}+\log (3-x) \]

[Out]

-1/x+ln(3-x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {907} \[ \int \frac {-3+x+x^2}{(-3+x) x^2} \, dx=\log (3-x)-\frac {1}{x} \]

[In]

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

[Out]

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

Rule 907

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.79 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.92

method result size
default \(\ln \left (-3+x \right )-\frac {1}{x}\) \(11\)
norman \(\ln \left (-3+x \right )-\frac {1}{x}\) \(11\)
risch \(\ln \left (-3+x \right )-\frac {1}{x}\) \(11\)
meijerg \(\ln \left (1-\frac {x}{3}\right )-\frac {1}{x}\) \(13\)
parallelrisch \(\frac {\ln \left (-3+x \right ) x -1}{x}\) \(13\)

[In]

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

[Out]

ln(-3+x)-1/x

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

log(x - 3) - 1/x

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

-1/x + log(x - 3)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int \frac {-3+x+x^2}{(-3+x) x^2} \, dx=\ln \left (x-3\right )-\frac {1}{x} \]

[In]

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

[Out]

log(x - 3) - 1/x