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} \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, 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 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]

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 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 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]

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.02, 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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {-1+x^{-1+n}}{-n x+x^n} \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.12, size = 13, normalized size = 1.00 \[ \frac {\log \left (-n x + x^{n}\right )}{n} \]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int -\frac {x^{n - 1} - 1}{n x - x^{n}}\,{d x} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.30, size = 14, normalized size = 1.08




method result size



risch \(\frac {\ln \left (-n x +x^{n}\right )}{n}\) \(14\)
norman \(\frac {\ln \left (n x -{\mathrm e}^{n \ln \relax (x )}\right )}{n}\) \(17\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 14, normalized size = 1.08 \[ \frac {\log \left (n x - x^{n}\right )}{n} \]

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

________________________________________________________________________________________

mupad [B]  time = 0.32, size = 14, normalized size = 1.08 \[ \frac {\ln \left (n\,x-x^n\right )}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________