### 3.309 $$\int \frac{1+x^3}{-x^2+x^3} \, dx$$

Optimal. Leaf size=17 $x+\frac{1}{x}+2 \log (1-x)-\log (x)$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0292751, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 17, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.118, Rules used = {1593, 1620} $x+\frac{1}{x}+2 \log (1-x)-\log (x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x^(-1) + x + 2*Log[1 - x] - Log[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{align*} \int \frac{1+x^3}{-x^2+x^3} \, dx &=\int \frac{1+x^3}{(-1+x) x^2} \, dx\\ &=\int \left (1+\frac{2}{-1+x}-\frac{1}{x^2}-\frac{1}{x}\right ) \, dx\\ &=\frac{1}{x}+x+2 \log (1-x)-\log (x)\\ \end{align*}

Mathematica [A]  time = 0.0038988, size = 17, normalized size = 1. $x+\frac{1}{x}+2 \log (1-x)-\log (x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 16, normalized size = 0.9 \begin{align*} x+{x}^{-1}-\ln \left ( x \right ) +2\,\ln \left ( -1+x \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.936249, size = 20, normalized size = 1.18 \begin{align*} x + \frac{1}{x} + 2 \, \log \left (x - 1\right ) - \log \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.14304, size = 55, normalized size = 3.24 \begin{align*} \frac{x^{2} + 2 \, x \log \left (x - 1\right ) - x \log \left (x\right ) + 1}{x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.097483, size = 14, normalized size = 0.82 \begin{align*} x - \log{\left (x \right )} + 2 \log{\left (x - 1 \right )} + \frac{1}{x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05698, size = 23, normalized size = 1.35 \begin{align*} x + \frac{1}{x} + 2 \, \log \left ({\left | x - 1 \right |}\right ) - \log \left ({\left | x \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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