3.428 \(\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+1/2*x^2+1/3*x^3+2*ln(1-x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 26, normalized size of antiderivative = 1.00, 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 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]

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]

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.00, 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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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)

________________________________________________________________________________________