\(\int \frac {A+B \log (e (\frac {a+b x}{c+d x})^n)}{(f+g x)^2} \, dx\) [63]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 91 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=\frac {(a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(b f-a g) (f+g x)}+\frac {B (b c-a d) n \log \left (\frac {f+g x}{c+d x}\right )}{(b f-a g) (d f-c g)} \] Output:

(b*x+a)*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/(-a*g+b*f)/(g*x+f)+B*(-a*d+b*c)*n* 
ln((g*x+f)/(d*x+c))/(-a*g+b*f)/(-c*g+d*f)
 

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.20 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=\frac {-\frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{f+g x}+\frac {B n (b (d f-c g) \log (a+b x)+(-b d f+a d g) \log (c+d x)+(b c-a d) g \log (f+g x))}{(b f-a g) (d f-c g)}}{g} \] Input:

Integrate[(A + B*Log[e*((a + b*x)/(c + d*x))^n])/(f + g*x)^2,x]
 

Output:

(-((A + B*Log[e*((a + b*x)/(c + d*x))^n])/(f + g*x)) + (B*n*(b*(d*f - c*g) 
*Log[a + b*x] + (-(b*d*f) + a*d*g)*Log[c + d*x] + (b*c - a*d)*g*Log[f + g* 
x]))/((b*f - a*g)*(d*f - c*g)))/g
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.55, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2953, 2751, 16}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A}{(f+g x)^2} \, dx\)

\(\Big \downarrow \) 2953

\(\displaystyle (b c-a d) \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{\left (b f-a g-\frac {(d f-c g) (a+b x)}{c+d x}\right )^2}d\frac {a+b x}{c+d x}\)

\(\Big \downarrow \) 2751

\(\displaystyle (b c-a d) \left (\frac {(a+b x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{(c+d x) (b f-a g) \left (-\frac {(a+b x) (d f-c g)}{c+d x}-a g+b f\right )}-\frac {B n \int \frac {1}{b f-a g-\frac {(d f-c g) (a+b x)}{c+d x}}d\frac {a+b x}{c+d x}}{b f-a g}\right )\)

\(\Big \downarrow \) 16

\(\displaystyle (b c-a d) \left (\frac {(a+b x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{(c+d x) (b f-a g) \left (-\frac {(a+b x) (d f-c g)}{c+d x}-a g+b f\right )}+\frac {B n \log \left (-\frac {(a+b x) (d f-c g)}{c+d x}-a g+b f\right )}{(b f-a g) (d f-c g)}\right )\)

Input:

Int[(A + B*Log[e*((a + b*x)/(c + d*x))^n])/(f + g*x)^2,x]
 

Output:

(b*c - a*d)*(((a + b*x)*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/((b*f - a* 
g)*(c + d*x)*(b*f - a*g - ((d*f - c*g)*(a + b*x))/(c + d*x))) + (B*n*Log[b 
*f - a*g - ((d*f - c*g)*(a + b*x))/(c + d*x)])/((b*f - a*g)*(d*f - c*g)))
 

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

rule 2751
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x 
_Symbol] :> Simp[x*(d + e*x^r)^(q + 1)*((a + b*Log[c*x^n])/d), x] - Simp[b* 
(n/d)   Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q, r}, 
x] && EqQ[r*(q + 1) + 1, 0]
 

rule 2953
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d)   Sub 
st[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m + 2 
)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n} 
, x] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(363\) vs. \(2(91)=182\).

Time = 2.38 (sec) , antiderivative size = 364, normalized size of antiderivative = 4.00

method result size
parallelrisch \(\frac {-B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} c d f g n +B \ln \left (b x +a \right ) a^{2} c d \,f^{2} n^{2}-B \ln \left (b x +a \right ) a b \,c^{2} f^{2} n^{2}-B \ln \left (g x +f \right ) a^{2} c d \,f^{2} n^{2}+B \ln \left (g x +f \right ) a b \,c^{2} f^{2} n^{2}+B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b c d \,f^{2} n +B \ln \left (b x +a \right ) x \,a^{2} c d f g \,n^{2}-B \ln \left (b x +a \right ) x a b \,c^{2} f g \,n^{2}-B \ln \left (g x +f \right ) x \,a^{2} c d f g \,n^{2}+B \ln \left (g x +f \right ) x a b \,c^{2} f g \,n^{2}+A x \,a^{2} c^{2} g^{2} n -A x \,a^{2} c d f g n -A x a b \,c^{2} f g n +A x a b c d \,f^{2} n -B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} c^{2} f g n +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b \,c^{2} f^{2} n}{\left (a g -b f \right ) \left (g x +f \right ) n \left (c g -d f \right ) a c f}\) \(364\)

