3.154 \(\int \frac{-1+x^{-1+n}}{-n x+x^n} \, dx\)

Optimal. Leaf size=13 \[ \frac{\log \left (x^n-n x\right )}{n} \]

[Out]

Log[-(n*x) + x^n]/n

________________________________________________________________________________________

Rubi [A]  time = 0.0455255, antiderivative size = 20, normalized size of antiderivative = 1.54, number of steps used = 5, number of rules used = 4, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {1593, 514, 446, 72} \[ \frac{\log \left (1-n x^{1-n}\right )}{n}+\log (x) \]

Antiderivative was successfully verified.

[In]

Int[(-1 + x^(-1 + n))/(-(n*x) + x^n),x]

[Out]

Log[x] + Log[1 - n*x^(1 - n)]/n

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 514

Int[(x_)^(m_.)*((c_) + (d_.)*(x_)^(mn_.))^(q_.)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[x^(m - n*q)*
(a + b*x^n)^p*(d + c*x^n)^q, x] /; FreeQ[{a, b, c, d, m, n, p}, x] && EqQ[mn, -n] && IntegerQ[q] && (PosQ[n] |
|  !IntegerQ[p])

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{-1+x^{-1+n}}{-n x+x^n} \, dx &=\int \frac{x^{-n} \left (-1+x^{-1+n}\right )}{1-n x^{1-n}} \, dx\\ &=\int \frac{1-x^{1-n}}{x \left (1-n x^{1-n}\right )} \, dx\\ &=\frac{\operatorname{Subst}\left (\int \frac{1-x}{x (1-n x)} \, dx,x,x^{1-n}\right )}{1-n}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{x}+\frac{1-n}{-1+n x}\right ) \, dx,x,x^{1-n}\right )}{1-n}\\ &=\log (x)+\frac{\log \left (1-n x^{1-n}\right )}{n}\\ \end{align*}

Mathematica [A]  time = 0.0229577, size = 20, normalized size = 1.54 \[ \frac{\log \left (1-n x^{1-n}\right )}{n}+\log (x) \]

Antiderivative was successfully verified.

[In]

Integrate[(-1 + x^(-1 + n))/(-(n*x) + x^n),x]

[Out]

Log[x] + Log[1 - n*x^(1 - n)]/n

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 17, normalized size = 1.3 \begin{align*}{\frac{\ln \left ( nx-{{\rm e}^{n\ln \left ( x \right ) }} \right ) }{n}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1+x^(-1+n))/(-n*x+x^n),x)

[Out]

1/n*ln(n*x-exp(n*ln(x)))

________________________________________________________________________________________

Maxima [A]  time = 0.938639, size = 19, normalized size = 1.46 \begin{align*} \frac{\log \left (n x - x^{n}\right )}{n} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x^(-1+n))/(-n*x+x^n),x, algorithm="maxima")

[Out]

log(n*x - x^n)/n

________________________________________________________________________________________

Fricas [A]  time = 2.22595, size = 26, normalized size = 2. \begin{align*} \frac{\log \left (-n x + x^{n}\right )}{n} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x^(-1+n))/(-n*x+x^n),x, algorithm="fricas")

[Out]

log(-n*x + x^n)/n

________________________________________________________________________________________

Sympy [A]  time = 2.51136, size = 14, normalized size = 1.08 \begin{align*} \begin{cases} \frac{\log{\left (- n x + x^{n} \right )}}{n} & \text{for}\: n \neq 0 \\- x + \log{\left (x \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x**(-1+n))/(-n*x+x**n),x)

[Out]

Piecewise((log(-n*x + x**n)/n, Ne(n, 0)), (-x + log(x), True))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{x^{n - 1} - 1}{n x - x^{n}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x^(-1+n))/(-n*x+x^n),x, algorithm="giac")

[Out]

integrate(-(x^(n - 1) - 1)/(n*x - x^n), x)