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

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

Optimal result

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(329\) vs. \(2(93)=186\).

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

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

Output:

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

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.84, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.047, Rules used = {2961, 2741}

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 {(c i+d i x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{(a g+b g x)^4} \, dx\)

\(\Big \downarrow \) 2961

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

\(\Big \downarrow \) 2741

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2741
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> 
Simp[(d*x)^(m + 1)*((a + b*Log[c*x^n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^( 
m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1]
 

rule 2961
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.)*((h_.) + (i_.)*(x_))^(q_.), x_Symbol 
] :> Simp[(b*c - a*d)^(m + q + 1)*(g/b)^m*(i/d)^q   Subst[Int[x^m*((A + B*L 
og[e*x^n])^p/(b - d*x)^(m + q + 2)), x], x, (a + b*x)/(c + d*x)], x] /; Fre 
eQ[{a, b, c, d, e, f, g, h, i, A, B, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[ 
b*f - a*g, 0] && EqQ[d*h - c*i, 0] && IntegersQ[m, q]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(375\) vs. \(2(89)=178\).

Time = 11.94 (sec) , antiderivative size = 376, normalized size of antiderivative = 4.04

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

Input:

int((d*i*x+c*i)^2*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/(b*g*x+a*g)^4,x,method=_ 
RETURNVERBOSE)
 

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 409 vs. \(2 (89) = 178\).

Time = 0.09 (sec) , antiderivative size = 409, normalized size of antiderivative = 4.40 \[ \int \frac {(c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(a g+b g x)^4} \, dx=-\frac {{\left (B b^{3} c^{3} - B a^{3} d^{3}\right )} i^{2} n + 3 \, {\left (A b^{3} c^{3} - A a^{3} d^{3}\right )} i^{2} + 3 \, {\left ({\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} i^{2} n + 3 \, {\left (A b^{3} c d^{2} - A a b^{2} d^{3}\right )} i^{2}\right )} x^{2} + 3 \, {\left ({\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} i^{2} n + 3 \, {\left (A b^{3} c^{2} d - A a^{2} b d^{3}\right )} i^{2}\right )} x + 3 \, {\left (3 \, {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} i^{2} x^{2} + 3 \, {\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} i^{2} x + {\left (B b^{3} c^{3} - B a^{3} d^{3}\right )} i^{2}\right )} \log \left (e\right ) + 3 \, {\left (B b^{3} d^{3} i^{2} n x^{3} + 3 \, B b^{3} c d^{2} i^{2} n x^{2} + 3 \, B b^{3} c^{2} d i^{2} n x + B b^{3} c^{3} i^{2} n\right )} \log \left (\frac {b x + a}{d x + c}\right )}{9 \, {\left ({\left (b^{7} c - a b^{6} d\right )} g^{4} x^{3} + 3 \, {\left (a b^{6} c - a^{2} b^{5} d\right )} g^{4} x^{2} + 3 \, {\left (a^{2} b^{5} c - a^{3} b^{4} d\right )} g^{4} x + {\left (a^{3} b^{4} c - a^{4} b^{3} d\right )} g^{4}\right )}} \] Input:

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

Output:

-1/9*((B*b^3*c^3 - B*a^3*d^3)*i^2*n + 3*(A*b^3*c^3 - A*a^3*d^3)*i^2 + 3*(( 
B*b^3*c*d^2 - B*a*b^2*d^3)*i^2*n + 3*(A*b^3*c*d^2 - A*a*b^2*d^3)*i^2)*x^2 
+ 3*((B*b^3*c^2*d - B*a^2*b*d^3)*i^2*n + 3*(A*b^3*c^2*d - A*a^2*b*d^3)*i^2 
)*x + 3*(3*(B*b^3*c*d^2 - B*a*b^2*d^3)*i^2*x^2 + 3*(B*b^3*c^2*d - B*a^2*b* 
d^3)*i^2*x + (B*b^3*c^3 - B*a^3*d^3)*i^2)*log(e) + 3*(B*b^3*d^3*i^2*n*x^3 
+ 3*B*b^3*c*d^2*i^2*n*x^2 + 3*B*b^3*c^2*d*i^2*n*x + B*b^3*c^3*i^2*n)*log(( 
b*x + a)/(d*x + c)))/((b^7*c - a*b^6*d)*g^4*x^3 + 3*(a*b^6*c - a^2*b^5*d)* 
g^4*x^2 + 3*(a^2*b^5*c - a^3*b^4*d)*g^4*x + (a^3*b^4*c - a^4*b^3*d)*g^4)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1544 vs. \(2 (89) = 178\).

Time = 0.10 (sec) , antiderivative size = 1544, normalized size of antiderivative = 16.60 \[ \int \frac {(c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(a g+b g x)^4} \, dx=\text {Too large to display} \] Input:

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

Output:

-1/18*B*d^2*i^2*n*((11*a^2*b^2*c^2 - 7*a^3*b*c*d + 2*a^4*d^2 + 6*(3*b^4*c^ 
2 - 3*a*b^3*c*d + a^2*b^2*d^2)*x^2 + 3*(9*a*b^3*c^2 - 7*a^2*b^2*c*d + 2*a^ 
3*b*d^2)*x)/((b^8*c^2 - 2*a*b^7*c*d + a^2*b^6*d^2)*g^4*x^3 + 3*(a*b^7*c^2 
- 2*a^2*b^6*c*d + a^3*b^5*d^2)*g^4*x^2 + 3*(a^2*b^6*c^2 - 2*a^3*b^5*c*d + 
a^4*b^4*d^2)*g^4*x + (a^3*b^5*c^2 - 2*a^4*b^4*c*d + a^5*b^3*d^2)*g^4) + 6* 
(3*b^2*c^2*d - 3*a*b*c*d^2 + a^2*d^3)*log(b*x + a)/((b^6*c^3 - 3*a*b^5*c^2 
*d + 3*a^2*b^4*c*d^2 - a^3*b^3*d^3)*g^4) - 6*(3*b^2*c^2*d - 3*a*b*c*d^2 + 
a^2*d^3)*log(d*x + c)/((b^6*c^3 - 3*a*b^5*c^2*d + 3*a^2*b^4*c*d^2 - a^3*b^ 
3*d^3)*g^4)) - 1/18*B*c^2*i^2*n*((6*b^2*d^2*x^2 + 2*b^2*c^2 - 7*a*b*c*d + 
11*a^2*d^2 - 3*(b^2*c*d - 5*a*b*d^2)*x)/((b^6*c^2 - 2*a*b^5*c*d + a^2*b^4* 
d^2)*g^4*x^3 + 3*(a*b^5*c^2 - 2*a^2*b^4*c*d + a^3*b^3*d^2)*g^4*x^2 + 3*(a^ 
2*b^4*c^2 - 2*a^3*b^3*c*d + a^4*b^2*d^2)*g^4*x + (a^3*b^3*c^2 - 2*a^4*b^2* 
c*d + a^5*b*d^2)*g^4) + 6*d^3*log(b*x + a)/((b^4*c^3 - 3*a*b^3*c^2*d + 3*a 
^2*b^2*c*d^2 - a^3*b*d^3)*g^4) - 6*d^3*log(d*x + c)/((b^4*c^3 - 3*a*b^3*c^ 
2*d + 3*a^2*b^2*c*d^2 - a^3*b*d^3)*g^4)) - 1/18*B*c*d*i^2*n*((5*a*b^2*c^2 
- 22*a^2*b*c*d + 5*a^3*d^2 - 6*(3*b^3*c*d - a*b^2*d^2)*x^2 + 3*(3*b^3*c^2 
- 16*a*b^2*c*d + 5*a^2*b*d^2)*x)/((b^7*c^2 - 2*a*b^6*c*d + a^2*b^5*d^2)*g^ 
4*x^3 + 3*(a*b^6*c^2 - 2*a^2*b^5*c*d + a^3*b^4*d^2)*g^4*x^2 + 3*(a^2*b^5*c 
^2 - 2*a^3*b^4*c*d + a^4*b^3*d^2)*g^4*x + (a^3*b^4*c^2 - 2*a^4*b^3*c*d + a 
^5*b^2*d^2)*g^4) - 6*(3*b*c*d^2 - a*d^3)*log(b*x + a)/((b^5*c^3 - 3*a*b...
 

Giac [A] (verification not implemented)

Time = 1.33 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.16 \[ \int \frac {(c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(a g+b g x)^4} \, dx=-\frac {1}{9} \, {\left (\frac {3 \, {\left (d x + c\right )}^{3} B i^{2} n \log \left (\frac {b x + a}{d x + c}\right )}{{\left (b x + a\right )}^{3} g^{4}} + \frac {{\left (B i^{2} n + 3 \, B i^{2} \log \left (e\right ) + 3 \, A i^{2}\right )} {\left (d x + c\right )}^{3}}{{\left (b x + a\right )}^{3} g^{4}}\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((d*i*x+c*i)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n))/(b*g*x+a*g)^4,x, 
algorithm="giac")
 

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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