Input:

int((A+B*ln(e*((b*x+a)/(d*x+c))^n))/(g*x+f)^2,x,method=_RETURNVERBOSE)
 

Output:

(-B*x*ln(e*((b*x+a)/(d*x+c))^n)*a^2*c*d*f*g*n+B*ln(b*x+a)*a^2*c*d*f^2*n^2- 
B*ln(b*x+a)*a*b*c^2*f^2*n^2-B*ln(g*x+f)*a^2*c*d*f^2*n^2+B*ln(g*x+f)*a*b*c^ 
2*f^2*n^2+B*x*ln(e*((b*x+a)/(d*x+c))^n)*a*b*c*d*f^2*n+B*ln(b*x+a)*x*a^2*c* 
d*f*g*n^2-B*ln(b*x+a)*x*a*b*c^2*f*g*n^2-B*ln(g*x+f)*x*a^2*c*d*f*g*n^2+B*ln 
(g*x+f)*x*a*b*c^2*f*g*n^2+A*x*a^2*c^2*g^2*n-A*x*a^2*c*d*f*g*n-A*x*a*b*c^2* 
f*g*n+A*x*a*b*c*d*f^2*n-B*ln(e*((b*x+a)/(d*x+c))^n)*a^2*c^2*f*g*n+B*ln(e*( 
(b*x+a)/(d*x+c))^n)*a*b*c^2*f^2*n)/(a*g-b*f)/(g*x+f)/n/(c*g-d*f)/a/c/f
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 294 vs. \(2 (91) = 182\).

Time = 2.81 (sec) , antiderivative size = 294, normalized size of antiderivative = 3.23 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=-\frac {A b d f^{2} + A a c g^{2} - {\left (A b c + A a d\right )} f g + {\left (B b d f^{2} + B a c g^{2} - {\left (B b c + B a d\right )} f g\right )} n \log \left (\frac {b x + a}{d x + c}\right ) - {\left ({\left (B b d f g - B b c g^{2}\right )} n x + {\left (B b d f^{2} - B b c f g\right )} n\right )} \log \left (b x + a\right ) + {\left ({\left (B b d f g - B a d g^{2}\right )} n x + {\left (B b d f^{2} - B a d f g\right )} n\right )} \log \left (d x + c\right ) - {\left ({\left (B b c - B a d\right )} g^{2} n x + {\left (B b c - B a d\right )} f g n\right )} \log \left (g x + f\right ) + {\left (B b d f^{2} + B a c g^{2} - {\left (B b c + B a d\right )} f g\right )} \log \left (e\right )}{b d f^{3} g + a c f g^{3} - {\left (b c + a d\right )} f^{2} g^{2} + {\left (b d f^{2} g^{2} + a c g^{4} - {\left (b c + a d\right )} f g^{3}\right )} x} \] Input:

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))/(g*x+f)^2,x, algorithm="fricas" 
)
 

Output:

-(A*b*d*f^2 + A*a*c*g^2 - (A*b*c + A*a*d)*f*g + (B*b*d*f^2 + B*a*c*g^2 - ( 
B*b*c + B*a*d)*f*g)*n*log((b*x + a)/(d*x + c)) - ((B*b*d*f*g - B*b*c*g^2)* 
n*x + (B*b*d*f^2 - B*b*c*f*g)*n)*log(b*x + a) + ((B*b*d*f*g - B*a*d*g^2)*n 
*x + (B*b*d*f^2 - B*a*d*f*g)*n)*log(d*x + c) - ((B*b*c - B*a*d)*g^2*n*x + 
(B*b*c - B*a*d)*f*g*n)*log(g*x + f) + (B*b*d*f^2 + B*a*c*g^2 - (B*b*c + B* 
a*d)*f*g)*log(e))/(b*d*f^3*g + a*c*f*g^3 - (b*c + a*d)*f^2*g^2 + (b*d*f^2* 
g^2 + a*c*g^4 - (b*c + a*d)*f*g^3)*x)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=\text {Timed out} \] Input:

