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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0106617, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {893} \[ \log (3-x)-\frac{1}{x} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-x^(-1) + Log[3 - 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]))

Rubi steps

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

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 11, normalized size = 0.9 \begin{align*} \ln \left ( -3+x \right ) -{x}^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(-3+x)-1/x

________________________________________________________________________________________

Maxima [A]  time = 0.98342, size = 14, normalized size = 1.17 \begin{align*} -\frac{1}{x} + \log \left (x - 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/x + log(x - 3)

________________________________________________________________________________________

Fricas [A]  time = 1.42738, size = 30, normalized size = 2.5 \begin{align*} \frac{x \log \left (x - 3\right ) - 1}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.084146, size = 7, normalized size = 0.58 \begin{align*} \log{\left (x - 3 \right )} - \frac{1}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 3) - 1/x

________________________________________________________________________________________

Giac [A]  time = 1.14268, size = 15, normalized size = 1.25 \begin{align*} -\frac{1}{x} + \log \left ({\left | x - 3 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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