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

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, 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.100, Rules used = {1607, 1816} \[ \int \frac {1+2 x^2+x^5}{-x+x^3} \, dx=\frac {x^3}{3}+x+2 \log (1-x)-\log (x)+\log (x+1) \]

[In]

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

[Out]

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

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]

Rule 1816

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \frac {1+2 x^2+x^5}{-x+x^3} \, dx=x+\frac {x^3}{3}+2 \log (1-x)-\log (x)+\log (1+x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.80 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
default \(\frac {x^{3}}{3}+x -\ln \left (x \right )+\ln \left (x +1\right )+2 \ln \left (x -1\right )\) \(22\)
norman \(\frac {x^{3}}{3}+x -\ln \left (x \right )+\ln \left (x +1\right )+2 \ln \left (x -1\right )\) \(22\)
risch \(\frac {x^{3}}{3}+x -\ln \left (x \right )+\ln \left (x +1\right )+2 \ln \left (x -1\right )\) \(22\)
parallelrisch \(\frac {x^{3}}{3}+x -\ln \left (x \right )+\ln \left (x +1\right )+2 \ln \left (x -1\right )\) \(22\)
meijerg \(\frac {3 \ln \left (-x^{2}+1\right )}{2}-\ln \left (x \right )-\frac {i \pi }{2}+\frac {i \left (-\frac {2 i x \left (5 x^{2}+15\right )}{15}+2 i \operatorname {arctanh}\left (x \right )\right )}{2}\) \(40\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.75 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.20 \[ \int \frac {1+2 x^2+x^5}{-x+x^3} \, dx=x+2\,\ln \left (x-1\right )+\frac {x^3}{3}+\mathrm {atan}\left (\frac {48{}\mathrm {i}}{11\,\left (22\,x-2\right )}+\frac {13}{11}{}\mathrm {i}\right )\,2{}\mathrm {i} \]

[In]

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

[Out]

x + 2*log(x - 1) + atan(48i/(11*(22*x - 2)) + 13i/11)*2i + x^3/3