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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {1593, 514, 446, 72} \[ \frac {b \log (x)}{d}-\frac {(b c-a d) \log \left (c x^{1-n}+d\right )}{c d (1-n)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(b*Log[x])/d - ((b*c - a*d)*Log[d + c*x^(1 - n)])/(c*d*(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])

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 {a+b x^{-1+n}}{c x+d x^n} \, dx &=\int \frac {x^{-n} \left (a+b x^{-1+n}\right )}{d+c x^{1-n}} \, dx\\ &=\int \frac {b+a x^{1-n}}{x \left (d+c x^{1-n}\right )} \, dx\\ &=\frac {\operatorname {Subst}\left (\int \frac {b+a x}{x (d+c x)} \, dx,x,x^{1-n}\right )}{1-n}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {b}{d x}+\frac {-b c+a d}{d (d+c x)}\right ) \, dx,x,x^{1-n}\right )}{1-n}\\ &=\frac {b \log (x)}{d}-\frac {(b c-a d) \log \left (d+c x^{1-n}\right )}{c d (1-n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 38, normalized size = 0.88 \[ \frac {\frac {(b c-a d) \log \left (c x^{1-n}+d\right )}{c (n-1)}+b \log (x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 44, normalized size = 1.02 \[ \frac {{\left (b c - a d\right )} \log \left (c x + d x^{n}\right ) + {\left (a d n - b c\right )} \log \relax (x)}{c d n - c d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 73, normalized size = 1.70 \[ \frac {a n \ln \relax (x )}{\left (n -1\right ) c}-\frac {a \ln \left (c x +d \,{\mathrm e}^{n \ln \relax (x )}\right )}{\left (n -1\right ) c}-\frac {b \ln \relax (x )}{\left (n -1\right ) d}+\frac {b \ln \left (c x +d \,{\mathrm e}^{n \ln \relax (x )}\right )}{\left (n -1\right ) d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/c/(n-1)*ln(x)*a*n-1/d/(n-1)*ln(x)*b-1/c/(n-1)*ln(c*x+d*exp(n*ln(x)))*a+1/d/(n-1)*ln(c*x+d*exp(n*ln(x)))*b

________________________________________________________________________________________

maxima [B]  time = 0.45, size = 85, normalized size = 1.98 \[ b {\left (\frac {\log \relax (x)}{d} - \frac {n \log \relax (x)}{d {\left (n - 1\right )}} + \frac {\log \left (\frac {c x + d x^{n}}{d}\right )}{d {\left (n - 1\right )}}\right )} + a {\left (\frac {n \log \relax (x)}{c {\left (n - 1\right )}} - \frac {\log \left (\frac {c x + d x^{n}}{d}\right )}{c {\left (n - 1\right )}}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {a+b\,x^{n-1}}{d\,x^n+c\,x} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 10.18, size = 212, normalized size = 4.93 \[ \begin {cases} \tilde {\infty } \left (a + b\right ) \log {\relax (x )} & \text {for}\: c = 0 \wedge d = 0 \wedge n = 1 \\\frac {- \frac {a n x}{n^{2} x^{n} - n x^{n}} + \frac {b n^{2} x^{n} \log {\relax (x )}}{n^{2} x^{n} - n x^{n}} - \frac {b n x^{n} \log {\relax (x )}}{n^{2} x^{n} - n x^{n}} - \frac {b n x^{n}}{n^{2} x^{n} - n x^{n}}}{d} & \text {for}\: c = 0 \\\frac {\frac {a n x \log {\relax (x )}}{n x - x} - \frac {a x \log {\relax (x )}}{n x - x} + \frac {b x^{n}}{n x - x}}{c} & \text {for}\: d = 0 \\\frac {\left (a + b\right ) \log {\relax (x )}}{c + d} & \text {for}\: n = 1 \\\frac {a d n \log {\relax (x )}}{c d n - c d} - \frac {a d \log {\left (x + \frac {d x^{n}}{c} \right )}}{c d n - c d} - \frac {b c \log {\relax (x )}}{c d n - c d} + \frac {b c \log {\left (x + \frac {d x^{n}}{c} \right )}}{c d n - c d} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo*(a + b)*log(x), Eq(c, 0) & Eq(d, 0) & Eq(n, 1)), ((-a*n*x/(n**2*x**n - n*x**n) + b*n**2*x**n*lo
g(x)/(n**2*x**n - n*x**n) - b*n*x**n*log(x)/(n**2*x**n - n*x**n) - b*n*x**n/(n**2*x**n - n*x**n))/d, Eq(c, 0))
, ((a*n*x*log(x)/(n*x - x) - a*x*log(x)/(n*x - x) + b*x**n/(n*x - x))/c, Eq(d, 0)), ((a + b)*log(x)/(c + d), E
q(n, 1)), (a*d*n*log(x)/(c*d*n - c*d) - a*d*log(x + d*x**n/c)/(c*d*n - c*d) - b*c*log(x)/(c*d*n - c*d) + b*c*l
og(x + d*x**n/c)/(c*d*n - c*d), True))

________________________________________________________________________________________