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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.71 (sec) , antiderivative size = 322, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {3008, 2009}

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}{\left (f+\frac {g}{x}\right )^2} \, dx\)

\(\Big \downarrow \) 3008

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3008
Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*(RGx_), x_Symbol] :> With 
[{u = ExpandIntegrand[(a + b*Log[c*RFx^p])^n, RGx, x]}, Int[u, x] /; SumQ[u 
]] /; FreeQ[{a, b, c, p}, x] && RationalFunctionQ[RFx, x] && RationalFuncti 
onQ[RGx, x] && IGtQ[n, 0]
 
Maple [F]

\[\int \frac {A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )}{\left (f +\frac {g}{x}\right )^{2}}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{\left (f+\frac {g}{x}\right )^2} \, dx=\frac {\left (\int \frac {\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) x^{2}}{f^{2} x^{2}+2 f g x +g^{2}}d x \right ) b \,f^{4} x +\left (\int \frac {\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) x^{2}}{f^{2} x^{2}+2 f g x +g^{2}}d x \right ) b \,f^{3} g -2 \,\mathrm {log}\left (f x +g \right ) a f g x -2 \,\mathrm {log}\left (f x +g \right ) a \,g^{2}+a \,f^{2} x^{2}+2 a f g x}{f^{3} \left (f x +g \right )} \] Input:

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

Output:

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