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

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 = 30, antiderivative size = 180 \[ \int (a g+b g x)^4 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx=-\frac {B (b c-a d)^4 g^4 x}{5 d^4}+\frac {B (b c-a d)^3 g^4 (a+b x)^2}{10 b d^3}-\frac {B (b c-a d)^2 g^4 (a+b x)^3}{15 b d^2}+\frac {B (b c-a d) g^4 (a+b x)^4}{20 b d}+\frac {B (b c-a d)^5 g^4 \log (c+d x)}{5 b d^5}+\frac {g^4 (a+b x)^5 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{5 b} \] Output:

-1/5*B*(-a*d+b*c)^4*g^4*x/d^4+1/10*B*(-a*d+b*c)^3*g^4*(b*x+a)^2/b/d^3-1/15 
*B*(-a*d+b*c)^2*g^4*(b*x+a)^3/b/d^2+1/20*B*(-a*d+b*c)*g^4*(b*x+a)^4/b/d+1/ 
5*B*(-a*d+b*c)^5*g^4*ln(d*x+c)/b/d^5+1/5*g^4*(b*x+a)^5*(A+B*ln(e*(d*x+c)/( 
b*x+a)))/b
 

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.79 \[ \int (a g+b g x)^4 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx=\frac {g^4 \left (-\frac {B (-b c+a d) \left (-12 b d (b c-a d)^3 x+6 d^2 (b c-a d)^2 (a+b x)^2+4 d^3 (-b c+a d) (a+b x)^3+3 d^4 (a+b x)^4+12 (b c-a d)^4 \log (c+d x)\right )}{12 d^5}+(a+b x)^5 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )\right )}{5 b} \] Input:

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

Output:

