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

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

Optimal result

Integrand size = 27, antiderivative size = 227 \[ \int (f+g x)^3 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \, dx=-\frac {B (b c-a d) g \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right ) x}{4 b^3 d^3}-\frac {B (b c-a d) g^2 (4 b d f-b c g-a d g) x^2}{8 b^2 d^2}-\frac {B (b c-a d) g^3 x^3}{12 b d}-\frac {B (b f-a g)^4 \log (a+b x)}{4 b^4 g}+\frac {(f+g x)^4 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{4 g}+\frac {B (d f-c g)^4 \log (c+d x)}{4 d^4 g} \] Output:

-1/4*B*(-a*d+b*c)*g*(a^2*d^2*g^2-a*b*d*g*(-c*g+4*d*f)+b^2*(c^2*g^2-4*c*d*f 
*g+6*d^2*f^2))*x/b^3/d^3-1/8*B*(-a*d+b*c)*g^2*(-a*d*g-b*c*g+4*b*d*f)*x^2/b 
^2/d^2-1/12*B*(-a*d+b*c)*g^3*x^3/b/d-1/4*B*(-a*g+b*f)^4*ln(b*x+a)/b^4/g+1/ 
4*(g*x+f)^4*(A+B*ln(e*(b*x+a)/(d*x+c)))/g+1/4*B*(-c*g+d*f)^4*ln(d*x+c)/d^4 
/g
 

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.53 (sec) , antiderivative size = 223, normalized size of antiderivative = 0.98, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2948, 93, 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 (f+g x)^3 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2948

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

