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

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {1824, 266} \[ \int \frac {-3+2 x-3 x^2+x^3}{1+x^2} \, dx=\frac {x^2}{2}+\frac {1}{2} \log \left (x^2+1\right )-3 x \]

[In]

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

[Out]

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

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 1824

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a,
b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.78 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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