(g^4*(-1/12*(B*(-(b*c) + a*d)*(-12*b*d*(b*c - a*d)^3*x + 6*d^2*(b*c - a*d) 
^2*(a + b*x)^2 + 4*d^3*(-(b*c) + a*d)*(a + b*x)^3 + 3*d^4*(a + b*x)^4 + 12 
*(b*c - a*d)^4*Log[c + d*x]))/d^5 + (a + b*x)^5*(A + B*Log[(e*(c + d*x))/( 
a + b*x)])))/(5*b)
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.86, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2948, 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)^4 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2948

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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 2948
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*( 
(A + B*Log[e*((a + b*x)^n/(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] / 
; FreeQ[{a, b, c, d, e, f, g, A, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c 
- a*d, 0] && NeQ[m, -1] &&  !(EqQ[m, -2] && IntegerQ[n])
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(441\) vs. \(2(168)=336\).

Time = 1.24 (sec) , antiderivative size = 442, normalized size of antiderivative = 2.46

method result size
risch \(-\frac {g^{4} B \ln \left (d x +c \right ) a^{5}}{5 b}-\frac {4 g^{4} B \,a^{4} x}{5}-\frac {g^{4} b^{4} B \,c^{4} x}{5 d^{4}}+\frac {g^{4} b^{4} B \ln \left (d x +c \right ) c^{5}}{5 d^{5}}+\frac {g^{4} B \ln \left (d x +c \right ) a^{4} c}{d}+2 g^{4} b^{2} A \,a^{2} x^{3}-\frac {4 g^{4} b^{2} B \,a^{2} x^{3}}{15}-\frac {g^{4} b^{4} B \,c^{2} x^{3}}{15 d^{2}}+2 g^{4} b A \,a^{3} x^{2}-\frac {2 g^{4} b B \ln \left (d x +c \right ) a^{3} c^{2}}{d^{2}}+\frac {2 g^{4} b^{2} B \ln \left (d x +c \right ) a^{2} c^{3}}{d^{3}}-\frac {g^{4} b^{3} B \ln \left (d x +c \right ) a \,c^{4}}{d^{4}}+g^{4} b^{3} A a \,x^{4}-\frac {g^{4} b^{3} B a \,x^{4}}{20}+\frac {g^{4} b^{4} B c \,x^{4}}{20 d}+\frac {2 g^{4} b B \,a^{3} c x}{d}-\frac {2 g^{4} b^{2} B \,a^{2} c^{2} x}{d^{2}}+\frac {g^{4} b^{3} B a \,c^{3} x}{d^{3}}+\frac {g^{4} b^{3} B a c \,x^{3}}{3 d}+\frac {g^{4} b^{2} B \,a^{2} c \,x^{2}}{d}-\frac {g^{4} b^{3} B a \,c^{2} x^{2}}{2 d^{2}}-\frac {3 g^{4} b B \,a^{3} x^{2}}{5}+\frac {g^{4} b^{4} B \,c^{3} x^{2}}{10 d^{3}}+g^{4} A \,a^{4} x +\frac {g^{4} b^{4} A \,x^{5}}{5}+\frac {\left (b x +a \right )^{5} g^{4} B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right )}{5 b}\) \(442\)
parts \(\frac {A \,g^{4} \left (b x +a \right )^{5}}{5 b}+B \,g^{4} e^{5} \left (d a -b c \right )^{5} \left (-\frac {1}{10 d^{3} e^{3} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{2}}+\frac {\ln \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}{5 d^{5} e^{5} b}-\frac {1}{20 d e b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{4}}+\frac {1}{15 d^{2} e^{2} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{3}}+\frac {1}{5 d^{4} e^{4} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}-\frac {\ln \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (b^{4} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{4}-5 b^{3} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{3} d e +10 b^{2} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{2} d^{2} e^{2}-10 \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b \,d^{3} e^{3}+5 d^{4} e^{4}\right )}{5 d^{5} e^{5} \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{5}}\right )\) \(536\)
derivativedivides \(\frac {e \left (d a -b c \right ) \left (-\frac {A b \,e^{4} g^{4} \left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right )}{5 \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{5}}+B \,b^{2} e^{4} g^{4} \left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right ) \left (-\frac {1}{10 d^{3} e^{3} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{2}}+\frac {\ln \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}{5 d^{5} e^{5} b}-\frac {1}{20 d e b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{4}}+\frac {1}{15 d^{2} e^{2} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{3}}+\frac {1}{5 d^{4} e^{4} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}-\frac {\ln \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (b^{4} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{4}-5 b^{3} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{3} d e +10 b^{2} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{2} d^{2} e^{2}-10 \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b \,d^{3} e^{3}+5 d^{4} e^{4}\right )}{5 d^{5} e^{5} \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{5}}\right )\right )}{b^{2}}\) \(671\)
default \(\frac {e \left (d a -b c \right ) \left (-\frac {A b \,e^{4} g^{4} \left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right )}{5 \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{5}}+B \,b^{2} e^{4} g^{4} \left (a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right ) \left (-\frac {1}{10 d^{3} e^{3} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{2}}+\frac {\ln \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}{5 d^{5} e^{5} b}-\frac {1}{20 d e b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{4}}+\frac {1}{15 d^{2} e^{2} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{3}}+\frac {1}{5 d^{4} e^{4} b \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )}-\frac {\ln \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) \left (b^{4} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{4}-5 b^{3} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{3} d e +10 b^{2} \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right )^{2} d^{2} e^{2}-10 \left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b \,d^{3} e^{3}+5 d^{4} e^{4}\right )}{5 d^{5} e^{5} \left (\left (\frac {d e}{b}-\frac {e \left (d a -b c \right )}{b \left (b x +a \right )}\right ) b -d e \right )^{5}}\right )\right )}{b^{2}}\) \(671\)
parallelrisch \(\frac {12 A \,x^{5} b^{5} d^{5} g^{4}+12 B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) b^{5} c^{5} g^{4}-12 B \ln \left (b x +a \right ) a^{5} d^{5} g^{4}+12 B \ln \left (b x +a \right ) b^{5} c^{5} g^{4}-36 B \,a^{4} b c \,d^{4} g^{4}-60 B \,a^{3} b^{2} c^{2} d^{3} g^{4}+90 B \,a^{2} b^{3} c^{3} d^{2} g^{4}-120 B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{3} b^{2} c^{2} d^{3} g^{4}+120 B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{2} b^{3} c^{3} d^{2} g^{4}+120 B \,x^{2} \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{3} b^{2} d^{5} g^{4}+12 B \,b^{5} g^{4} c^{5}+48 B \,a^{5} d^{5} g^{4}-54 B a \,b^{4} c^{4} d \,g^{4}+12 B \,x^{5} \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) b^{5} d^{5} g^{4}+60 A \,x^{4} a \,b^{4} d^{5} g^{4}-3 B \,x^{4} a \,b^{4} d^{5} g^{4}+60 B \,x^{2} a^{2} b^{3} c \,d^{4} g^{4}-30 B \,x^{2} a \,b^{4} c^{2} d^{3} g^{4}+60 B x \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{4} b \,d^{5} g^{4}-60 B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a \,b^{4} c^{4} d \,g^{4}+60 B \,x^{4} \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a \,b^{4} d^{5} g^{4}+120 B \,x^{3} \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{2} b^{3} d^{5} g^{4}+20 B \,x^{3} a \,b^{4} c \,d^{4} g^{4}+60 B \ln \left (\frac {e \left (d x +c \right )}{b x +a}\right ) a^{4} b c \,d^{4} g^{4}+3 B \,x^{4} b^{5} c \,d^{4} g^{4}+120 A \,x^{3} a^{2} b^{3} d^{5} g^{4}-16 B \,x^{3} a^{2} b^{3} d^{5} g^{4}-4 B \,x^{3} b^{5} c^{2} d^{3} g^{4}+120 A \,x^{2} a^{3} b^{2} d^{5} g^{4}-36 B \,x^{2} a^{3} b^{2} d^{5} g^{4}+6 B \,x^{2} b^{5} c^{3} d^{2} g^{4}+60 A x \,a^{4} b \,d^{5} g^{4}-48 B x \,a^{4} b \,d^{5} g^{4}-12 B x \,b^{5} c^{4} d \,g^{4}+120 B x \,a^{3} b^{2} c \,d^{4} g^{4}-120 B x \,a^{2} b^{3} c^{2} d^{3} g^{4}+60 B x a \,b^{4} c^{3} d^{2} g^{4}+60 B \ln \left (b x +a \right ) a^{4} b c \,d^{4} g^{4}-120 B \ln \left (b x +a \right ) a^{3} b^{2} c^{2} d^{3} g^{4}+120 B \ln \left (b x +a \right ) a^{2} b^{3} c^{3} d^{2} g^{4}-60 B \ln \left (b x +a \right ) a \,b^{4} c^{4} d \,g^{4}-180 A \,a^{4} b c \,d^{4} g^{4}-60 A \,a^{5} d^{5} g^{4}}{60 d^{5} b}\) \(876\)