integrate((A+B*ln(e*((b*x+a)/(d*x+c))**n))/(g*x+f)**2,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.56 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=B n {\left (\frac {b \log \left (b x + a\right )}{b f g - a g^{2}} - \frac {d \log \left (d x + c\right )}{d f g - c g^{2}} + \frac {{\left (b c - a d\right )} \log \left (g x + f\right )}{b d f^{2} + a c g^{2} - {\left (b c + a d\right )} f g}\right )} - \frac {B \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )}{g^{2} x + f g} - \frac {A}{g^{2} x + f g} \] Input:

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))/(g*x+f)^2,x, algorithm="maxima" 
)
 

Output:

B*n*(b*log(b*x + a)/(b*f*g - a*g^2) - d*log(d*x + c)/(d*f*g - c*g^2) + (b* 
c - a*d)*log(g*x + f)/(b*d*f^2 + a*c*g^2 - (b*c + a*d)*f*g)) - B*log(e*(b* 
x/(d*x + c) + a/(d*x + c))^n)/(g^2*x + f*g) - A/(g^2*x + f*g)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 461 vs. \(2 (91) = 182\).

Time = 0.38 (sec) , antiderivative size = 461, normalized size of antiderivative = 5.07 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx={\left (\frac {{\left (B b^{2} c^{2} n - 2 \, B a b c d n + B a^{2} d^{2} n\right )} \log \left (-b f + \frac {{\left (b x + a\right )} d f}{d x + c} + a g - \frac {{\left (b x + a\right )} c g}{d x + c}\right )}{b d f^{2} - b c f g - a d f g + a c g^{2}} + \frac {{\left (B b^{2} c^{2} n - 2 \, B a b c d n + B a^{2} d^{2} n\right )} \log \left (\frac {b x + a}{d x + c}\right )}{b d f^{2} - \frac {{\left (b x + a\right )} d^{2} f^{2}}{d x + c} - b c f g - a d f g + \frac {2 \, {\left (b x + a\right )} c d f g}{d x + c} + a c g^{2} - \frac {{\left (b x + a\right )} c^{2} g^{2}}{d x + c}} - \frac {{\left (B b^{2} c^{2} n - 2 \, B a b c d n + B a^{2} d^{2} n\right )} \log \left (\frac {b x + a}{d x + c}\right )}{b d f^{2} - b c f g - a d f g + a c g^{2}} + \frac {B b^{2} c^{2} \log \left (e\right ) - 2 \, B a b c d \log \left (e\right ) + B a^{2} d^{2} \log \left (e\right ) + A b^{2} c^{2} - 2 \, A a b c d + A a^{2} d^{2}}{b d f^{2} - \frac {{\left (b x + a\right )} d^{2} f^{2}}{d x + c} - b c f g - a d f g + \frac {2 \, {\left (b x + a\right )} c d f g}{d x + c} + a c g^{2} - \frac {{\left (b x + a\right )} c^{2} g^{2}}{d x + c}}\right )} {\left (\frac {b c}{{\left (b c - a d\right )}^{2}} - \frac {a d}{{\left (b c - a d\right )}^{2}}\right )} \] Input:

integrate((A+B*log(e*((b*x+a)/(d*x+c))^n))/(g*x+f)^2,x, algorithm="giac")
 

Output:

((B*b^2*c^2*n - 2*B*a*b*c*d*n + B*a^2*d^2*n)*log(-b*f + (b*x + a)*d*f/(d*x 
 + c) + a*g - (b*x + a)*c*g/(d*x + c))/(b*d*f^2 - b*c*f*g - a*d*f*g + a*c* 
g^2) + (B*b^2*c^2*n - 2*B*a*b*c*d*n + B*a^2*d^2*n)*log((b*x + a)/(d*x + c) 
)/(b*d*f^2 - (b*x + a)*d^2*f^2/(d*x + c) - b*c*f*g - a*d*f*g + 2*(b*x + a) 
*c*d*f*g/(d*x + c) + a*c*g^2 - (b*x + a)*c^2*g^2/(d*x + c)) - (B*b^2*c^2*n 
 - 2*B*a*b*c*d*n + B*a^2*d^2*n)*log((b*x + a)/(d*x + c))/(b*d*f^2 - b*c*f* 
g - a*d*f*g + a*c*g^2) + (B*b^2*c^2*log(e) - 2*B*a*b*c*d*log(e) + B*a^2*d^ 
2*log(e) + A*b^2*c^2 - 2*A*a*b*c*d + A*a^2*d^2)/(b*d*f^2 - (b*x + a)*d^2*f 
^2/(d*x + c) - b*c*f*g - a*d*f*g + 2*(b*x + a)*c*d*f*g/(d*x + c) + a*c*g^2 
 - (b*x + a)*c^2*g^2/(d*x + c)))*(b*c/(b*c - a*d)^2 - a*d/(b*c - a*d)^2)
 

