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

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 15, normalized size of antiderivative = 0.52, number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {1593, 1620} \begin {gather*} -x+\frac {1}{x}+\log (x)-\log (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x^(-1) - x + Log[x] - 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 1620

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

x^(-1) - x + Log[x] - Log[1 + x]

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 21, normalized size = 0.72 \begin {gather*} -\frac {x^{2} + x \log \left (x + 1\right ) - x \log \relax (x) - 1}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.15, size = 17, normalized size = 0.59 \begin {gather*} -x + \frac {1}{x} - \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-x^2-1)/(x^3+x^2),x, algorithm="giac")

[Out]

-x + 1/x - log(abs(x + 1)) + log(abs(x))

________________________________________________________________________________________

maple [A]  time = 0.08, size = 16, normalized size = 0.55




method result size



default \(-x +\ln \relax (x )+\frac {1}{x}-\ln \left (x +1\right )\) \(16\)
meijerg \(-x +\ln \relax (x )+\frac {1}{x}-\ln \left (x +1\right )\) \(16\)
risch \(-x +\ln \relax (x )+\frac {1}{x}-\ln \left (x +1\right )\) \(16\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x+ln(x)+1/x-ln(x+1)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + 1/x - log(x + 1) + log(x)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 15, normalized size = 0.52 \begin {gather*} \frac {1}{x}-2\,\mathrm {atanh}\left (2\,x+1\right )-x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/x - 2*atanh(2*x + 1) - x

________________________________________________________________________________________

sympy [A]  time = 0.08, size = 12, normalized size = 0.41 \begin {gather*} - x + \log {\relax (x )} - \log {\left (x + 1 \right )} + \frac {1}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x + log(x) - log(x + 1) + 1/x

________________________________________________________________________________________