Input:

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

Output:

-1/5*g^4/b*B*ln(d*x+c)*a^5-4/5*g^4*B*a^4*x-1/5*g^4/d^4*b^4*B*c^4*x+1/5*g^4 
/d^5*b^4*B*ln(d*x+c)*c^5+g^4/d*B*ln(d*x+c)*a^4*c+2*g^4*b^2*A*a^2*x^3-4/15* 
g^4*b^2*B*a^2*x^3-1/15*g^4/d^2*b^4*B*c^2*x^3+2*g^4*b*A*a^3*x^2-2*g^4/d^2*b 
*B*ln(d*x+c)*a^3*c^2+2*g^4/d^3*b^2*B*ln(d*x+c)*a^2*c^3-g^4/d^4*b^3*B*ln(d* 
x+c)*a*c^4+g^4*b^3*A*a*x^4-1/20*g^4*b^3*B*a*x^4+1/20*g^4/d*b^4*B*c*x^4+2*g 
^4/d*b*B*a^3*c*x-2*g^4/d^2*b^2*B*a^2*c^2*x+g^4/d^3*b^3*B*a*c^3*x+1/3*g^4/d 
*b^3*B*a*c*x^3+g^4/d*b^2*B*a^2*c*x^2-1/2*g^4/d^2*b^3*B*a*c^2*x^2-3/5*g^4*b 
*B*a^3*x^2+1/10*g^4/d^3*b^4*B*c^3*x^2+g^4*A*a^4*x+1/5*g^4*b^4*A*x^5+1/5*(b 
*x+a)^5*g^4*B/b*ln(e*(d*x+c)/(b*x+a))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 433 vs. \(2 (168) = 336\).

