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

Optimal. Leaf size=22 \[ \frac{x^3}{3}+x^2+4 x+9 \log (2-x) \]

[Out]

4*x + x^2 + x^3/3 + 9*Log[2 - x]

________________________________________________________________________________________

Rubi [A]  time = 0.0145268, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {1850} \[ \frac{x^3}{3}+x^2+4 x+9 \log (2-x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

4*x + x^2 + x^3/3 + 9*Log[2 - x]

Rule 1850

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

Rubi steps

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

Mathematica [A]  time = 0.0039672, size = 23, normalized size = 1.05 \[ \frac{x^3}{3}+x^2+4 x+9 \log (x-2)-\frac{44}{3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-44/3 + 4*x + x^2 + x^3/3 + 9*Log[-2 + x]

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 19, normalized size = 0.9 \begin{align*}{\frac{{x}^{3}}{3}}+{x}^{2}+4\,x+9\,\ln \left ( -2+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.984447, size = 24, normalized size = 1.09 \begin{align*} \frac{1}{3} \, x^{3} + x^{2} + 4 \, x + 9 \, \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.36932, size = 49, normalized size = 2.23 \begin{align*} \frac{1}{3} \, x^{3} + x^{2} + 4 \, x + 9 \, \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.070757, size = 17, normalized size = 0.77 \begin{align*} \frac{x^{3}}{3} + x^{2} + 4 x + 9 \log{\left (x - 2 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**3/3 + x**2 + 4*x + 9*log(x - 2)

________________________________________________________________________________________

Giac [A]  time = 1.1229, size = 26, normalized size = 1.18 \begin{align*} \frac{1}{3} \, x^{3} + x^{2} + 4 \, x + 9 \, \log \left ({\left | x - 2 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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