Integrand size = 33, antiderivative size = 124 \[ \int (a g+b g 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 g^2 n x}{3 d^2}-\frac {B (b c-a d) g^2 n (a+b x)^2}{6 b d}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 b}-\frac {B (b c-a d)^3 g^2 n \log (c+d x)}{3 b d^3} \] Output:
1/3*B*(-a*d+b*c)^2*g^2*n*x/d^2-1/6*B*(-a*d+b*c)*g^2*n*(b*x+a)^2/b/d+1/3*g^ 2*(b*x+a)^3*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/b-1/3*B*(-a*d+b*c)^3*g^2*n*ln( d*x+c)/b/d^3
Time = 0.04 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.83 \[ \int (a g+b g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\frac {g^2 \left ((a+b x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+\frac {B (-b c+a d) n \left (d \left (a^2 d+4 a b d x+b^2 x (-2 c+d x)\right )+2 (b c-a d)^2 \log (c+d x)\right )}{2 d^3}\right )}{3 b} \] Input:
Integrate[(a*g + b*g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]
Output:
(g^2*((a + b*x)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n]) + (B*(-(b*c) + a* d)*n*(d*(a^2*d + 4*a*b*d*x + b^2*x*(-2*c + d*x)) + 2*(b*c - a*d)^2*Log[c + d*x]))/(2*d^3)))/(3*b)
Time = 0.30 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.89, 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 (a g+b g 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 {g^2 (a+b x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b}-\frac {B n (b c-a d) \int \frac {g^3 (a+b x)^2}{c+d x}dx}{3 b g}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b}-\frac {B g^2 n (b c-a d) \int \frac {(a+b x)^2}{c+d x}dx}{3 b}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b}-\frac {B g^2 n (b c-a d) \int \left (\frac {(a d-b c)^2}{d^2 (c+d x)}-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}\right )dx}{3 b}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 b}-\frac {B g^2 n (b c-a d) \left (\frac {(b c-a d)^2 \log (c+d x)}{d^3}-\frac {b x (b c-a d)}{d^2}+\frac {(a+b x)^2}{2 d}\right )}{3 b}\) |
Input:
Int[(a*g + b*g*x)^2*(A + B*Log[e*((a + b*x)/(c + d*x))^n]),x]
Output:
(g^2*(a + b*x)^3*(A + B*Log[e*((a + b*x)/(c + d*x))^n]))/(3*b) - (B*(b*c - a*d)*g^2*n*(-((b*(b*c - a*d)*x)/d^2) + (a + b*x)^2/(2*d) + ((b*c - a*d)^2 *Log[c + d*x])/d^3))/(3*b)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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]
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]
Leaf count of result is larger than twice the leaf count of optimal. \(527\) vs. \(2(116)=232\).
Time = 1.96 (sec) , antiderivative size = 528, normalized size of antiderivative = 4.26
method | result | size |
parallelrisch | \(\frac {6 B \,x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} d^{3} g^{2} n -4 B \,a^{3} d^{3} g^{2} n^{2}-2 B \,b^{3} c^{3} g^{2} n^{2}-6 A \,a^{3} d^{3} g^{2} n +B \,a^{2} b c \,d^{2} g^{2} n^{2}+2 A \,x^{3} b^{3} d^{3} g^{2} n +2 B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} c^{3} g^{2} n +2 B \ln \left (b x +a \right ) a^{3} d^{3} g^{2} n^{2}-2 B \ln \left (b x +a \right ) b^{3} c^{3} g^{2} n^{2}-6 B \ln \left (b x +a \right ) a^{2} b c \,d^{2} g^{2} n^{2}+6 B \ln \left (b x +a \right ) a \,b^{2} c^{2} d \,g^{2} n^{2}+5 B a \,b^{2} c^{2} d \,g^{2} n^{2}-12 A \,a^{2} b c \,d^{2} g^{2} n +2 B \,x^{3} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} d^{3} g^{2} n +B \,x^{2} a \,b^{2} d^{3} g^{2} n^{2}-B \,x^{2} b^{3} c \,d^{2} g^{2} n^{2}+6 A \,x^{2} a \,b^{2} d^{3} g^{2} n +4 B x \,a^{2} b \,d^{3} g^{2} n^{2}+2 B x \,b^{3} c^{2} d \,g^{2} n^{2}+6 A x \,a^{2} b \,d^{3} g^{2} n +6 B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} b \,d^{3} g^{2} n -6 B x a \,b^{2} c \,d^{2} g^{2} n^{2}+6 B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} b c \,d^{2} g^{2} n -6 B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} c^{2} d \,g^{2} n}{6 b \,d^{3} n}\) | \(528\) |
Input:
int((b*g*x+a*g)^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)*a*b^2*d^3*g^2*n-4*B*a^3*d^3*g^2*n^2 -2*B*b^3*c^3*g^2*n^2-6*A*a^3*d^3*g^2*n+B*a^2*b*c*d^2*g^2*n^2+2*A*x^3*b^3*d ^3*g^2*n+2*B*ln(e*((b*x+a)/(d*x+c))^n)*b^3*c^3*g^2*n+2*B*ln(b*x+a)*a^3*d^3 *g^2*n^2-2*B*ln(b*x+a)*b^3*c^3*g^2*n^2-6*B*ln(b*x+a)*a^2*b*c*d^2*g^2*n^2+6 *B*ln(b*x+a)*a*b^2*c^2*d*g^2*n^2+5*B*a*b^2*c^2*d*g^2*n^2-12*A*a^2*b*c*d^2* g^2*n+2*B*x^3*ln(e*((b*x+a)/(d*x+c))^n)*b^3*d^3*g^2*n+B*x^2*a*b^2*d^3*g^2* n^2-B*x^2*b^3*c*d^2*g^2*n^2+6*A*x^2*a*b^2*d^3*g^2*n+4*B*x*a^2*b*d^3*g^2*n^ 2+2*B*x*b^3*c^2*d*g^2*n^2+6*A*x*a^2*b*d^3*g^2*n+6*B*x*ln(e*((b*x+a)/(d*x+c ))^n)*a^2*b*d^3*g^2*n-6*B*x*a*b^2*c*d^2*g^2*n^2+6*B*ln(e*((b*x+a)/(d*x+c)) ^n)*a^2*b*c*d^2*g^2*n-6*B*ln(e*((b*x+a)/(d*x+c))^n)*a*b^2*c^2*d*g^2*n)/b/d ^3/n
Leaf count of result is larger than twice the leaf count of optimal. 296 vs. \(2 (116) = 232\).
Time = 0.09 (sec) , antiderivative size = 296, normalized size of antiderivative = 2.39 \[ \int (a g+b g 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} g^{2} x^{3} + 2 \, B a^{3} d^{3} g^{2} n \log \left (b x + a\right ) - 2 \, {\left (B b^{3} c^{3} - 3 \, B a b^{2} c^{2} d + 3 \, B a^{2} b c d^{2}\right )} g^{2} n \log \left (d x + c\right ) + {\left (6 \, A a b^{2} d^{3} g^{2} - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g^{2} n\right )} x^{2} + 2 \, {\left (3 \, A a^{2} b d^{3} g^{2} + {\left (B b^{3} c^{2} d - 3 \, B a b^{2} c d^{2} + 2 \, B a^{2} b d^{3}\right )} g^{2} n\right )} x + 2 \, {\left (B b^{3} d^{3} g^{2} x^{3} + 3 \, B a b^{2} d^{3} g^{2} x^{2} + 3 \, B a^{2} b d^{3} g^{2} x\right )} \log \left (e\right ) + 2 \, {\left (B b^{3} d^{3} g^{2} n x^{3} + 3 \, B a b^{2} d^{3} g^{2} n x^{2} + 3 \, B a^{2} b d^{3} g^{2} n x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{6 \, b d^{3}} \] Input:
integrate((b*g*x+a*g)^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*g^2*x^3 + 2*B*a^3*d^3*g^2*n*log(b*x + a) - 2*(B*b^3*c^3 - 3*B*a*b^2*c^2*d + 3*B*a^2*b*c*d^2)*g^2*n*log(d*x + c) + (6*A*a*b^2*d^3*g^ 2 - (B*b^3*c*d^2 - B*a*b^2*d^3)*g^2*n)*x^2 + 2*(3*A*a^2*b*d^3*g^2 + (B*b^3 *c^2*d - 3*B*a*b^2*c*d^2 + 2*B*a^2*b*d^3)*g^2*n)*x + 2*(B*b^3*d^3*g^2*x^3 + 3*B*a*b^2*d^3*g^2*x^2 + 3*B*a^2*b*d^3*g^2*x)*log(e) + 2*(B*b^3*d^3*g^2*n *x^3 + 3*B*a*b^2*d^3*g^2*n*x^2 + 3*B*a^2*b*d^3*g^2*n*x)*log((b*x + a)/(d*x + c)))/(b*d^3)
Leaf count of result is larger than twice the leaf count of optimal. 586 vs. \(2 (107) = 214\).
Time = 130.63 (sec) , antiderivative size = 586, normalized size of antiderivative = 4.73 \[ \int (a g+b g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\begin {cases} a^{2} g^{2} x \left (A + B \log {\left (e \left (\frac {a}{c}\right )^{n} \right )}\right ) & \text {for}\: b = 0 \wedge d = 0 \\a^{2} g^{2} \left (A x + \frac {B c \log {\left (e \left (\frac {a}{c + d x}\right )^{n} \right )}}{d} + B n x + B x \log {\left (e \left (\frac {a}{c + d x}\right )^{n} \right )}\right ) & \text {for}\: b = 0 \\A a^{2} g^{2} x + A a b g^{2} x^{2} + \frac {A b^{2} g^{2} x^{3}}{3} + \frac {B a^{3} g^{2} \log {\left (e \left (\frac {a}{c} + \frac {b x}{c}\right )^{n} \right )}}{3 b} - \frac {B a^{2} g^{2} n x}{3} + B a^{2} g^{2} x \log {\left (e \left (\frac {a}{c} + \frac {b x}{c}\right )^{n} \right )} - \frac {B a b g^{2} n x^{2}}{3} + B a b g^{2} x^{2} \log {\left (e \left (\frac {a}{c} + \frac {b x}{c}\right )^{n} \right )} - \frac {B b^{2} g^{2} n x^{3}}{9} + \frac {B b^{2} g^{2} x^{3} \log {\left (e \left (\frac {a}{c} + \frac {b x}{c}\right )^{n} \right )}}{3} & \text {for}\: d = 0 \\A a^{2} g^{2} x + A a b g^{2} x^{2} + \frac {A b^{2} g^{2} x^{3}}{3} + \frac {B a^{3} g^{2} n \log {\left (\frac {c}{d} + x \right )}}{3 b} + \frac {B a^{3} g^{2} \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}}{3 b} - \frac {B a^{2} c g^{2} n \log {\left (\frac {c}{d} + x \right )}}{d} + \frac {2 B a^{2} g^{2} n x}{3} + B a^{2} g^{2} x \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )} + \frac {B a b c^{2} g^{2} n \log {\left (\frac {c}{d} + x \right )}}{d^{2}} - \frac {B a b c g^{2} n x}{d} + \frac {B a b g^{2} n x^{2}}{6} + B a b g^{2} x^{2} \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )} - \frac {B b^{2} c^{3} g^{2} n \log {\left (\frac {c}{d} + x \right )}}{3 d^{3}} + \frac {B b^{2} c^{2} g^{2} n x}{3 d^{2}} - \frac {B b^{2} c g^{2} n x^{2}}{6 d} + \frac {B b^{2} g^{2} x^{3} \log {\left (e \left (\frac {a}{c + d x} + \frac {b x}{c + d x}\right )^{n} \right )}}{3} & \text {otherwise} \end {cases} \] Input:
integrate((b*g*x+a*g)**2*(A+B*ln(e*((b*x+a)/(d*x+c))**n)),x)
Output:
Piecewise((a**2*g**2*x*(A + B*log(e*(a/c)**n)), Eq(b, 0) & Eq(d, 0)), (a** 2*g**2*(A*x + B*c*log(e*(a/(c + d*x))**n)/d + B*n*x + B*x*log(e*(a/(c + d* x))**n)), Eq(b, 0)), (A*a**2*g**2*x + A*a*b*g**2*x**2 + A*b**2*g**2*x**3/3 + B*a**3*g**2*log(e*(a/c + b*x/c)**n)/(3*b) - B*a**2*g**2*n*x/3 + B*a**2* g**2*x*log(e*(a/c + b*x/c)**n) - B*a*b*g**2*n*x**2/3 + B*a*b*g**2*x**2*log (e*(a/c + b*x/c)**n) - B*b**2*g**2*n*x**3/9 + B*b**2*g**2*x**3*log(e*(a/c + b*x/c)**n)/3, Eq(d, 0)), (A*a**2*g**2*x + A*a*b*g**2*x**2 + A*b**2*g**2* x**3/3 + B*a**3*g**2*n*log(c/d + x)/(3*b) + B*a**3*g**2*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/(3*b) - B*a**2*c*g**2*n*log(c/d + x)/d + 2*B*a**2*g* *2*n*x/3 + B*a**2*g**2*x*log(e*(a/(c + d*x) + b*x/(c + d*x))**n) + B*a*b*c **2*g**2*n*log(c/d + x)/d**2 - B*a*b*c*g**2*n*x/d + B*a*b*g**2*n*x**2/6 + B*a*b*g**2*x**2*log(e*(a/(c + d*x) + b*x/(c + d*x))**n) - B*b**2*c**3*g**2 *n*log(c/d + x)/(3*d**3) + B*b**2*c**2*g**2*n*x/(3*d**2) - B*b**2*c*g**2*n *x**2/(6*d) + B*b**2*g**2*x**3*log(e*(a/(c + d*x) + b*x/(c + d*x))**n)/3, True))
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 (a g+b g 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 b^{2} g^{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 b^{2} g^{2} x^{3} + B a b g^{2} x^{2} \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) + A a b g^{2} x^{2} + \frac {1}{6} \, B b^{2} g^{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 a b g^{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 a^{2} g^{2} n {\left (\frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} + B a^{2} g^{2} x \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right ) + A a^{2} g^{2} x \] Input:
integrate((b*g*x+a*g)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="max ima")
Output:
1/3*B*b^2*g^2*x^3*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + 1/3*A*b^2*g^2*x ^3 + B*a*b*g^2*x^2*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + A*a*b*g^2*x^2 + 1/6*B*b^2*g^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*a*b*g^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*a^2* g^2*n*(a*log(b*x + a)/b - c*log(d*x + c)/d) + B*a^2*g^2*x*log(e*(b*x/(d*x + c) + a/(d*x + c))^n) + A*a^2*g^2*x
Leaf count of result is larger than twice the leaf count of optimal. 1866 vs. \(2 (116) = 232\).
Time = 0.42 (sec) , antiderivative size = 1866, normalized size of antiderivative = 15.05 \[ \int (a g+b g 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((b*g*x+a*g)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x, algorithm="gia c")
Output:
1/6*(2*(B*b^6*c^4*g^2*n - 4*B*a*b^5*c^3*d*g^2*n - 3*(b*x + a)*B*b^5*c^4*d* g^2*n/(d*x + c) + 6*B*a^2*b^4*c^2*d^2*g^2*n + 12*(b*x + a)*B*a*b^4*c^3*d^2 *g^2*n/(d*x + c) + 3*(b*x + a)^2*B*b^4*c^4*d^2*g^2*n/(d*x + c)^2 - 4*B*a^3 *b^3*c*d^3*g^2*n - 18*(b*x + a)*B*a^2*b^3*c^2*d^3*g^2*n/(d*x + c) - 12*(b* x + a)^2*B*a*b^3*c^3*d^3*g^2*n/(d*x + c)^2 + B*a^4*b^2*d^4*g^2*n + 12*(b*x + a)*B*a^3*b^2*c*d^4*g^2*n/(d*x + c) + 18*(b*x + a)^2*B*a^2*b^2*c^2*d^4*g ^2*n/(d*x + c)^2 - 3*(b*x + a)*B*a^4*b*d^5*g^2*n/(d*x + c) - 12*(b*x + a)^ 2*B*a^3*b*c*d^5*g^2*n/(d*x + c)^2 + 3*(b*x + a)^2*B*a^4*d^6*g^2*n/(d*x + c )^2)*log((b*x + a)/(d*x + c))/(b^3*d^3 - 3*(b*x + a)*b^2*d^4/(d*x + c) + 3 *(b*x + a)^2*b*d^5/(d*x + c)^2 - (b*x + a)^3*d^6/(d*x + c)^3) + (3*B*b^6*c ^4*g^2*n - 12*B*a*b^5*c^3*d*g^2*n - 7*(b*x + a)*B*b^5*c^4*d*g^2*n/(d*x + c ) + 18*B*a^2*b^4*c^2*d^2*g^2*n + 28*(b*x + a)*B*a*b^4*c^3*d^2*g^2*n/(d*x + c) + 4*(b*x + a)^2*B*b^4*c^4*d^2*g^2*n/(d*x + c)^2 - 12*B*a^3*b^3*c*d^3*g ^2*n - 42*(b*x + a)*B*a^2*b^3*c^2*d^3*g^2*n/(d*x + c) - 16*(b*x + a)^2*B*a *b^3*c^3*d^3*g^2*n/(d*x + c)^2 + 3*B*a^4*b^2*d^4*g^2*n + 28*(b*x + a)*B*a^ 3*b^2*c*d^4*g^2*n/(d*x + c) + 24*(b*x + a)^2*B*a^2*b^2*c^2*d^4*g^2*n/(d*x + c)^2 - 7*(b*x + a)*B*a^4*b*d^5*g^2*n/(d*x + c) - 16*(b*x + a)^2*B*a^3*b* c*d^5*g^2*n/(d*x + c)^2 + 4*(b*x + a)^2*B*a^4*d^6*g^2*n/(d*x + c)^2 + 2*B* b^6*c^4*g^2*log(e) - 8*B*a*b^5*c^3*d*g^2*log(e) - 6*(b*x + a)*B*b^5*c^4*d* g^2*log(e)/(d*x + c) + 12*B*a^2*b^4*c^2*d^2*g^2*log(e) + 24*(b*x + a)*B...
Time = 25.77 (sec) , antiderivative size = 303, normalized size of antiderivative = 2.44 \[ \int (a g+b g 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\,a^2\,g^2\,x+B\,a\,b\,g^2\,x^2+\frac {B\,b^2\,g^2\,x^3}{3}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{3\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,d}\right )}{3\,b\,d}-\frac {a\,g^2\,\left (3\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{d}+\frac {A\,a\,b\,c\,g^2}{d}\right )+x^2\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{6\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,d}\right )-\frac {\ln \left (c+d\,x\right )\,\left (3\,B\,n\,a^2\,c\,d^2\,g^2-3\,B\,n\,a\,b\,c^2\,d\,g^2+B\,n\,b^2\,c^3\,g^2\right )}{3\,d^3}+\frac {A\,b^2\,g^2\,x^3}{3}+\frac {B\,a^3\,g^2\,n\,\ln \left (a+b\,x\right )}{3\,b} \] Input:
int((a*g + b*g*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*b^2*g^2*x^3)/3 + B*a^2*g^2*x + B*a*b*g^ 2*x^2) - x*(((3*a*d + 3*b*c)*((b*g^2*(9*A*a*d + 3*A*b*c + B*a*d*n - B*b*c* n))/(3*d) - (A*b*g^2*(3*a*d + 3*b*c))/(3*d)))/(3*b*d) - (a*g^2*(3*A*a*d + 3*A*b*c + B*a*d*n - B*b*c*n))/d + (A*a*b*c*g^2)/d) + x^2*((b*g^2*(9*A*a*d + 3*A*b*c + B*a*d*n - B*b*c*n))/(6*d) - (A*b*g^2*(3*a*d + 3*b*c))/(6*d)) - (log(c + d*x)*(B*b^2*c^3*g^2*n + 3*B*a^2*c*d^2*g^2*n - 3*B*a*b*c^2*d*g^2* n))/(3*d^3) + (A*b^2*g^2*x^3)/3 + (B*a^3*g^2*n*log(a + b*x))/(3*b)
Time = 0.15 (sec) , antiderivative size = 282, normalized size of antiderivative = 2.27 \[ \int (a g+b g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\frac {g^{2} \left (2 \,\mathrm {log}\left (d x +c \right ) a^{3} d^{3} n -6 \,\mathrm {log}\left (d x +c \right ) a^{2} b c \,d^{2} n +6 \,\mathrm {log}\left (d x +c \right ) a \,b^{2} c^{2} d n -2 \,\mathrm {log}\left (d x +c \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 ) a^{3} d^{3}+6 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a^{2} b \,d^{3} x +6 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a \,b^{2} d^{3} 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}+6 a^{3} d^{3} x +4 a^{2} b \,d^{3} n x +6 a^{2} b \,d^{3} x^{2}-6 a \,b^{2} c \,d^{2} n x +a \,b^{2} d^{3} n \,x^{2}+2 a \,b^{2} d^{3} x^{3}+2 b^{3} c^{2} d n x -b^{3} c \,d^{2} n \,x^{2}\right )}{6 d^{3}} \] Input:
int((b*g*x+a*g)^2*(A+B*log(e*((b*x+a)/(d*x+c))^n)),x)
Output:
(g**2*(2*log(c + d*x)*a**3*d**3*n - 6*log(c + d*x)*a**2*b*c*d**2*n + 6*log (c + d*x)*a*b**2*c**2*d*n - 2*log(c + d*x)*b**3*c**3*n + 2*log(((a + b*x)* *n*e)/(c + d*x)**n)*a**3*d**3 + 6*log(((a + b*x)**n*e)/(c + d*x)**n)*a**2* b*d**3*x + 6*log(((a + b*x)**n*e)/(c + d*x)**n)*a*b**2*d**3*x**2 + 2*log(( (a + b*x)**n*e)/(c + d*x)**n)*b**3*d**3*x**3 + 6*a**3*d**3*x + 4*a**2*b*d* *3*n*x + 6*a**2*b*d**3*x**2 - 6*a*b**2*c*d**2*n*x + a*b**2*d**3*n*x**2 + 2 *a*b**2*d**3*x**3 + 2*b**3*c**2*d*n*x - b**3*c*d**2*n*x**2))/(6*d**3)