Time = 0.13 (sec) , antiderivative size = 433, normalized size of antiderivative = 2.41 \[ \int (a g+b g x)^4 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx=\frac {12 \, A b^{5} d^{5} g^{4} x^{5} - 12 \, B a^{5} d^{5} g^{4} \log \left (b x + a\right ) + 3 \, {\left (B b^{5} c d^{4} + {\left (20 \, A - B\right )} a b^{4} d^{5}\right )} g^{4} x^{4} - 4 \, {\left (B b^{5} c^{2} d^{3} - 5 \, B a b^{4} c d^{4} - 2 \, {\left (15 \, A - 2 \, B\right )} a^{2} b^{3} d^{5}\right )} g^{4} x^{3} + 6 \, {\left (B b^{5} c^{3} d^{2} - 5 \, B a b^{4} c^{2} d^{3} + 10 \, B a^{2} b^{3} c d^{4} + 2 \, {\left (10 \, A - 3 \, B\right )} a^{3} b^{2} d^{5}\right )} g^{4} x^{2} - 12 \, {\left (B b^{5} c^{4} d - 5 \, B a b^{4} c^{3} d^{2} + 10 \, B a^{2} b^{3} c^{2} d^{3} - 10 \, B a^{3} b^{2} c d^{4} - {\left (5 \, A - 4 \, B\right )} a^{4} b d^{5}\right )} g^{4} x + 12 \, {\left (B b^{5} c^{5} - 5 \, B a b^{4} c^{4} d + 10 \, B a^{2} b^{3} c^{3} d^{2} - 10 \, B a^{3} b^{2} c^{2} d^{3} + 5 \, B a^{4} b c d^{4}\right )} g^{4} \log \left (d x + c\right ) + 12 \, {\left (B b^{5} d^{5} g^{4} x^{5} + 5 \, B a b^{4} d^{5} g^{4} x^{4} + 10 \, B a^{2} b^{3} d^{5} g^{4} x^{3} + 10 \, B a^{3} b^{2} d^{5} g^{4} x^{2} + 5 \, B a^{4} b d^{5} g^{4} x\right )} \log \left (\frac {d e x + c e}{b x + a}\right )}{60 \, b d^{5}} \] Input:

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

Output:

1/60*(12*A*b^5*d^5*g^4*x^5 - 12*B*a^5*d^5*g^4*log(b*x + a) + 3*(B*b^5*c*d^ 
4 + (20*A - B)*a*b^4*d^5)*g^4*x^4 - 4*(B*b^5*c^2*d^3 - 5*B*a*b^4*c*d^4 - 2 
*(15*A - 2*B)*a^2*b^3*d^5)*g^4*x^3 + 6*(B*b^5*c^3*d^2 - 5*B*a*b^4*c^2*d^3 
+ 10*B*a^2*b^3*c*d^4 + 2*(10*A - 3*B)*a^3*b^2*d^5)*g^4*x^2 - 12*(B*b^5*c^4 
*d - 5*B*a*b^4*c^3*d^2 + 10*B*a^2*b^3*c^2*d^3 - 10*B*a^3*b^2*c*d^4 - (5*A 
- 4*B)*a^4*b*d^5)*g^4*x + 12*(B*b^5*c^5 - 5*B*a*b^4*c^4*d + 10*B*a^2*b^3*c 
^3*d^2 - 10*B*a^3*b^2*c^2*d^3 + 5*B*a^4*b*c*d^4)*g^4*log(d*x + c) + 12*(B* 
b^5*d^5*g^4*x^5 + 5*B*a*b^4*d^5*g^4*x^4 + 10*B*a^2*b^3*d^5*g^4*x^3 + 10*B* 
a^3*b^2*d^5*g^4*x^2 + 5*B*a^4*b*d^5*g^4*x)*log((d*e*x + c*e)/(b*x + a)))/( 
b*d^5)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 969 vs. \(2 (155) = 310\).

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

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

Output:

