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

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

Optimal result

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

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

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

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

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

Output:

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

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.73, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.086, Rules used = {2951, 2733, 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 {\left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{(c g+d g x)^2} \, dx\)

\(\Big \downarrow \) 2951

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

\(\Big \downarrow \) 2733

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2733
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b 
*Log[c*x^n])^p, x] - Simp[b*n*p   Int[(a + b*Log[c*x^n])^(p - 1), x], x] /; 
 FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]
 

rule 2951
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d)^(m + 
1)*(g/d)^m   Subst[Int[(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] && IntegersQ[m, p] && EqQ[d*f - c*g, 0] && (GtQ[p, 0] || LtQ[m, - 
1])
 
Maple [A] (verified)

Time = 2.12 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.80

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

(Integral(A**2/(c**2 + 2*c*d*x + d**2*x**2), x) + Integral(B**2*log(e*(a/( 
c + d*x) + b*x/(c + d*x))**n)**2/(c**2 + 2*c*d*x + d**2*x**2), x) + Integr 
al(2*A*B*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/(c**2 + 2*c*d*x + d**2*x* 
*2), x))/g**2
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 428 vs. \(2 (163) = 326\).

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.79 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.07 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^2} \, dx={\left (\frac {{\left (b x + a\right )} B^{2} n^{2} \log \left (\frac {b x + a}{d x + c}\right )^{2}}{{\left (d x + c\right )} g^{2}} - \frac {2 \, {\left (B^{2} n^{2} - B^{2} n \log \left (e\right ) - A B n\right )} {\left (b x + a\right )} \log \left (\frac {b x + a}{d x + c}\right )}{{\left (d x + c\right )} g^{2}} + \frac {{\left (2 \, B^{2} n^{2} - 2 \, B^{2} n \log \left (e\right ) + B^{2} \log \left (e\right )^{2} - 2 \, A B n + 2 \, A B \log \left (e\right ) + A^{2}\right )} {\left (b x + a\right )}}{{\left (d x + c\right )} g^{2}}\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))^2/(d*g*x+c*g)^2,x, algorithm="g 
iac")
 

Output:

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

Mupad [B] (verification not implemented)

Time = 26.16 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.45 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(c g+d g x)^2} \, dx=\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (\frac {2\,B^2\,n}{x\,d^2\,g^2+c\,d\,g^2}-\frac {2\,A\,B}{x\,d^2\,g^2+c\,d\,g^2}\right )-{\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}^2\,\left (\frac {B^2}{d\,\left (c\,g^2+d\,g^2\,x\right )}+\frac {B^2\,b}{d\,g^2\,\left (a\,d-b\,c\right )}\right )-\frac {A^2-2\,A\,B\,n+2\,B^2\,n^2}{x\,d^2\,g^2+c\,d\,g^2}+\frac {B\,b\,n\,\mathrm {atan}\left (\frac {\left (2\,b\,d\,x+\frac {a\,d^2\,g^2+b\,c\,d\,g^2}{d\,g^2}\right )\,1{}\mathrm {i}}{a\,d-b\,c}\right )\,\left (A-B\,n\right )\,4{}\mathrm {i}}{d\,g^2\,\left (a\,d-b\,c\right )} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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