\(\Big \downarrow \) 93

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 93
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), 
x_] :> Int[ExpandIntegrand[(e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; Fre 
eQ[{a, b, c, d, e, f}, x] && IntegerQ[p]
 

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 [A] (verified)

Time = 1.08 (sec) , antiderivative size = 412, normalized size of antiderivative = 1.81

method result size
risch \(\frac {g^{3} B \ln \left (-d x -c \right ) c^{4}}{4 d^{4}}-\frac {g^{3} B \ln \left (b x +a \right ) a^{4}}{4 b^{4}}-\frac {B \ln \left (-d x -c \right ) c \,f^{3}}{d}+\frac {B \ln \left (b x +a \right ) a \,f^{3}}{b}-\frac {g^{3} B \,a^{2} x^{2}}{8 b^{2}}+\frac {g^{3} B \,c^{2} x^{2}}{8 d^{2}}+A \,f^{3} x +\frac {g^{3} B \,a^{3} x}{4 b^{3}}+\frac {\left (g x +f \right )^{4} B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right )}{4 g}+\frac {B \ln \left (-d x -c \right ) f^{4}}{4 g}-\frac {B \ln \left (b x +a \right ) f^{4}}{4 g}-\frac {g^{3} B \,c^{3} x}{4 d^{3}}-\frac {g^{2} B \ln \left (-d x -c \right ) c^{3} f}{d^{3}}+\frac {3 g B \ln \left (-d x -c \right ) c^{2} f^{2}}{2 d^{2}}+\frac {g^{2} B \ln \left (b x +a \right ) a^{3} f}{b^{3}}-\frac {3 g B \ln \left (b x +a \right ) a^{2} f^{2}}{2 b^{2}}-\frac {g^{3} B c \,x^{3}}{12 d}+\frac {g^{2} B a f \,x^{2}}{2 b}-\frac {g^{2} B c f \,x^{2}}{2 d}-\frac {g^{2} B \,a^{2} f x}{b^{2}}+\frac {3 g B a \,f^{2} x}{2 b}+g^{2} A f \,x^{3}+\frac {g^{3} B a \,x^{3}}{12 b}+\frac {3 g A \,f^{2} x^{2}}{2}+\frac {g^{3} A \,x^{4}}{4}+\frac {g^{2} B \,c^{2} f x}{d^{2}}-\frac {3 g B c \,f^{2} x}{2 d}\) \(412\)
parallelrisch \(\frac {-24 B \ln \left (b x +a \right ) b^{4} c \,d^{3} f^{3}+24 B \ln \left (b x +a \right ) a \,b^{3} d^{4} f^{3}+6 B \,x^{4} \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} d^{4} g^{3}+24 A \,x^{3} b^{4} d^{4} f \,g^{2}+36 A \,x^{2} b^{4} d^{4} f^{2} g +24 B x \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} d^{4} f^{3}+24 B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} c \,d^{3} f^{3}+2 B \,x^{3} a \,b^{3} d^{4} g^{3}-2 B \,x^{3} b^{4} c \,d^{3} g^{3}-3 B \,x^{2} a^{2} b^{2} d^{4} g^{3}+24 B x \,b^{4} c^{2} d^{2} f \,g^{2}-36 B x \,b^{4} c \,d^{3} f^{2} g +24 B \,a^{3} b \,d^{4} f \,g^{2}-3 B \,a^{3} b c \,d^{3} g^{3}+3 B a \,b^{3} c^{3} d \,g^{3}-6 B \,a^{4} d^{4} g^{3}+6 B \,b^{4} c^{4} g^{3}-36 B \,a^{2} b^{2} d^{4} f^{2} g -24 B \,b^{4} c^{3} d f \,g^{2}+36 B \,b^{4} c^{2} d^{2} f^{2} g -6 B x \,b^{4} c^{3} d \,g^{3}+36 B \,x^{2} \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} d^{4} f^{2} g +12 B \,x^{2} a \,b^{3} d^{4} f \,g^{2}-12 B \,x^{2} b^{4} c \,d^{3} f \,g^{2}-24 B x \,a^{2} b^{2} d^{4} f \,g^{2}+36 B x a \,b^{3} d^{4} f^{2} g +6 B x \,a^{3} b \,d^{4} g^{3}+3 B \,x^{2} b^{4} c^{2} d^{2} g^{3}+24 B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} c^{3} d f \,g^{2}-36 B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} c^{2} d^{2} f^{2} g +24 B \ln \left (b x +a \right ) a^{3} b \,d^{4} f \,g^{2}-36 B \ln \left (b x +a \right ) a^{2} b^{2} d^{4} f^{2} g -24 B \ln \left (b x +a \right ) b^{4} c^{3} d f \,g^{2}+36 B \ln \left (b x +a \right ) b^{4} c^{2} d^{2} f^{2} g +24 B \,x^{3} \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} d^{4} f \,g^{2}-36 A a \,b^{3} c \,d^{3} f^{2} g +12 B \,a^{2} b^{2} c \,d^{3} f \,g^{2}-12 B a \,b^{3} c^{2} d^{2} f \,g^{2}+6 A \,x^{4} b^{4} d^{4} g^{3}-6 B \ln \left (b x +a \right ) a^{4} d^{4} g^{3}+6 B \ln \left (b x +a \right ) b^{4} c^{4} g^{3}-24 A a \,b^{3} d^{4} f^{3}-24 A \,b^{4} c \,d^{3} f^{3}+24 A x \,b^{4} d^{4} f^{3}-6 B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right ) b^{4} c^{4} g^{3}}{24 b^{4} d^{4}}\) \(844\)
parts \(\text {Expression too large to display}\) \(1332\)
derivativedivides \(\text {Expression too large to display}\) \(1691\)
default \(\text {Expression too large to display}\) \(1691\)

Input:

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

Output:

1/4/d^4*g^3*B*ln(-d*x-c)*c^4-1/4/b^4*g^3*B*ln(b*x+a)*a^4-1/d*B*ln(-d*x-c)* 
c*f^3+1/b*B*ln(b*x+a)*a*f^3-1/8/b^2*g^3*B*a^2*x^2+1/8/d^2*g^3*B*c^2*x^2+A* 
f^3*x+1/4/b^3*g^3*B*a^3*x+1/4*(g*x+f)^4*B/g*ln(e*(b*x+a)/(d*x+c))+1/4/g*B* 
ln(-d*x-c)*f^4-1/4/g*B*ln(b*x+a)*f^4-1/4/d^3*g^3*B*c^3*x-1/d^3*g^2*B*ln(-d 
*x-c)*c^3*f+3/2/d^2*g*B*ln(-d*x-c)*c^2*f^2+1/b^3*g^2*B*ln(b*x+a)*a^3*f-3/2 
/b^2*g*B*ln(b*x+a)*a^2*f^2-1/12/d*g^3*B*c*x^3+1/2/b*g^2*B*a*f*x^2-1/2/d*g^ 
2*B*c*f*x^2-1/b^2*g^2*B*a^2*f*x+3/2/b*g*B*a*f^2*x+g^2*A*f*x^3+1/12/b*g^3*B 
*a*x^3+3/2*g*A*f^2*x^2+1/4*g^3*A*x^4+1/d^2*g^2*B*c^2*f*x-3/2/d*g*B*c*f^2*x
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 445 vs. \(2 (215) = 430\).

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

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