A*b**4*g**4*x**5/5 - B*a**5*g**4*log(x + (B*a**6*d**5*g**4/b + 5*B*a**5*c* 
d**4*g**4 - 10*B*a**4*b*c**2*d**3*g**4 + 10*B*a**3*b**2*c**3*d**2*g**4 - 5 
*B*a**2*b**3*c**4*d*g**4 + B*a*b**4*c**5*g**4)/(B*a**5*d**5*g**4 + 5*B*a** 
4*b*c*d**4*g**4 - 10*B*a**3*b**2*c**2*d**3*g**4 + 10*B*a**2*b**3*c**3*d**2 
*g**4 - 5*B*a*b**4*c**4*d*g**4 + B*b**5*c**5*g**4))/(5*b) + B*c*g**4*(5*a* 
*4*d**4 - 10*a**3*b*c*d**3 + 10*a**2*b**2*c**2*d**2 - 5*a*b**3*c**3*d + b* 
*4*c**4)*log(x + (6*B*a**5*c*d**4*g**4 - 10*B*a**4*b*c**2*d**3*g**4 + 10*B 
*a**3*b**2*c**3*d**2*g**4 - 5*B*a**2*b**3*c**4*d*g**4 + B*a*b**4*c**5*g**4 
 - B*a*c*g**4*(5*a**4*d**4 - 10*a**3*b*c*d**3 + 10*a**2*b**2*c**2*d**2 - 5 
*a*b**3*c**3*d + b**4*c**4) + B*b*c**2*g**4*(5*a**4*d**4 - 10*a**3*b*c*d** 
3 + 10*a**2*b**2*c**2*d**2 - 5*a*b**3*c**3*d + b**4*c**4)/d)/(B*a**5*d**5* 
g**4 + 5*B*a**4*b*c*d**4*g**4 - 10*B*a**3*b**2*c**2*d**3*g**4 + 10*B*a**2* 
b**3*c**3*d**2*g**4 - 5*B*a*b**4*c**4*d*g**4 + B*b**5*c**5*g**4))/(5*d**5) 
 + x**4*(A*a*b**3*g**4 - B*a*b**3*g**4/20 + B*b**4*c*g**4/(20*d)) + x**3*( 
2*A*a**2*b**2*g**4 - 4*B*a**2*b**2*g**4/15 + B*a*b**3*c*g**4/(3*d) - B*b** 
4*c**2*g**4/(15*d**2)) + x**2*(2*A*a**3*b*g**4 - 3*B*a**3*b*g**4/5 + B*a** 
2*b**2*c*g**4/d - B*a*b**3*c**2*g**4/(2*d**2) + B*b**4*c**3*g**4/(10*d**3) 
) + x*(A*a**4*g**4 - 4*B*a**4*g**4/5 + 2*B*a**3*b*c*g**4/d - 2*B*a**2*b**2 
*c**2*g**4/d**2 + B*a*b**3*c**3*g**4/d**3 - B*b**4*c**4*g**4/(5*d**4)) + ( 
B*a**4*g**4*x + 2*B*a**3*b*g**4*x**2 + 2*B*a**2*b**2*g**4*x**3 + B*a*b*...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 619 vs. \(2 (168) = 336\).

Time = 0.05 (sec) , antiderivative size = 619, normalized size of antiderivative = 3.44 \[ \int (a g+b g x)^4 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx=\frac {1}{5} \, A b^{4} g^{4} x^{5} + A a b^{3} g^{4} x^{4} + 2 \, A a^{2} b^{2} g^{4} x^{3} + 2 \, A a^{3} b g^{4} x^{2} + {\left (x \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) - \frac {a \log \left (b x + a\right )}{b} + \frac {c \log \left (d x + c\right )}{d}\right )} B a^{4} g^{4} + 2 \, {\left (x^{2} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) + \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^{3} b g^{4} + {\left (2 \, x^{3} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) - \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^{2} b^{2} g^{4} + \frac {1}{6} \, {\left (6 \, x^{4} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) + \frac {6 \, a^{4} \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} x^{2} + 6 \, {\left (b^{3} c^{3} - a^{3} d^{3}\right )} x}{b^{3} d^{3}}\right )} B a b^{3} g^{4} + \frac {1}{60} \, {\left (12 \, x^{5} \log \left (\frac {d e x}{b x + a} + \frac {c e}{b x + a}\right ) - \frac {12 \, a^{5} \log \left (b x + a\right )}{b^{5}} + \frac {12 \, c^{5} \log \left (d x + c\right )}{d^{5}} + \frac {3 \, {\left (b^{4} c d^{3} - a b^{3} d^{4}\right )} x^{4} - 4 \, {\left (b^{4} c^{2} d^{2} - a^{2} b^{2} d^{4}\right )} x^{3} + 6 \, {\left (b^{4} c^{3} d - a^{3} b d^{4}\right )} x^{2} - 12 \, {\left (b^{4} c^{4} - a^{4} d^{4}\right )} x}{b^{4} d^{4}}\right )} B b^{4} g^{4} + A a^{4} g^{4} x \] Input:

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

Output:

