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

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

[Out]

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

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 18, 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.059, Rules used = {14} \[ \int \frac {-1+3 x-3 x^2+x^3}{x^2} \, dx=\frac {x^2}{2}-3 x+\frac {1}{x}+3 \log (x) \]

[In]

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

[Out]

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

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.94

method result size
default \(\frac {1}{x}-3 x +\frac {x^{2}}{2}+3 \ln \left (x \right )\) \(17\)
risch \(\frac {1}{x}-3 x +\frac {x^{2}}{2}+3 \ln \left (x \right )\) \(17\)
parallelrisch \(\frac {x^{3}+6 \ln \left (x \right ) x -6 x^{2}+2}{2 x}\) \(21\)
norman \(\frac {1-3 x^{2}+\frac {1}{2} x^{3}}{x}+3 \ln \left (x \right )\) \(22\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

1/2*(x^3 - 6*x^2 + 6*x*log(x) + 2)/x

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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