Output:

1/24*(6*A*b^4*d^4*g^3*x^4 + 2*(12*A*b^4*d^4*f*g^2 - (B*b^4*c*d^3 - B*a*b^3 
*d^4)*g^3)*x^3 + 3*(12*A*b^4*d^4*f^2*g - 4*(B*b^4*c*d^3 - B*a*b^3*d^4)*f*g 
^2 + (B*b^4*c^2*d^2 - B*a^2*b^2*d^4)*g^3)*x^2 + 6*(4*A*b^4*d^4*f^3 - 6*(B* 
b^4*c*d^3 - B*a*b^3*d^4)*f^2*g + 4*(B*b^4*c^2*d^2 - B*a^2*b^2*d^4)*f*g^2 - 
 (B*b^4*c^3*d - B*a^3*b*d^4)*g^3)*x + 6*(4*B*a*b^3*d^4*f^3 - 6*B*a^2*b^2*d 
^4*f^2*g + 4*B*a^3*b*d^4*f*g^2 - B*a^4*d^4*g^3)*log(b*x + a) - 6*(4*B*b^4* 
c*d^3*f^3 - 6*B*b^4*c^2*d^2*f^2*g + 4*B*b^4*c^3*d*f*g^2 - B*b^4*c^4*g^3)*l 
og(d*x + c) + 6*(B*b^4*d^4*g^3*x^4 + 4*B*b^4*d^4*f*g^2*x^3 + 6*B*b^4*d^4*f 
^2*g*x^2 + 4*B*b^4*d^4*f^3*x)*log((b*e*x + a*e)/(d*x + c)))/(b^4*d^4)
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 998 vs. \(2 (207) = 414\).

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

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

Output:

A*g**3*x**4/4 - B*a*(a*g - 2*b*f)*(a**2*g**2 - 2*a*b*f*g + 2*b**2*f**2)*lo 
g(x + (B*a**4*c*d**3*g**3 - 4*B*a**3*b*c*d**3*f*g**2 + 6*B*a**2*b**2*c*d** 
3*f**2*g + B*a**2*d**4*(a*g - 2*b*f)*(a**2*g**2 - 2*a*b*f*g + 2*b**2*f**2) 
/b + B*a*b**3*c**4*g**3 - 4*B*a*b**3*c**3*d*f*g**2 + 6*B*a*b**3*c**2*d**2* 
f**2*g - 8*B*a*b**3*c*d**3*f**3 - B*a*c*d**3*(a*g - 2*b*f)*(a**2*g**2 - 2* 
a*b*f*g + 2*b**2*f**2))/(B*a**4*d**4*g**3 - 4*B*a**3*b*d**4*f*g**2 + 6*B*a 
**2*b**2*d**4*f**2*g - 4*B*a*b**3*d**4*f**3 + B*b**4*c**4*g**3 - 4*B*b**4* 
c**3*d*f*g**2 + 6*B*b**4*c**2*d**2*f**2*g - 4*B*b**4*c*d**3*f**3))/(4*b**4 
) + B*c*(c*g - 2*d*f)*(c**2*g**2 - 2*c*d*f*g + 2*d**2*f**2)*log(x + (B*a** 
4*c*d**3*g**3 - 4*B*a**3*b*c*d**3*f*g**2 + 6*B*a**2*b**2*c*d**3*f**2*g + B 
*a*b**3*c**4*g**3 - 4*B*a*b**3*c**3*d*f*g**2 + 6*B*a*b**3*c**2*d**2*f**2*g 
 - 8*B*a*b**3*c*d**3*f**3 - B*a*b**3*c*(c*g - 2*d*f)*(c**2*g**2 - 2*c*d*f* 
g + 2*d**2*f**2) + B*b**4*c**2*(c*g - 2*d*f)*(c**2*g**2 - 2*c*d*f*g + 2*d* 
*2*f**2)/d)/(B*a**4*d**4*g**3 - 4*B*a**3*b*d**4*f*g**2 + 6*B*a**2*b**2*d** 
4*f**2*g - 4*B*a*b**3*d**4*f**3 + B*b**4*c**4*g**3 - 4*B*b**4*c**3*d*f*g** 
2 + 6*B*b**4*c**2*d**2*f**2*g - 4*B*b**4*c*d**3*f**3))/(4*d**4) + x**3*(A* 
f*g**2 + B*a*g**3/(12*b) - B*c*g**3/(12*d)) + x**2*(3*A*f**2*g/2 - B*a**2* 
g**3/(8*b**2) + B*a*f*g**2/(2*b) + B*c**2*g**3/(8*d**2) - B*c*f*g**2/(2*d) 
) + x*(A*f**3 + B*a**3*g**3/(4*b**3) - B*a**2*f*g**2/b**2 + 3*B*a*f**2*g/( 
2*b) - B*c**3*g**3/(4*d**3) + B*c**2*f*g**2/d**2 - 3*B*c*f**2*g/(2*d)) ...
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 6073 vs. \(2 (215) = 430\).

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

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

