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

Optimal. Leaf size=21 \[ \frac {x^2}{2}+\frac {1}{2} \log \left (x^2+1\right )-3 x \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {1810, 260} \[ \frac {x^2}{2}+\frac {1}{2} \log \left (x^2+1\right )-3 x \]

Antiderivative was successfully verified.

[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 260

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 1810

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

Antiderivative was successfully verified.

[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

________________________________________________________________________________________

fricas [A]  time = 0.82, size = 17, normalized size = 0.81 \[ \frac {1}{2} \, x^{2} - 3 \, x + \frac {1}{2} \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

giac [A]  time = 0.27, size = 17, normalized size = 0.81 \[ \frac {1}{2} \, x^{2} - 3 \, x + \frac {1}{2} \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 2.28, size = 17, normalized size = 0.81 \[ \frac {1}{2} \, x^{2} - 3 \, x + \frac {1}{2} \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 17, normalized size = 0.81 \[ \frac {\ln \left (x^2+1\right )}{2}-3\,x+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

sympy [A]  time = 0.08, size = 15, normalized size = 0.71 \[ \frac {x^{2}}{2} - 3 x + \frac {\log {\left (x^{2} + 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________