1/5*A*b^4*g^4*x^5 + A*a*b^3*g^4*x^4 + 2*A*a^2*b^2*g^4*x^3 + 2*A*a^3*b*g^4* 
x^2 + (x*log(d*e*x/(b*x + a) + c*e/(b*x + a)) - a*log(b*x + a)/b + c*log(d 
*x + c)/d)*B*a^4*g^4 + 2*(x^2*log(d*e*x/(b*x + a) + c*e/(b*x + a)) + a^2*l 
og(b*x + a)/b^2 - c^2*log(d*x + c)/d^2 + (b*c - a*d)*x/(b*d))*B*a^3*b*g^4 
+ (2*x^3*log(d*e*x/(b*x + a) + c*e/(b*x + a)) - 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^2*b^2*g^4 + 1/6*(6*x^4*log(d*e*x/(b*x + a) + c*e/(b*x + a 
)) + 6*a^4*log(b*x + a)/b^4 - 6*c^4*log(d*x + c)/d^4 + (2*(b^3*c*d^2 - a*b 
^2*d^3)*x^3 - 3*(b^3*c^2*d - a^2*b*d^3)*x^2 + 6*(b^3*c^3 - a^3*d^3)*x)/(b^ 
3*d^3))*B*a*b^3*g^4 + 1/60*(12*x^5*log(d*e*x/(b*x + a) + c*e/(b*x + a)) - 
12*a^5*log(b*x + a)/b^5 + 12*c^5*log(d*x + c)/d^5 + (3*(b^4*c*d^3 - a*b^3* 
d^4)*x^4 - 4*(b^4*c^2*d^2 - a^2*b^2*d^4)*x^3 + 6*(b^4*c^3*d - a^3*b*d^4)*x 
^2 - 12*(b^4*c^4 - a^4*d^4)*x)/(b^4*d^4))*B*b^4*g^4 + A*a^4*g^4*x
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2030 vs. \(2 (168) = 336\).

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

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

Output:

-1/60*(12*(B*b^6*c^6*e^6*g^4 - 6*B*a*b^5*c^5*d*e^6*g^4 + 15*B*a^2*b^4*c^4* 
d^2*e^6*g^4 - 20*B*a^3*b^3*c^3*d^3*e^6*g^4 + 15*B*a^4*b^2*c^2*d^4*e^6*g^4 
- 6*B*a^5*b*c*d^5*e^6*g^4 + B*a^6*d^6*e^6*g^4)*log((d*e*x + c*e)/(b*x + a) 
)/(b*d^5*e^5 - 5*(d*e*x + c*e)*b^2*d^4*e^4/(b*x + a) + 10*(d*e*x + c*e)^2* 
b^3*d^3*e^3/(b*x + a)^2 - 10*(d*e*x + c*e)^3*b^4*d^2*e^2/(b*x + a)^3 + 5*( 
d*e*x + c*e)^4*b^5*d*e/(b*x + a)^4 - (d*e*x + c*e)^5*b^6/(b*x + a)^5) + (1 
2*A*b^6*c^6*d^4*e^6*g^4 - 25*B*b^6*c^6*d^4*e^6*g^4 - 72*A*a*b^5*c^5*d^5*e^ 
6*g^4 + 150*B*a*b^5*c^5*d^5*e^6*g^4 + 180*A*a^2*b^4*c^4*d^6*e^6*g^4 - 375* 
B*a^2*b^4*c^4*d^6*e^6*g^4 - 240*A*a^3*b^3*c^3*d^7*e^6*g^4 + 500*B*a^3*b^3* 
c^3*d^7*e^6*g^4 + 180*A*a^4*b^2*c^2*d^8*e^6*g^4 - 375*B*a^4*b^2*c^2*d^8*e^ 
6*g^4 - 72*A*a^5*b*c*d^9*e^6*g^4 + 150*B*a^5*b*c*d^9*e^6*g^4 + 12*A*a^6*d^ 
10*e^6*g^4 - 25*B*a^6*d^10*e^6*g^4 + 77*(d*e*x + c*e)*B*b^7*c^6*d^3*e^5*g^ 
4/(b*x + a) - 462*(d*e*x + c*e)*B*a*b^6*c^5*d^4*e^5*g^4/(b*x + a) + 1155*( 
d*e*x + c*e)*B*a^2*b^5*c^4*d^5*e^5*g^4/(b*x + a) - 1540*(d*e*x + c*e)*B*a^ 
3*b^4*c^3*d^6*e^5*g^4/(b*x + a) + 1155*(d*e*x + c*e)*B*a^4*b^3*c^2*d^7*e^5 
*g^4/(b*x + a) - 462*(d*e*x + c*e)*B*a^5*b^2*c*d^8*e^5*g^4/(b*x + a) + 77* 
(d*e*x + c*e)*B*a^6*b*d^9*e^5*g^4/(b*x + a) - 94*(d*e*x + c*e)^2*B*b^8*c^6 
*d^2*e^4*g^4/(b*x + a)^2 + 564*(d*e*x + c*e)^2*B*a*b^7*c^5*d^3*e^4*g^4/(b* 
x + a)^2 - 1410*(d*e*x + c*e)^2*B*a^2*b^6*c^4*d^4*e^4*g^4/(b*x + a)^2 + 18 
80*(d*e*x + c*e)^2*B*a^3*b^5*c^3*d^5*e^4*g^4/(b*x + a)^2 - 1410*(d*e*x ...
 

Mupad [B] (verification not implemented)

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

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

Output:

log((e*(c + d*x))/(a + b*x))*((B*b^4*g^4*x^5)/5 + B*a^4*g^4*x + 2*B*a^3*b* 
g^4*x^2 + B*a*b^3*g^4*x^4 + 2*B*a^2*b^2*g^4*x^3) - x^3*((((b^3*g^4*(25*A*a 
*d + 5*A*b*c - B*a*d + B*b*c))/(5*d) - (A*b^3*g^4*(5*a*d + 5*b*c))/(5*d))* 
(5*a*d + 5*b*c))/(15*b*d) - (a*b^2*g^4*(10*A*a*d + 5*A*b*c - B*a*d + B*b*c 
))/(3*d) + (A*a*b^3*c*g^4)/(3*d)) + x^2*(((5*a*d + 5*b*c)*((((b^3*g^4*(25* 
A*a*d + 5*A*b*c - B*a*d + B*b*c))/(5*d) - (A*b^3*g^4*(5*a*d + 5*b*c))/(5*d 
))*(5*a*d + 5*b*c))/(5*b*d) - (a*b^2*g^4*(10*A*a*d + 5*A*b*c - B*a*d + B*b 
*c))/d + (A*a*b^3*c*g^4)/d))/(10*b*d) + (a^2*b*g^4*(5*A*a*d + 5*A*b*c - B* 
a*d + B*b*c))/d - (a*c*((b^3*g^4*(25*A*a*d + 5*A*b*c - B*a*d + B*b*c))/(5* 
d) - (A*b^3*g^4*(5*a*d + 5*b*c))/(5*d)))/(2*b*d)) + x*((a^3*g^4*(5*A*a*d + 
 10*A*b*c - 2*B*a*d + 2*B*b*c))/d - ((5*a*d + 5*b*c)*(((5*a*d + 5*b*c)*((( 
(b^3*g^4*(25*A*a*d + 5*A*b*c - B*a*d + B*b*c))/(5*d) - (A*b^3*g^4*(5*a*d + 
 5*b*c))/(5*d))*(5*a*d + 5*b*c))/(5*b*d) - (a*b^2*g^4*(10*A*a*d + 5*A*b*c 
- B*a*d + B*b*c))/d + (A*a*b^3*c*g^4)/d))/(5*b*d) + (2*a^2*b*g^4*(5*A*a*d 
+ 5*A*b*c - B*a*d + B*b*c))/d - (a*c*((b^3*g^4*(25*A*a*d + 5*A*b*c - B*a*d 
 + B*b*c))/(5*d) - (A*b^3*g^4*(5*a*d + 5*b*c))/(5*d)))/(b*d)))/(5*b*d) + ( 
a*c*((((b^3*g^4*(25*A*a*d + 5*A*b*c - B*a*d + B*b*c))/(5*d) - (A*b^3*g^4*( 
5*a*d + 5*b*c))/(5*d))*(5*a*d + 5*b*c))/(5*b*d) - (a*b^2*g^4*(10*A*a*d + 5 
*A*b*c - B*a*d + B*b*c))/d + (A*a*b^3*c*g^4)/d))/(b*d)) + x^4*((b^3*g^4*(2 
5*A*a*d + 5*A*b*c - B*a*d + B*b*c))/(20*d) - (A*b^3*g^4*(5*a*d + 5*b*c)...
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 525, normalized size of antiderivative = 2.92 \[ \int (a g+b g x)^4 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx=\frac {g^{4} \left (-48 a^{4} b \,d^{5} x -36 a^{3} b^{2} d^{5} x^{2}-16 a^{2} b^{3} d^{5} x^{3}-3 a \,b^{4} d^{5} x^{4}-12 b^{5} c^{4} d x +6 b^{5} c^{3} d^{2} x^{2}-4 b^{5} c^{2} d^{3} x^{3}+3 b^{5} c \,d^{4} x^{4}+12 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) a^{5} d^{5}+60 a^{5} d^{5} x -30 a \,b^{4} c^{2} d^{3} x^{2}+20 a \,b^{4} c \,d^{4} x^{3}-12 \,\mathrm {log}\left (d x +c \right ) a^{5} d^{5}+12 \,\mathrm {log}\left (d x +c \right ) b^{5} c^{5}+120 a^{4} b \,d^{5} x^{2}+120 a^{3} b^{2} d^{5} x^{3}+60 a^{2} b^{3} d^{5} x^{4}+12 a \,b^{4} d^{5} x^{5}+60 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) a^{4} b \,d^{5} x +120 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) a^{3} b^{2} d^{5} x^{2}+120 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) a^{2} b^{3} d^{5} x^{3}+60 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) a \,b^{4} d^{5} x^{4}+12 \,\mathrm {log}\left (\frac {d e x +c e}{b x +a}\right ) b^{5} d^{5} x^{5}+60 \,\mathrm {log}\left (d x +c \right ) a^{4} b c \,d^{4}-120 \,\mathrm {log}\left (d x +c \right ) a^{3} b^{2} c^{2} d^{3}+120 \,\mathrm {log}\left (d x +c \right ) a^{2} b^{3} c^{3} d^{2}-60 \,\mathrm {log}\left (d x +c \right ) a \,b^{4} c^{4} d +120 a^{3} b^{2} c \,d^{4} x -120 a^{2} b^{3} c^{2} d^{3} x +60 a^{2} b^{3} c \,d^{4} x^{2}+60 a \,b^{4} c^{3} d^{2} x \right )}{60 d^{5}} \] Input:

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

Output:

(g**4*( - 12*log(c + d*x)*a**5*d**5 + 60*log(c + d*x)*a**4*b*c*d**4 - 120* 
log(c + d*x)*a**3*b**2*c**2*d**3 + 120*log(c + d*x)*a**2*b**3*c**3*d**2 - 
60*log(c + d*x)*a*b**4*c**4*d + 12*log(c + d*x)*b**5*c**5 + 12*log((c*e + 
d*e*x)/(a + b*x))*a**5*d**5 + 60*log((c*e + d*e*x)/(a + b*x))*a**4*b*d**5* 
x + 120*log((c*e + d*e*x)/(a + b*x))*a**3*b**2*d**5*x**2 + 120*log((c*e + 
d*e*x)/(a + b*x))*a**2*b**3*d**5*x**3 + 60*log((c*e + d*e*x)/(a + b*x))*a* 
b**4*d**5*x**4 + 12*log((c*e + d*e*x)/(a + b*x))*b**5*d**5*x**5 + 60*a**5* 
d**5*x + 120*a**4*b*d**5*x**2 - 48*a**4*b*d**5*x + 120*a**3*b**2*c*d**4*x 
+ 120*a**3*b**2*d**5*x**3 - 36*a**3*b**2*d**5*x**2 - 120*a**2*b**3*c**2*d* 
*3*x + 60*a**2*b**3*c*d**4*x**2 + 60*a**2*b**3*d**5*x**4 - 16*a**2*b**3*d* 
*5*x**3 + 60*a*b**4*c**3*d**2*x - 30*a*b**4*c**2*d**3*x**2 + 20*a*b**4*c*d 
**4*x**3 + 12*a*b**4*d**5*x**5 - 3*a*b**4*d**5*x**4 - 12*b**5*c**4*d*x + 6 
*b**5*c**3*d**2*x**2 - 4*b**5*c**2*d**3*x**3 + 3*b**5*c*d**4*x**4))/(60*d* 
*5)