Output:

1/24*(6*(4*B*b^5*c^2*d^3*e^5*f^3 - 8*B*a*b^4*c*d^4*e^5*f^3 + 4*B*a^2*b^3*d 
^5*e^5*f^3 - 6*B*b^5*c^3*d^2*e^5*f^2*g + 6*B*a*b^4*c^2*d^3*e^5*f^2*g + 6*B 
*a^2*b^3*c*d^4*e^5*f^2*g - 6*B*a^3*b^2*d^5*e^5*f^2*g + 4*B*b^5*c^4*d*e^5*f 
*g^2 - 4*B*a*b^4*c^3*d^2*e^5*f*g^2 - 4*B*a^3*b^2*c*d^4*e^5*f*g^2 + 4*B*a^4 
*b*d^5*e^5*f*g^2 - B*b^5*c^5*e^5*g^3 + B*a*b^4*c^4*d*e^5*g^3 + B*a^4*b*c*d 
^4*e^5*g^3 - B*a^5*d^5*e^5*g^3 - 12*(b*e*x + a*e)*B*b^4*c^2*d^4*e^4*f^3/(d 
*x + c) + 24*(b*e*x + a*e)*B*a*b^3*c*d^5*e^4*f^3/(d*x + c) - 12*(b*e*x + a 
*e)*B*a^2*b^2*d^6*e^4*f^3/(d*x + c) + 24*(b*e*x + a*e)*B*b^4*c^3*d^3*e^4*f 
^2*g/(d*x + c) - 36*(b*e*x + a*e)*B*a*b^3*c^2*d^4*e^4*f^2*g/(d*x + c) + 12 
*(b*e*x + a*e)*B*a^3*b*d^6*e^4*f^2*g/(d*x + c) - 16*(b*e*x + a*e)*B*b^4*c^ 
4*d^2*e^4*f*g^2/(d*x + c) + 16*(b*e*x + a*e)*B*a*b^3*c^3*d^3*e^4*f*g^2/(d* 
x + c) + 12*(b*e*x + a*e)*B*a^2*b^2*c^2*d^4*e^4*f*g^2/(d*x + c) - 8*(b*e*x 
 + a*e)*B*a^3*b*c*d^5*e^4*f*g^2/(d*x + c) - 4*(b*e*x + a*e)*B*a^4*d^6*e^4* 
f*g^2/(d*x + c) + 4*(b*e*x + a*e)*B*b^4*c^5*d*e^4*g^3/(d*x + c) - 4*(b*e*x 
 + a*e)*B*a*b^3*c^4*d^2*e^4*g^3/(d*x + c) - 4*(b*e*x + a*e)*B*a^3*b*c^2*d^ 
4*e^4*g^3/(d*x + c) + 4*(b*e*x + a*e)*B*a^4*c*d^5*e^4*g^3/(d*x + c) + 12*( 
b*e*x + a*e)^2*B*b^3*c^2*d^5*e^3*f^3/(d*x + c)^2 - 24*(b*e*x + a*e)^2*B*a* 
b^2*c*d^6*e^3*f^3/(d*x + c)^2 + 12*(b*e*x + a*e)^2*B*a^2*b*d^7*e^3*f^3/(d* 
x + c)^2 - 30*(b*e*x + a*e)^2*B*b^3*c^3*d^4*e^3*f^2*g/(d*x + c)^2 + 54*(b* 
e*x + a*e)^2*B*a*b^2*c^2*d^5*e^3*f^2*g/(d*x + c)^2 - 18*(b*e*x + a*e)^2...
 

Mupad [B] (verification not implemented)

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

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

Output:

x*((4*A*b*d*f^3 + 12*A*a*c*f*g^2 + 12*A*a*d*f^2*g + 12*A*b*c*f^2*g + 6*B*a 
*d*f^2*g - 6*B*b*c*f^2*g)/(4*b*d) + ((4*a*d + 4*b*c)*((((4*A*a*d*g^3 + 4*A 
*b*c*g^3 + B*a*d*g^3 - B*b*c*g^3 + 12*A*b*d*f*g^2)/(4*b*d) - (A*g^3*(4*a*d 
 + 4*b*c))/(4*b*d))*(4*a*d + 4*b*c))/(4*b*d) - (4*A*a*c*g^3 + 12*A*a*d*f*g 
^2 + 12*A*b*c*f*g^2 + 12*A*b*d*f^2*g + 4*B*a*d*f*g^2 - 4*B*b*c*f*g^2)/(4*b 
*d) + (A*a*c*g^3)/(b*d)))/(4*b*d) - (a*c*((4*A*a*d*g^3 + 4*A*b*c*g^3 + B*a 
*d*g^3 - B*b*c*g^3 + 12*A*b*d*f*g^2)/(4*b*d) - (A*g^3*(4*a*d + 4*b*c))/(4* 
b*d)))/(b*d)) - x^2*((((4*A*a*d*g^3 + 4*A*b*c*g^3 + B*a*d*g^3 - B*b*c*g^3 
+ 12*A*b*d*f*g^2)/(4*b*d) - (A*g^3*(4*a*d + 4*b*c))/(4*b*d))*(4*a*d + 4*b* 
c))/(8*b*d) - (4*A*a*c*g^3 + 12*A*a*d*f*g^2 + 12*A*b*c*f*g^2 + 12*A*b*d*f^ 
2*g + 4*B*a*d*f*g^2 - 4*B*b*c*f*g^2)/(8*b*d) + (A*a*c*g^3)/(2*b*d)) + log( 
(e*(a + b*x))/(c + d*x))*((B*g^3*x^4)/4 + B*f^3*x + (3*B*f^2*g*x^2)/2 + B* 
f*g^2*x^3) + x^3*((4*A*a*d*g^3 + 4*A*b*c*g^3 + B*a*d*g^3 - B*b*c*g^3 + 12* 
A*b*d*f*g^2)/(12*b*d) - (A*g^3*(4*a*d + 4*b*c))/(12*b*d)) + (A*g^3*x^4)/4 
- (log(a + b*x)*(B*a^4*g^3 - 4*B*a*b^3*f^3 + 6*B*a^2*b^2*f^2*g - 4*B*a^3*b 
*f*g^2))/(4*b^4) + (log(c + d*x)*(B*c^4*g^3 - 4*B*c*d^3*f^3 + 6*B*c^2*d^2* 
f^2*g - 4*B*c^3*d*f*g^2))/(4*d^4)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 644, normalized size of antiderivative = 2.84 \[ \int (f+g x)^3 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \, dx=\frac {24 \,\mathrm {log}\left (d x +c \right ) a \,b^{3} d^{4} f^{3}-24 \,\mathrm {log}\left (d x +c \right ) b^{4} c \,d^{3} f^{3}+24 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) a \,b^{3} d^{4} f^{3}+24 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) b^{4} d^{4} f^{3} x +6 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) b^{4} d^{4} g^{3} x^{4}+6 a^{3} b \,d^{4} g^{3} x -3 a^{2} b^{2} d^{4} g^{3} x^{2}+2 a \,b^{3} d^{4} g^{3} x^{3}-6 b^{4} c^{3} d \,g^{3} x +3 b^{4} c^{2} d^{2} g^{3} x^{2}-2 b^{4} c \,d^{3} g^{3} x^{3}+12 a \,b^{3} d^{4} f \,g^{2} x^{2}+24 b^{4} c^{2} d^{2} f \,g^{2} x -36 b^{4} c \,d^{3} f^{2} g x -12 b^{4} c \,d^{3} f \,g^{2} x^{2}-6 \,\mathrm {log}\left (d x +c \right ) a^{4} d^{4} g^{3}+6 \,\mathrm {log}\left (d x +c \right ) b^{4} c^{4} g^{3}-6 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) a^{4} d^{4} g^{3}+24 a \,b^{3} d^{4} f^{3} x +6 a \,b^{3} d^{4} g^{3} x^{4}+24 \,\mathrm {log}\left (d x +c \right ) a^{3} b \,d^{4} f \,g^{2}-36 \,\mathrm {log}\left (d x +c \right ) a^{2} b^{2} d^{4} f^{2} g -24 \,\mathrm {log}\left (d x +c \right ) b^{4} c^{3} d f \,g^{2}+36 \,\mathrm {log}\left (d x +c \right ) b^{4} c^{2} d^{2} f^{2} g +24 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) a^{3} b \,d^{4} f \,g^{2}-36 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) a^{2} b^{2} d^{4} f^{2} g +36 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) b^{4} d^{4} f^{2} g \,x^{2}+24 \,\mathrm {log}\left (\frac {b e x +a e}{d x +c}\right ) b^{4} d^{4} f \,g^{2} x^{3}-24 a^{2} b^{2} d^{4} f \,g^{2} x +36 a \,b^{3} d^{4} f^{2} g x +36 a \,b^{3} d^{4} f^{2} g \,x^{2}+24 a \,b^{3} d^{4} f \,g^{2} x^{3}}{24 b^{3} d^{4}} \] Input:

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

