\(\int (g+h x)^3 (A+B \log (e (a+b x)^n (c+d x)^{-n})) \, dx\) [294]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.65 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.33 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {b d x \left (6 A b^3 d^3 \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )-B (b c-a d) h n \left (6 a^2 d^2 h^2-3 a b d h (8 d g-2 c h+d h x)+b^2 \left (6 c^2 h^2-3 c d h (8 g+h x)+2 d^2 \left (18 g^2+6 g h x+h^2 x^2\right )\right )\right )\right )-6 a^2 B d^4 h \left (6 b^2 g^2-4 a b g h+a^2 h^2\right ) n \log (a+b x)+6 b^3 B \left (4 a d^4 g^3+b c \left (-4 d^3 g^3+6 c d^2 g^2 h-4 c^2 d g h^2+c^3 h^3\right )\right ) n \log (c+d x)+6 b^3 B d^4 \left (4 a g^3+b x \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{24 b^4 d^4} \] Input:

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

Output:

(b*d*x*(6*A*b^3*d^3*(4*g^3 + 6*g^2*h*x + 4*g*h^2*x^2 + h^3*x^3) - B*(b*c - 
 a*d)*h*n*(6*a^2*d^2*h^2 - 3*a*b*d*h*(8*d*g - 2*c*h + d*h*x) + b^2*(6*c^2* 
h^2 - 3*c*d*h*(8*g + h*x) + 2*d^2*(18*g^2 + 6*g*h*x + h^2*x^2)))) - 6*a^2* 
B*d^4*h*(6*b^2*g^2 - 4*a*b*g*h + a^2*h^2)*n*Log[a + b*x] + 6*b^3*B*(4*a*d^ 
4*g^3 + b*c*(-4*d^3*g^3 + 6*c*d^2*g^2*h - 4*c^2*d*g*h^2 + c^3*h^3))*n*Log[ 
c + d*x] + 6*b^3*B*d^4*(4*a*g^3 + b*x*(4*g^3 + 6*g^2*h*x + 4*g*h^2*x^2 + h 
^3*x^3))*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(24*b^4*d^4)
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 228, normalized size of antiderivative = 0.97, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, 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 (g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2948

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

\(\Big \downarrow \) 93

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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

Leaf count of result is larger than twice the leaf count of optimal. \(983\) vs. \(2(224)=448\).

Time = 37.58 (sec) , antiderivative size = 984, normalized size of antiderivative = 4.17

method result size
parallelrisch \(\frac {-6 B \,a^{4} d^{4} h^{3} n^{2}+6 B \,b^{4} c^{4} h^{3} n^{2}-3 B \,a^{3} b c \,d^{3} h^{3} n^{2}+24 B \,a^{3} b \,d^{4} g \,h^{2} n^{2}-36 B \,a^{2} b^{2} d^{4} g^{2} h \,n^{2}+3 B a \,b^{3} c^{3} d \,h^{3} n^{2}+24 B \,x^{3} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g \,h^{2} n +36 B \,x^{2} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g^{2} h n +24 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{3} d g \,h^{2} n -36 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{2} d^{2} g^{2} h n -6 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c^{4} h^{3} n +12 B \,x^{2} a \,b^{3} d^{4} g \,h^{2} n^{2}-12 B \,x^{2} b^{4} c \,d^{3} g \,h^{2} n^{2}-24 B x \,a^{2} b^{2} d^{4} g \,h^{2} n^{2}+36 B x a \,b^{3} d^{4} g^{2} h \,n^{2}+24 B x \,b^{4} c^{2} d^{2} g \,h^{2} n^{2}-36 B x \,b^{4} c \,d^{3} g^{2} h \,n^{2}+24 B \ln \left (b x +a \right ) a^{3} b \,d^{4} g \,h^{2} n^{2}-36 B \ln \left (b x +a \right ) a^{2} b^{2} d^{4} g^{2} h \,n^{2}-24 B \ln \left (b x +a \right ) b^{4} c^{3} d g \,h^{2} n^{2}+36 B \ln \left (b x +a \right ) b^{4} c^{2} d^{2} g^{2} h \,n^{2}+6 B \,x^{4} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} h^{3} n +24 B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} d^{4} g^{3} n +24 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{4} c \,d^{3} g^{3} n +12 B \,a^{2} b^{2} c \,d^{3} g \,h^{2} n^{2}-12 B a \,b^{3} c^{2} d^{2} g \,h^{2} n^{2}-36 A a \,b^{3} c \,d^{3} g^{2} h n -24 A a \,b^{3} d^{4} g^{3} n -24 A \,b^{4} c \,d^{3} g^{3} n +6 A \,x^{4} b^{4} d^{4} h^{3} n +24 A x \,b^{4} d^{4} g^{3} n -6 B \ln \left (b x +a \right ) a^{4} d^{4} h^{3} n^{2}+6 B \ln \left (b x +a \right ) b^{4} c^{4} h^{3} n^{2}-24 B \,b^{4} c^{3} d g \,h^{2} n^{2}+36 B \,b^{4} c^{2} d^{2} g^{2} h \,n^{2}+2 B \,x^{3} a \,b^{3} d^{4} h^{3} n^{2}-2 B \,x^{3} b^{4} c \,d^{3} h^{3} n^{2}+24 A \,x^{3} b^{4} d^{4} g \,h^{2} n -3 B \,x^{2} a^{2} b^{2} d^{4} h^{3} n^{2}+3 B \,x^{2} b^{4} c^{2} d^{2} h^{3} n^{2}+36 A \,x^{2} b^{4} d^{4} g^{2} h n +6 B x \,a^{3} b \,d^{4} h^{3} n^{2}-6 B x \,b^{4} c^{3} d \,h^{3} n^{2}+24 B \ln \left (b x +a \right ) a \,b^{3} d^{4} g^{3} n^{2}-24 B \ln \left (b x +a \right ) b^{4} c \,d^{3} g^{3} n^{2}}{24 b^{4} d^{4} n}\) \(984\)
risch \(\text {Expression too large to display}\) \(2002\)

