3.9.29 \(\int \frac {a+b x^{-1+n}}{c x+d x^n} \, dx\) [829]

Optimal. Leaf size=43 \[ \frac {b \log (x)}{d}-\frac {(b c-a d) \log \left (d+c x^{1-n}\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.05, 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 = {1607, 528, 457, 78} \begin {gather*} \frac {b \log (x)}{d}-\frac {(b c-a d) \log \left (c x^{1-n}+d\right )}{c d (1-n)} \end {gather*}

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 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

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 528

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 1607

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 {\text {Subst}\left (\int \frac {b+a x}{x (d+c x)} \, dx,x,x^{1-n}\right )}{1-n}\\ &=\frac {\text {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.12, size = 38, normalized size = 0.88 \begin {gather*} \frac {b \log (x)+\frac {(b c-a d) \log \left (d+c x^{1-n}\right )}{c (-1+n)}}{d} \end {gather*}

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

________________________________________________________________________________________

Maple [A]
time = 0.55, size = 58, normalized size = 1.35

method result size
norman \(\frac {\left (a d n -b c \right ) \ln \left (x \right )}{c d \left (-1+n \right )}-\frac {\left (a d -b c \right ) \ln \left (c x +d \,{\mathrm e}^{n \ln \left (x \right )}\right )}{c d \left (-1+n \right )}\) \(58\)
risch \(\frac {b \ln \left (x \right )}{d}+\frac {n \ln \left (x \right ) a}{c \left (-1+n \right )}-\frac {n \ln \left (x \right ) b}{d \left (-1+n \right )}-\frac {\ln \left (x^{n}+\frac {x c}{d}\right ) a}{c \left (-1+n \right )}+\frac {\ln \left (x^{n}+\frac {x c}{d}\right ) b}{d \left (-1+n \right )}\) \(79\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (40) = 80\).
time = 0.29, size = 85, normalized size = 1.98 \begin {gather*} b {\left (\frac {\log \left (x\right )}{d} - \frac {n \log \left (x\right )}{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 \left (x\right )}{c {\left (n - 1\right )}} - \frac {\log \left (\frac {c x + d x^{n}}{d}\right )}{c {\left (n - 1\right )}}\right )} \end {gather*}

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

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 44, normalized size = 1.02 \begin {gather*} \frac {{\left (b c - a d\right )} \log \left (c x + d x^{n}\right ) + {\left (a d n - b c\right )} \log \left (x\right )}{c d n - c d} \end {gather*}

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)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 216 vs. \(2 (29) = 58\).
time = 1.95, size = 216, normalized size = 5.02 \begin {gather*} \begin {cases} \tilde {\infty } \left (a + b\right ) \log {\left (x \right )} & \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 x^{n} \log {\left (x^{- n} \right )}}{n^{2} x^{n} - n x^{n}} - \frac {b n x^{n}}{n^{2} x^{n} - n x^{n}} + \frac {b x^{n} \log {\left (x^{- n} \right )}}{n^{2} x^{n} - n x^{n}}}{d} & \text {for}\: c = 0 \\\frac {\frac {a n x \log {\left (x \right )}}{n x - x} - \frac {a x \log {\left (x \right )}}{n x - x} + \frac {b x^{n}}{n x - x}}{c} & \text {for}\: d = 0 \\\frac {\left (a + b\right ) \log {\left (x \right )}}{c + d} & \text {for}\: n = 1 \\\frac {a d n \log {\left (x \right )}}{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 {\left (x \right )}}{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} \end {gather*}

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*x**n*log(x
**(-n))/(n**2*x**n - n*x**n) - b*n*x**n/(n**2*x**n - n*x**n) + b*x**n*log(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), Eq(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*log(x + d*x**n/c)/(c*d*n - c*d), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________