Mupad [B] (verification not implemented)

Time = 27.05 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.54 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=\frac {B\,d\,n\,\ln \left (c+d\,x\right )}{c\,g^2-d\,f\,g}-\frac {\ln \left (f+g\,x\right )\,\left (B\,a\,d\,n-B\,b\,c\,n\right )}{a\,c\,g^2+b\,d\,f^2-a\,d\,f\,g-b\,c\,f\,g}-\frac {B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}{g\,\left (f+g\,x\right )}-\frac {B\,b\,n\,\ln \left (a+b\,x\right )}{a\,g^2-b\,f\,g}-\frac {A}{x\,g^2+f\,g} \] Input:

int((A + B*log(e*((a + b*x)/(c + d*x))^n))/(f + g*x)^2,x)
 

Output:

(B*d*n*log(c + d*x))/(c*g^2 - d*f*g) - (log(f + g*x)*(B*a*d*n - B*b*c*n))/ 
(a*c*g^2 + b*d*f^2 - a*d*f*g - b*c*f*g) - (B*log(e*((a + b*x)/(c + d*x))^n 
))/(g*(f + g*x)) - (B*b*n*log(a + b*x))/(a*g^2 - b*f*g) - A/(f*g + g^2*x)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 392, normalized size of antiderivative = 4.31 \[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{(f+g x)^2} \, dx=\frac {-\mathrm {log}\left (b x +a \right ) a b c f g n -\mathrm {log}\left (b x +a \right ) a b c \,g^{2} n x +\mathrm {log}\left (b x +a \right ) a b d \,f^{2} n +\mathrm {log}\left (b x +a \right ) a b d f g n x +\mathrm {log}\left (d x +c \right ) a b c f g n +\mathrm {log}\left (d x +c \right ) a b c \,g^{2} n x -\mathrm {log}\left (d x +c \right ) b^{2} c \,f^{2} n -\mathrm {log}\left (d x +c \right ) b^{2} c f g n x -\mathrm {log}\left (g x +f \right ) a b d \,f^{2} n -\mathrm {log}\left (g x +f \right ) a b d f g n x +\mathrm {log}\left (g x +f \right ) b^{2} c \,f^{2} n +\mathrm {log}\left (g x +f \right ) b^{2} c f g n x +\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a b c \,g^{2} x -\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a b d f g x -\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) b^{2} c f g x +\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) b^{2} d \,f^{2} x +a^{2} c \,g^{2} x -a^{2} d f g x -a b c f g x +a b d \,f^{2} x}{f \left (a c \,g^{3} x -a d f \,g^{2} x -b c f \,g^{2} x +b d \,f^{2} g x +a c f \,g^{2}-a d \,f^{2} g -b c \,f^{2} g +b d \,f^{3}\right )} \] Input:

int((A+B*log(e*((b*x+a)/(d*x+c))^n))/(g*x+f)^2,x)
 

Output:

( - log(a + b*x)*a*b*c*f*g*n - log(a + b*x)*a*b*c*g**2*n*x + log(a + b*x)* 
a*b*d*f**2*n + log(a + b*x)*a*b*d*f*g*n*x + log(c + d*x)*a*b*c*f*g*n + log 
(c + d*x)*a*b*c*g**2*n*x - log(c + d*x)*b**2*c*f**2*n - log(c + d*x)*b**2* 
c*f*g*n*x - log(f + g*x)*a*b*d*f**2*n - log(f + g*x)*a*b*d*f*g*n*x + log(f 
 + g*x)*b**2*c*f**2*n + log(f + g*x)*b**2*c*f*g*n*x + log(((a + b*x)**n*e) 
/(c + d*x)**n)*a*b*c*g**2*x - log(((a + b*x)**n*e)/(c + d*x)**n)*a*b*d*f*g 
*x - log(((a + b*x)**n*e)/(c + d*x)**n)*b**2*c*f*g*x + log(((a + b*x)**n*e 
)/(c + d*x)**n)*b**2*d*f**2*x + a**2*c*g**2*x - a**2*d*f*g*x - a*b*c*f*g*x 
 + a*b*d*f**2*x)/(f*(a*c*f*g**2 + a*c*g**3*x - a*d*f**2*g - a*d*f*g**2*x - 
 b*c*f**2*g - b*c*f*g**2*x + b*d*f**3 + b*d*f**2*g*x))