Input:

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

Output:

1/24*(-6*B*a^4*d^4*h^3*n^2+6*B*b^4*c^4*h^3*n^2-3*B*a^3*b*c*d^3*h^3*n^2+24* 
B*a^3*b*d^4*g*h^2*n^2-36*B*a^2*b^2*d^4*g^2*h*n^2+3*B*a*b^3*c^3*d*h^3*n^2+2 
4*B*x^3*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*g*h^2*n+36*B*x^2*ln(e*(b*x+a)^ 
n/((d*x+c)^n))*b^4*d^4*g^2*h*n+12*B*x^2*a*b^3*d^4*g*h^2*n^2-12*B*x^2*b^4*c 
*d^3*g*h^2*n^2-24*B*x*a^2*b^2*d^4*g*h^2*n^2+36*B*x*a*b^3*d^4*g^2*h*n^2+24* 
B*x*b^4*c^2*d^2*g*h^2*n^2-36*B*x*b^4*c*d^3*g^2*h*n^2+24*B*ln(e*(b*x+a)^n/( 
(d*x+c)^n))*b^4*c^3*d*g*h^2*n-36*B*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*c^2*d^2 
*g^2*h*n+24*B*ln(b*x+a)*a^3*b*d^4*g*h^2*n^2-36*B*ln(b*x+a)*a^2*b^2*d^4*g^2 
*h*n^2-24*B*ln(b*x+a)*b^4*c^3*d*g*h^2*n^2+36*B*ln(b*x+a)*b^4*c^2*d^2*g^2*h 
*n^2+12*B*a^2*b^2*c*d^3*g*h^2*n^2-12*B*a*b^3*c^2*d^2*g*h^2*n^2-36*A*a*b^3* 
c*d^3*g^2*h*n-24*A*a*b^3*d^4*g^3*n-24*A*b^4*c*d^3*g^3*n+6*A*x^4*b^4*d^4*h^ 
3*n+24*A*x*b^4*d^4*g^3*n-6*B*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*c^4*h^3*n-6*B 
*ln(b*x+a)*a^4*d^4*h^3*n^2+6*B*ln(b*x+a)*b^4*c^4*h^3*n^2-24*B*b^4*c^3*d*g* 
h^2*n^2+36*B*b^4*c^2*d^2*g^2*h*n^2+6*B*x^4*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4 
*d^4*h^3*n+2*B*x^3*a*b^3*d^4*h^3*n^2-2*B*x^3*b^4*c*d^3*h^3*n^2+24*A*x^3*b^ 
4*d^4*g*h^2*n-3*B*x^2*a^2*b^2*d^4*h^3*n^2+3*B*x^2*b^4*c^2*d^2*h^3*n^2+36*A 
*x^2*b^4*d^4*g^2*h*n+24*B*x*ln(e*(b*x+a)^n/((d*x+c)^n))*b^4*d^4*g^3*n+6*B* 
x*a^3*b*d^4*h^3*n^2-6*B*x*b^4*c^3*d*h^3*n^2+24*B*ln(e*(b*x+a)^n/((d*x+c)^n 
))*b^4*c*d^3*g^3*n+24*B*ln(b*x+a)*a*b^3*d^4*g^3*n^2-24*B*ln(b*x+a)*b^4*c*d 
^3*g^3*n^2)/b^4/d^4/n
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 571 vs. \(2 (224) = 448\).

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

