3.612 \(\int \frac {x^{-n} (a+b n x^{-1+n})}{b+a x^{1-n}} \, dx\)

Optimal. Leaf size=17 \[ \log \left (a x^{1-n}+b\right )+n \log (x) \]

[Out]

n*ln(x)+ln(b+a*x^(1-n))

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {514, 446, 72} \[ \log \left (a x^{1-n}+b\right )+n \log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

n*Log[x] + Log[b + a*x^(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]

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 17, normalized size = 1.00 \[ \log \left (a x^{1-n}+b\right )+n \log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 10, normalized size = 0.59 \[ \log \left (a x + b x^{n}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(a*x + b*x^n)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {b n x^{n - 1} + a}{{\left (a x^{-n + 1} + b\right )} x^{n}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((b*n*x^(n - 1) + a)/((a*x^(-n + 1) + b)*x^n), x)

________________________________________________________________________________________

maple [A]  time = 0.03, size = 13, normalized size = 0.76 \[ \ln \left (a x +b \,{\mathrm e}^{n \ln \relax (x )}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(a*x+b*exp(n*ln(x)))

________________________________________________________________________________________

maxima [B]  time = 0.95, size = 86, normalized size = 5.06 \[ b n {\left (\frac {\log \relax (x)}{b} - \frac {n \log \relax (x)}{b {\left (n - 1\right )}} + \frac {\log \left (\frac {a x + b x^{n}}{b}\right )}{b {\left (n - 1\right )}}\right )} + a {\left (\frac {n \log \relax (x)}{a {\left (n - 1\right )}} - \frac {\log \left (\frac {a x + b x^{n}}{b}\right )}{a {\left (n - 1\right )}}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

b*n*(log(x)/b - n*log(x)/(b*(n - 1)) + log((a*x + b*x^n)/b)/(b*(n - 1))) + a*(n*log(x)/(a*(n - 1)) - log((a*x
+ b*x^n)/b)/(a*(n - 1)))

________________________________________________________________________________________

mupad [B]  time = 3.37, size = 39, normalized size = 2.29 \[ -\frac {\ln \left (b+a\,x^{1-n}\right )-2\,n\,\mathrm {atanh}\left (\frac {2\,a\,x^{1-n}}{b}+1\right )}{n-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(log(b + a*x^(1 - n)) - 2*n*atanh((2*a*x^(1 - n))/b + 1))/(n - 1)

________________________________________________________________________________________

sympy [A]  time = 53.07, size = 8, normalized size = 0.47 \[ \log {\left (a x + b x^{n} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(a*x + b*x**n)

________________________________________________________________________________________