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

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {1593, 1802} \begin {gather*} x-\log (1-x)+\log (x)+2 \log (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - Log[1 - x] + Log[x] + 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 1802

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 {gather*} \begin {aligned} \text {integral} &=\int \frac {-1-4 x+2 x^2+x^3}{x \left (-1+x^2\right )} \, dx\\ &=\int \left (1+\frac {1}{1-x}+\frac {1}{x}+\frac {2}{1+x}\right ) \, dx\\ &=x-\log (1-x)+\log (x)+2 \log (1+x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 18, normalized size = 1.00 \begin {gather*} x-\log (1-x)+\log (x)+2 \log (1+x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - Log[1 - x] + Log[x] + 2*Log[1 + x]

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 16, normalized size = 0.89 \begin {gather*} x + 2 \, \log \left (x + 1\right ) - \log \left (x - 1\right ) + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.20, size = 19, normalized size = 1.06 \begin {gather*} x + 2 \, \log \left ({\left | x + 1 \right |}\right ) - \log \left ({\left | x - 1 \right |}\right ) + \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 2*log(abs(x + 1)) - log(abs(x - 1)) + log(abs(x))

________________________________________________________________________________________

maple [A]  time = 0.44, size = 17, normalized size = 0.94




method result size



default \(x +\ln \relax (x )-\ln \left (x -1\right )+2 \ln \left (x +1\right )\) \(17\)
norman \(x +\ln \relax (x )-\ln \left (x -1\right )+2 \ln \left (x +1\right )\) \(17\)
risch \(x +\ln \relax (x )-\ln \left (x -1\right )+2 \ln \left (x +1\right )\) \(17\)
meijerg \(\ln \relax (x )+\frac {i \pi }{2}+\frac {\ln \left (-x^{2}+1\right )}{2}-\frac {i \left (2 i x -2 i \arctanh \relax (x )\right )}{2}+4 \arctanh \relax (x )\) \(35\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x+ln(x)-ln(x-1)+2*ln(x+1)

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 16, normalized size = 0.89 \begin {gather*} x + 2 \, \log \left (x + 1\right ) - \log \left (x - 1\right ) + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 7.17, size = 22, normalized size = 1.22 \begin {gather*} x+2\,\ln \left (x+1\right )-2\,\mathrm {atanh}\left (\frac {48}{2\,x+6}-7\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 2*log(x + 1) - 2*atanh(48/(2*x + 6) - 7)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 15, normalized size = 0.83 \begin {gather*} x + \log {\relax (x )} - \log {\left (x - 1 \right )} + 2 \log {\left (x + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________