integrate((h*x+g)^3*(A+B*log(e*(b*x+a)^n/((d*x+c)^n))),x, algorithm="frica 
s")
 

Output:

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

Sympy [F(-2)]

Exception generated. \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

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

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 467 vs. \(2 (224) = 448\).

Time = 0.06 (sec) , antiderivative size = 467, normalized size of antiderivative = 1.98 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {1}{4} \, B h^{3} x^{4} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{4} \, A h^{3} x^{4} + B g h^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h^{2} x^{3} + \frac {3}{2} \, B g^{2} h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {3}{2} \, A g^{2} h x^{2} + B g^{3} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{3} x + \frac {{\left (\frac {a e n \log \left (b x + a\right )}{b} - \frac {c e n \log \left (d x + c\right )}{d}\right )} B g^{3}}{e} - \frac {3 \, {\left (\frac {a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c e n - a d e n\right )} x}{b d}\right )} B g^{2} h}{2 \, e} + \frac {{\left (\frac {2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \, {\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B g h^{2}}{2 \, e} - \frac {{\left (\frac {6 \, a^{4} e n \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} e n \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} e n - a b^{2} d^{3} e n\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d e n - a^{2} b d^{3} e n\right )} x^{2} + 6 \, {\left (b^{3} c^{3} e n - a^{3} d^{3} e n\right )} x}{b^{3} d^{3}}\right )} B h^{3}}{24 \, e} \] Input:

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

Output:

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

Giac [F(-1)]

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

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

Output:

Timed out
 

Mupad [B] (verification not implemented)

