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

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 26, 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.182, Rules used = {1607, 786} \[ \int \frac {x+x^3}{-1+x} \, dx=\frac {x^3}{3}+\frac {x^2}{2}+2 x+2 \log (1-x) \]

[In]

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

[Out]

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

Rule 786

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]

Rule 1607

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]

Rubi steps \begin{align*} \text {integral}& = \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] (verified)

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

[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] (verified)

Time = 0.79 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.81

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[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] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

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

Giac [A] (verification not implemented)

none

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

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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