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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0163615, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {1593, 772} \[ \frac{x^3}{3}+\frac{x^2}{2}+2 x+2 \log (1-x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 772

Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegr
and[(d + e*x)^m*(f + g*x)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IGtQ[p, 0]

Rubi steps

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

Mathematica [A]  time = 0.0042414, size = 25, normalized size = 0.96 \[ \frac{1}{6} \left (2 x^3+3 x^2+12 x+12 \log (x-1)-17\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 21, normalized size = 0.8 \begin{align*}{\frac{{x}^{3}}{3}}+{\frac{{x}^{2}}{2}}+2\,x+2\,\ln \left ( -1+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.919088, size = 27, normalized size = 1.04 \begin{align*} \frac{1}{3} \, x^{3} + \frac{1}{2} \, x^{2} + 2 \, x + 2 \, \log \left (x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.04059, size = 54, normalized size = 2.08 \begin{align*} \frac{1}{3} \, x^{3} + \frac{1}{2} \, x^{2} + 2 \, x + 2 \, \log \left (x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.06815, size = 19, normalized size = 0.73 \begin{align*} \frac{x^{3}}{3} + \frac{x^{2}}{2} + 2 x + 2 \log{\left (x - 1 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.04923, size = 28, normalized size = 1.08 \begin{align*} \frac{1}{3} \, x^{3} + \frac{1}{2} \, x^{2} + 2 \, x + 2 \, \log \left ({\left | x - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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