Output:

( - 6*log(c + d*x)*a**4*d**4*g**3 + 24*log(c + d*x)*a**3*b*d**4*f*g**2 - 3 
6*log(c + d*x)*a**2*b**2*d**4*f**2*g + 24*log(c + d*x)*a*b**3*d**4*f**3 + 
6*log(c + d*x)*b**4*c**4*g**3 - 24*log(c + d*x)*b**4*c**3*d*f*g**2 + 36*lo 
g(c + d*x)*b**4*c**2*d**2*f**2*g - 24*log(c + d*x)*b**4*c*d**3*f**3 - 6*lo 
g((a*e + b*e*x)/(c + d*x))*a**4*d**4*g**3 + 24*log((a*e + b*e*x)/(c + d*x) 
)*a**3*b*d**4*f*g**2 - 36*log((a*e + b*e*x)/(c + d*x))*a**2*b**2*d**4*f**2 
*g + 24*log((a*e + b*e*x)/(c + d*x))*a*b**3*d**4*f**3 + 24*log((a*e + b*e* 
x)/(c + d*x))*b**4*d**4*f**3*x + 36*log((a*e + b*e*x)/(c + d*x))*b**4*d**4 
*f**2*g*x**2 + 24*log((a*e + b*e*x)/(c + d*x))*b**4*d**4*f*g**2*x**3 + 6*l 
og((a*e + b*e*x)/(c + d*x))*b**4*d**4*g**3*x**4 + 6*a**3*b*d**4*g**3*x - 2 
4*a**2*b**2*d**4*f*g**2*x - 3*a**2*b**2*d**4*g**3*x**2 + 24*a*b**3*d**4*f* 
*3*x + 36*a*b**3*d**4*f**2*g*x**2 + 36*a*b**3*d**4*f**2*g*x + 24*a*b**3*d* 
*4*f*g**2*x**3 + 12*a*b**3*d**4*f*g**2*x**2 + 6*a*b**3*d**4*g**3*x**4 + 2* 
a*b**3*d**4*g**3*x**3 - 6*b**4*c**3*d*g**3*x + 24*b**4*c**2*d**2*f*g**2*x 
+ 3*b**4*c**2*d**2*g**3*x**2 - 36*b**4*c*d**3*f**2*g*x - 12*b**4*c*d**3*f* 
g**2*x**2 - 2*b**4*c*d**3*g**3*x**3)/(24*b**3*d**4)