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

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

Optimal result

Integrand size = 33, antiderivative size = 124 \[ \int (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=-\frac {B (b c-a d)^2 i^2 n x}{3 b^2}-\frac {B (b c-a d) i^2 n (c+d x)^2}{6 b d}-\frac {B (b c-a d)^3 i^2 n \log (a+b x)}{3 b^3 d}+\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 d} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.88, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {2947, 27, 49, 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 (c i+d i x)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2947

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 49
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

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

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

Leaf count of result is larger than twice the leaf count of optimal. \(462\) vs. \(2(116)=232\).

Time = 2.01 (sec) , antiderivative size = 463, normalized size of antiderivative = 3.73

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

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 297 vs. \(2 (116) = 232\).

Time = 0.10 (sec) , antiderivative size = 297, normalized size of antiderivative = 2.40 \[ \int (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\frac {2 \, A b^{3} d^{3} i^{2} x^{3} - 2 \, B b^{3} c^{3} i^{2} n \log \left (d x + c\right ) + 2 \, {\left (3 \, B a b^{2} c^{2} d - 3 \, B a^{2} b c d^{2} + B a^{3} d^{3}\right )} i^{2} n \log \left (b x + a\right ) + {\left (6 \, A b^{3} c d^{2} i^{2} - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} i^{2} n\right )} x^{2} + 2 \, {\left (3 \, A b^{3} c^{2} d i^{2} - {\left (2 \, B b^{3} c^{2} d - 3 \, B a b^{2} c d^{2} + B a^{2} b d^{3}\right )} i^{2} n\right )} x + 2 \, {\left (B b^{3} d^{3} i^{2} x^{3} + 3 \, B b^{3} c d^{2} i^{2} x^{2} + 3 \, B b^{3} c^{2} d i^{2} x\right )} \log \left (e\right ) + 2 \, {\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\right )} \log \left (\frac {b x + a}{d x + c}\right )}{6 \, b^{3} d} \] Input:

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

Output:

1/6*(2*A*b^3*d^3*i^2*x^3 - 2*B*b^3*c^3*i^2*n*log(d*x + c) + 2*(3*B*a*b^2*c 
^2*d - 3*B*a^2*b*c*d^2 + B*a^3*d^3)*i^2*n*log(b*x + a) + (6*A*b^3*c*d^2*i^ 
2 - (B*b^3*c*d^2 - B*a*b^2*d^3)*i^2*n)*x^2 + 2*(3*A*b^3*c^2*d*i^2 - (2*B*b 
^3*c^2*d - 3*B*a*b^2*c*d^2 + B*a^2*b*d^3)*i^2*n)*x + 2*(B*b^3*d^3*i^2*x^3 
+ 3*B*b^3*c*d^2*i^2*x^2 + 3*B*b^3*c^2*d*i^2*x)*log(e) + 2*(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)*log((b*x + a)/(d*x 
 + c)))/(b^3*d)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (107) = 214\).

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

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

Output:

Piecewise((c**2*i**2*x*(A + B*log(e*(a/c)**n)), Eq(b, 0) & Eq(d, 0)), (A*c 
**2*i**2*x + A*c*d*i**2*x**2 + A*d**2*i**2*x**3/3 + B*c**3*i**2*log(e*(a/( 
c + d*x))**n)/(3*d) + B*c**2*i**2*n*x/3 + B*c**2*i**2*x*log(e*(a/(c + d*x) 
)**n) + B*c*d*i**2*n*x**2/3 + B*c*d*i**2*x**2*log(e*(a/(c + d*x))**n) + B* 
d**2*i**2*n*x**3/9 + B*d**2*i**2*x**3*log(e*(a/(c + d*x))**n)/3, Eq(b, 0)) 
, (c**2*i**2*(A*x + B*a*log(e*(a/c + b*x/c)**n)/b - B*n*x + B*x*log(e*(a/c 
 + b*x/c)**n)), Eq(d, 0)), (A*c**2*i**2*x + A*c*d*i**2*x**2 + A*d**2*i**2* 
x**3/3 + B*a**3*d**2*i**2*n*log(c/d + x)/(3*b**3) + B*a**3*d**2*i**2*log(e 
*(a/(c + d*x) + b*x/(c + d*x))**n)/(3*b**3) - B*a**2*c*d*i**2*n*log(c/d + 
x)/b**2 - B*a**2*c*d*i**2*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/b**2 - B 
*a**2*d**2*i**2*n*x/(3*b**2) + B*a*c**2*i**2*n*log(c/d + x)/b + B*a*c**2*i 
**2*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/b + B*a*c*d*i**2*n*x/b + B*a*d 
**2*i**2*n*x**2/(6*b) - B*c**3*i**2*n*log(c/d + x)/(3*d) - 2*B*c**2*i**2*n 
*x/3 + B*c**2*i**2*x*log(e*(a/(c + d*x) + b*x/(c + d*x))**n) - B*c*d*i**2* 
n*x**2/6 + B*c*d*i**2*x**2*log(e*(a/(c + d*x) + b*x/(c + d*x))**n) + B*d** 
2*i**2*x**3*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/3, True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (116) = 232\).

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 990 vs. \(2 (116) = 232\).

Time = 0.40 (sec) , antiderivative size = 990, normalized size of antiderivative = 7.98 \[ \int (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, 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)),x, algorithm="gia 
c")
 

Output:

1/6*(2*(B*b^4*c^4*i^2*n - 4*B*a*b^3*c^3*d*i^2*n + 6*B*a^2*b^2*c^2*d^2*i^2* 
n - 4*B*a^3*b*c*d^3*i^2*n + B*a^4*d^4*i^2*n)*log((b*x + a)/(d*x + c))/(b^3 
*d - 3*(b*x + a)*b^2*d^2/(d*x + c) + 3*(b*x + a)^2*b*d^3/(d*x + c)^2 - (b* 
x + a)^3*d^4/(d*x + c)^3) - (3*B*b^6*c^4*i^2*n - 12*B*a*b^5*c^3*d*i^2*n - 
5*(b*x + a)*B*b^5*c^4*d*i^2*n/(d*x + c) + 18*B*a^2*b^4*c^2*d^2*i^2*n + 20* 
(b*x + a)*B*a*b^4*c^3*d^2*i^2*n/(d*x + c) + 2*(b*x + a)^2*B*b^4*c^4*d^2*i^ 
2*n/(d*x + c)^2 - 12*B*a^3*b^3*c*d^3*i^2*n - 30*(b*x + a)*B*a^2*b^3*c^2*d^ 
3*i^2*n/(d*x + c) - 8*(b*x + a)^2*B*a*b^3*c^3*d^3*i^2*n/(d*x + c)^2 + 3*B* 
a^4*b^2*d^4*i^2*n + 20*(b*x + a)*B*a^3*b^2*c*d^4*i^2*n/(d*x + c) + 12*(b*x 
 + a)^2*B*a^2*b^2*c^2*d^4*i^2*n/(d*x + c)^2 - 5*(b*x + a)*B*a^4*b*d^5*i^2* 
n/(d*x + c) - 8*(b*x + a)^2*B*a^3*b*c*d^5*i^2*n/(d*x + c)^2 + 2*(b*x + a)^ 
2*B*a^4*d^6*i^2*n/(d*x + c)^2 - 2*B*b^6*c^4*i^2*log(e) + 8*B*a*b^5*c^3*d*i 
^2*log(e) - 12*B*a^2*b^4*c^2*d^2*i^2*log(e) + 8*B*a^3*b^3*c*d^3*i^2*log(e) 
 - 2*B*a^4*b^2*d^4*i^2*log(e) - 2*A*b^6*c^4*i^2 + 8*A*a*b^5*c^3*d*i^2 - 12 
*A*a^2*b^4*c^2*d^2*i^2 + 8*A*a^3*b^3*c*d^3*i^2 - 2*A*a^4*b^2*d^4*i^2)/(b^5 
*d - 3*(b*x + a)*b^4*d^2/(d*x + c) + 3*(b*x + a)^2*b^3*d^3/(d*x + c)^2 - ( 
b*x + a)^3*b^2*d^4/(d*x + c)^3) + 2*(B*b^4*c^4*i^2*n - 4*B*a*b^3*c^3*d*i^2 
*n + 6*B*a^2*b^2*c^2*d^2*i^2*n - 4*B*a^3*b*c*d^3*i^2*n + B*a^4*d^4*i^2*n)* 
log(b - (b*x + a)*d/(d*x + c))/(b^3*d) - 2*(B*b^4*c^4*i^2*n - 4*B*a*b^3*c^ 
3*d*i^2*n + 6*B*a^2*b^2*c^2*d^2*i^2*n - 4*B*a^3*b*c*d^3*i^2*n + B*a^4*d...
 

Mupad [B] (verification not implemented)

Time = 25.77 (sec) , antiderivative size = 303, normalized size of antiderivative = 2.44 \[ \int (c i+d i x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (B\,c^2\,i^2\,x+B\,c\,d\,i^2\,x^2+\frac {B\,d^2\,i^2\,x^3}{3}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {d\,i^2\,\left (3\,A\,a\,d+9\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{3\,b}-\frac {A\,d\,i^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,b}\right )}{3\,b\,d}-\frac {c\,i^2\,\left (3\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{b}+\frac {A\,a\,c\,d\,i^2}{b}\right )+x^2\,\left (\frac {d\,i^2\,\left (3\,A\,a\,d+9\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{6\,b}-\frac {A\,d\,i^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,b}\right )+\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^3\,d^2\,i^2-3\,B\,n\,a^2\,b\,c\,d\,i^2+3\,B\,n\,a\,b^2\,c^2\,i^2\right )}{3\,b^3}+\frac {A\,d^2\,i^2\,x^3}{3}-\frac {B\,c^3\,i^2\,n\,\ln \left (c+d\,x\right )}{3\,d} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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