Time = 25.81 (sec) , antiderivative size = 767, normalized size of antiderivative = 3.25 \[ \int (g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=x\,\left (\frac {4\,A\,b\,d\,g^3+12\,A\,a\,c\,g\,h^2+12\,A\,a\,d\,g^2\,h+12\,A\,b\,c\,g^2\,h+6\,B\,a\,d\,g^2\,h\,n-6\,B\,b\,c\,g^2\,h\,n}{4\,b\,d}+\frac {\left (4\,a\,d+4\,b\,c\right )\,\left (\frac {\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^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\,h^3+12\,A\,a\,d\,g\,h^2+12\,A\,b\,c\,g\,h^2+12\,A\,b\,d\,g^2\,h+4\,B\,a\,d\,g\,h^2\,n-4\,B\,b\,c\,g\,h^2\,n}{4\,b\,d}+\frac {A\,a\,c\,h^3}{b\,d}\right )}{4\,b\,d}-\frac {a\,c\,\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )}{b\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,g^3\,x+\frac {3\,B\,g^2\,h\,x^2}{2}+B\,g\,h^2\,x^3+\frac {B\,h^3\,x^4}{4}\right )-x^2\,\left (\frac {\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{4\,b\,d}-\frac {A\,h^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\,h^3+12\,A\,a\,d\,g\,h^2+12\,A\,b\,c\,g\,h^2+12\,A\,b\,d\,g^2\,h+4\,B\,a\,d\,g\,h^2\,n-4\,B\,b\,c\,g\,h^2\,n}{8\,b\,d}+\frac {A\,a\,c\,h^3}{2\,b\,d}\right )+x^3\,\left (\frac {4\,A\,a\,d\,h^3+4\,A\,b\,c\,h^3+12\,A\,b\,d\,g\,h^2+B\,a\,d\,h^3\,n-B\,b\,c\,h^3\,n}{12\,b\,d}-\frac {A\,h^3\,\left (4\,a\,d+4\,b\,c\right )}{12\,b\,d}\right )+\frac {A\,h^3\,x^4}{4}-\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^4\,h^3-4\,B\,n\,a^3\,b\,g\,h^2+6\,B\,n\,a^2\,b^2\,g^2\,h-4\,B\,n\,a\,b^3\,g^3\right )}{4\,b^4}+\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^4\,h^3-4\,B\,n\,c^3\,d\,g\,h^2+6\,B\,n\,c^2\,d^2\,g^2\,h-4\,B\,n\,c\,d^3\,g^3\right )}{4\,d^4} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

( - 6*log(c + d*x)*a**4*d**4*h**3*n + 24*log(c + d*x)*a**3*b*d**4*g*h**2*n 
 - 36*log(c + d*x)*a**2*b**2*d**4*g**2*h*n + 24*log(c + d*x)*a*b**3*d**4*g 
**3*n + 6*log(c + d*x)*b**4*c**4*h**3*n - 24*log(c + d*x)*b**4*c**3*d*g*h* 
*2*n + 36*log(c + d*x)*b**4*c**2*d**2*g**2*h*n - 24*log(c + d*x)*b**4*c*d* 
*3*g**3*n - 6*log(((a + b*x)**n*e)/(c + d*x)**n)*a**4*d**4*h**3 + 24*log(( 
(a + b*x)**n*e)/(c + d*x)**n)*a**3*b*d**4*g*h**2 - 36*log(((a + b*x)**n*e) 
/(c + d*x)**n)*a**2*b**2*d**4*g**2*h + 24*log(((a + b*x)**n*e)/(c + d*x)** 
n)*a*b**3*d**4*g**3 + 24*log(((a + b*x)**n*e)/(c + d*x)**n)*b**4*d**4*g**3 
*x + 36*log(((a + b*x)**n*e)/(c + d*x)**n)*b**4*d**4*g**2*h*x**2 + 24*log( 
((a + b*x)**n*e)/(c + d*x)**n)*b**4*d**4*g*h**2*x**3 + 6*log(((a + b*x)**n 
*e)/(c + d*x)**n)*b**4*d**4*h**3*x**4 + 6*a**3*b*d**4*h**3*n*x - 24*a**2*b 
**2*d**4*g*h**2*n*x - 3*a**2*b**2*d**4*h**3*n*x**2 + 24*a*b**3*d**4*g**3*x 
 + 36*a*b**3*d**4*g**2*h*n*x + 36*a*b**3*d**4*g**2*h*x**2 + 12*a*b**3*d**4 
*g*h**2*n*x**2 + 24*a*b**3*d**4*g*h**2*x**3 + 2*a*b**3*d**4*h**3*n*x**3 + 
6*a*b**3*d**4*h**3*x**4 - 6*b**4*c**3*d*h**3*n*x + 24*b**4*c**2*d**2*g*h** 
2*n*x + 3*b**4*c**2*d**2*h**3*n*x**2 - 36*b**4*c*d**3*g**2*h*n*x - 12*b**4 
*c*d**3*g*h**2*n*x**2 - 2*b**4*c*d**3*h**3*n*x**3)/(24*b**3*d**4)