\(\int (g+h x)^3 (a+b \log (c (d (e+f x)^p)^q)) \, dx\) [439]

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 = 26, antiderivative size = 158 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=-\frac {b (f g-e h)^3 p q x}{4 f^3}-\frac {b (f g-e h)^2 p q (g+h x)^2}{8 f^2 h}-\frac {b (f g-e h) p q (g+h x)^3}{12 f h}-\frac {b p q (g+h x)^4}{16 h}-\frac {b (f g-e h)^4 p q \log (e+f x)}{4 f^4 h}+\frac {(g+h x)^4 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{4 h} \] Output:

-1/4*b*(-e*h+f*g)^3*p*q*x/f^3-1/8*b*(-e*h+f*g)^2*p*q*(h*x+g)^2/f^2/h-1/12* 
b*(-e*h+f*g)*p*q*(h*x+g)^3/f/h-1/16*b*p*q*(h*x+g)^4/h-1/4*b*(-e*h+f*g)^4*p 
*q*ln(f*x+e)/f^4/h+1/4*(h*x+g)^4*(a+b*ln(c*(d*(f*x+e)^p)^q))/h
 

Mathematica [A] (verified)

Time = 0.33 (sec) , antiderivative size = 232, normalized size of antiderivative = 1.47 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\frac {f x \left (12 a f^3 \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )-b p q \left (-12 e^3 h^3+6 e^2 f h^2 (8 g+h x)-4 e f^2 h \left (18 g^2+6 g h x+h^2 x^2\right )+f^3 \left (48 g^3+36 g^2 h x+16 g h^2 x^2+3 h^3 x^3\right )\right )\right )-12 b e^2 h \left (6 f^2 g^2-4 e f g h+e^2 h^2\right ) p q \log (e+f x)+12 b f^3 \left (4 e g^3+f x \left (4 g^3+6 g^2 h x+4 g h^2 x^2+h^3 x^3\right )\right ) \log \left (c \left (d (e+f x)^p\right )^q\right )}{48 f^4} \] Input:

Integrate[(g + h*x)^3*(a + b*Log[c*(d*(e + f*x)^p)^q]),x]
 

Output:

(f*x*(12*a*f^3*(4*g^3 + 6*g^2*h*x + 4*g*h^2*x^2 + h^3*x^3) - b*p*q*(-12*e^ 
3*h^3 + 6*e^2*f*h^2*(8*g + h*x) - 4*e*f^2*h*(18*g^2 + 6*g*h*x + h^2*x^2) + 
 f^3*(48*g^3 + 36*g^2*h*x + 16*g*h^2*x^2 + 3*h^3*x^3))) - 12*b*e^2*h*(6*f^ 
2*g^2 - 4*e*f*g*h + e^2*h^2)*p*q*Log[e + f*x] + 12*b*f^3*(4*e*g^3 + f*x*(4 
*g^3 + 6*g^2*h*x + 4*g*h^2*x^2 + h^3*x^3))*Log[c*(d*(e + f*x)^p)^q])/(48*f 
^4)
 

Rubi [A] (verified)

Time = 0.75 (sec) , antiderivative size = 141, normalized size of antiderivative = 0.89, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2895, 2842, 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 (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx\)

\(\Big \downarrow \) 2895

\(\displaystyle \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )dx\)

\(\Big \downarrow \) 2842

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

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

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

Input:

Int[(g + h*x)^3*(a + b*Log[c*(d*(e + f*x)^p)^q]),x]
 

Output:

-1/4*(b*f*p*q*((h*(f*g - e*h)^3*x)/f^4 + ((f*g - e*h)^2*(g + h*x)^2)/(2*f^ 
3) + ((f*g - e*h)*(g + h*x)^3)/(3*f^2) + (g + h*x)^4/(4*f) + ((f*g - e*h)^ 
4*Log[e + f*x])/f^5))/h + ((g + h*x)^4*(a + b*Log[c*(d*(e + f*x)^p)^q]))/( 
4*h)
 

Defintions of rubi rules used

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 2842
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_ 
))^(q_.), x_Symbol] :> Simp[(f + g*x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/( 
g*(q + 1))), x] - Simp[b*e*(n/(g*(q + 1)))   Int[(f + g*x)^(q + 1)/(d + e*x 
), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && 
NeQ[q, -1]
 

rule 2895
Int[((a_.) + Log[(c_.)*((d_.)*((e_.) + (f_.)*(x_))^(m_.))^(n_)]*(b_.))^(p_. 
)*(u_.), x_Symbol] :> Subst[Int[u*(a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x], 
 c*d^n*(e + f*x)^(m*n), c*(d*(e + f*x)^m)^n] /; FreeQ[{a, b, c, d, e, f, m, 
 n, p}, x] &&  !IntegerQ[n] &&  !(EqQ[d, 1] && EqQ[m, 1]) && IntegralFreeQ[ 
IntHide[u*(a + b*Log[c*d^n*(e + f*x)^(m*n)])^p, x]]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(465\) vs. \(2(146)=292\).

Time = 7.47 (sec) , antiderivative size = 466, normalized size of antiderivative = 2.95

method result size
parallelrisch \(-\frac {-24 x^{2} b e \,f^{3} g \,h^{2} p q -12 x^{4} a \,f^{4} h^{3}-48 x a \,f^{4} g^{3}+6 x^{2} b \,e^{2} f^{2} h^{3} p q +36 x^{2} b \,f^{4} g^{2} h p q -12 x b \,e^{3} f \,h^{3} p q -96 \ln \left (f x +e \right ) b e \,f^{3} g^{3} p q +48 x b \,e^{2} f^{2} g \,h^{2} p q -72 x b e \,f^{3} g^{2} h p q -48 \ln \left (f x +e \right ) b \,e^{3} f g \,h^{2} p q +72 \ln \left (f x +e \right ) b \,e^{2} f^{2} g^{2} h p q -4 x^{3} b e \,f^{3} h^{3} p q +16 x^{3} b \,f^{4} g \,h^{2} p q +12 b \,e^{4} h^{3} p q +72 b \,e^{2} g^{2} h p q \,f^{2}-48 b \,e^{3} f g \,h^{2} p q +48 a e \,g^{3} f^{3}-48 b e \,f^{3} g^{3} p q +3 x^{4} b \,f^{4} h^{3} p q -48 x^{3} \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b \,f^{4} g \,h^{2}-72 x^{2} \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b \,f^{4} g^{2} h +48 x b \,f^{4} g^{3} p q +12 \ln \left (f x +e \right ) b \,e^{4} h^{3} p q -12 x^{4} \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b \,f^{4} h^{3}-48 x^{3} a \,f^{4} g \,h^{2}-72 x^{2} a \,f^{4} g^{2} h -48 x \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b \,f^{4} g^{3}+48 \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b e \,f^{3} g^{3}}{48 f^{4}}\) \(466\)

Input:

int((h*x+g)^3*(a+b*ln(c*(d*(f*x+e)^p)^q)),x,method=_RETURNVERBOSE)
 

Output:

-1/48*(-24*x^2*b*e*f^3*g*h^2*p*q-12*x^4*a*f^4*h^3-48*x*a*f^4*g^3+6*x^2*b*e 
^2*f^2*h^3*p*q+36*x^2*b*f^4*g^2*h*p*q-12*x*b*e^3*f*h^3*p*q-96*ln(f*x+e)*b* 
e*f^3*g^3*p*q+48*x*b*e^2*f^2*g*h^2*p*q-72*x*b*e*f^3*g^2*h*p*q-48*ln(f*x+e) 
*b*e^3*f*g*h^2*p*q+72*ln(f*x+e)*b*e^2*f^2*g^2*h*p*q-4*x^3*b*e*f^3*h^3*p*q+ 
16*x^3*b*f^4*g*h^2*p*q+12*b*e^4*h^3*p*q+72*b*e^2*g^2*h*p*q*f^2-48*b*e^3*f* 
g*h^2*p*q+48*a*e*g^3*f^3-48*b*e*f^3*g^3*p*q+3*x^4*b*f^4*h^3*p*q-48*x^3*ln( 
c*(d*(f*x+e)^p)^q)*b*f^4*g*h^2-72*x^2*ln(c*(d*(f*x+e)^p)^q)*b*f^4*g^2*h+48 
*x*b*f^4*g^3*p*q+12*ln(f*x+e)*b*e^4*h^3*p*q-12*x^4*ln(c*(d*(f*x+e)^p)^q)*b 
*f^4*h^3-48*x^3*a*f^4*g*h^2-72*x^2*a*f^4*g^2*h-48*x*ln(c*(d*(f*x+e)^p)^q)* 
b*f^4*g^3+48*ln(c*(d*(f*x+e)^p)^q)*b*e*f^3*g^3)/f^4
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 405 vs. \(2 (146) = 292\).

Time = 0.09 (sec) , antiderivative size = 405, normalized size of antiderivative = 2.56 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=-\frac {3 \, {\left (b f^{4} h^{3} p q - 4 \, a f^{4} h^{3}\right )} x^{4} - 4 \, {\left (12 \, a f^{4} g h^{2} - {\left (4 \, b f^{4} g h^{2} - b e f^{3} h^{3}\right )} p q\right )} x^{3} - 6 \, {\left (12 \, a f^{4} g^{2} h - {\left (6 \, b f^{4} g^{2} h - 4 \, b e f^{3} g h^{2} + b e^{2} f^{2} h^{3}\right )} p q\right )} x^{2} - 12 \, {\left (4 \, a f^{4} g^{3} - {\left (4 \, b f^{4} g^{3} - 6 \, b e f^{3} g^{2} h + 4 \, b e^{2} f^{2} g h^{2} - b e^{3} f h^{3}\right )} p q\right )} x - 12 \, {\left (b f^{4} h^{3} p q x^{4} + 4 \, b f^{4} g h^{2} p q x^{3} + 6 \, b f^{4} g^{2} h p q x^{2} + 4 \, b f^{4} g^{3} p q x + {\left (4 \, b e f^{3} g^{3} - 6 \, b e^{2} f^{2} g^{2} h + 4 \, b e^{3} f g h^{2} - b e^{4} h^{3}\right )} p q\right )} \log \left (f x + e\right ) - 12 \, {\left (b f^{4} h^{3} x^{4} + 4 \, b f^{4} g h^{2} x^{3} + 6 \, b f^{4} g^{2} h x^{2} + 4 \, b f^{4} g^{3} x\right )} \log \left (c\right ) - 12 \, {\left (b f^{4} h^{3} q x^{4} + 4 \, b f^{4} g h^{2} q x^{3} + 6 \, b f^{4} g^{2} h q x^{2} + 4 \, b f^{4} g^{3} q x\right )} \log \left (d\right )}{48 \, f^{4}} \] Input:

integrate((h*x+g)^3*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="fricas")
 

Output:

-1/48*(3*(b*f^4*h^3*p*q - 4*a*f^4*h^3)*x^4 - 4*(12*a*f^4*g*h^2 - (4*b*f^4* 
g*h^2 - b*e*f^3*h^3)*p*q)*x^3 - 6*(12*a*f^4*g^2*h - (6*b*f^4*g^2*h - 4*b*e 
*f^3*g*h^2 + b*e^2*f^2*h^3)*p*q)*x^2 - 12*(4*a*f^4*g^3 - (4*b*f^4*g^3 - 6* 
b*e*f^3*g^2*h + 4*b*e^2*f^2*g*h^2 - b*e^3*f*h^3)*p*q)*x - 12*(b*f^4*h^3*p* 
q*x^4 + 4*b*f^4*g*h^2*p*q*x^3 + 6*b*f^4*g^2*h*p*q*x^2 + 4*b*f^4*g^3*p*q*x 
+ (4*b*e*f^3*g^3 - 6*b*e^2*f^2*g^2*h + 4*b*e^3*f*g*h^2 - b*e^4*h^3)*p*q)*l 
og(f*x + e) - 12*(b*f^4*h^3*x^4 + 4*b*f^4*g*h^2*x^3 + 6*b*f^4*g^2*h*x^2 + 
4*b*f^4*g^3*x)*log(c) - 12*(b*f^4*h^3*q*x^4 + 4*b*f^4*g*h^2*q*x^3 + 6*b*f^ 
4*g^2*h*q*x^2 + 4*b*f^4*g^3*q*x)*log(d))/f^4
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 457 vs. \(2 (139) = 278\).

Time = 2.70 (sec) , antiderivative size = 457, normalized size of antiderivative = 2.89 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\begin {cases} a g^{3} x + \frac {3 a g^{2} h x^{2}}{2} + a g h^{2} x^{3} + \frac {a h^{3} x^{4}}{4} - \frac {b e^{4} h^{3} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{4 f^{4}} + \frac {b e^{3} g h^{2} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f^{3}} + \frac {b e^{3} h^{3} p q x}{4 f^{3}} - \frac {3 b e^{2} g^{2} h \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2 f^{2}} - \frac {b e^{2} g h^{2} p q x}{f^{2}} - \frac {b e^{2} h^{3} p q x^{2}}{8 f^{2}} + \frac {b e g^{3} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} + \frac {3 b e g^{2} h p q x}{2 f} + \frac {b e g h^{2} p q x^{2}}{2 f} + \frac {b e h^{3} p q x^{3}}{12 f} - b g^{3} p q x + b g^{3} x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} - \frac {3 b g^{2} h p q x^{2}}{4} + \frac {3 b g^{2} h x^{2} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2} - \frac {b g h^{2} p q x^{3}}{3} + b g h^{2} x^{3} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} - \frac {b h^{3} p q x^{4}}{16} + \frac {b h^{3} x^{4} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{4} & \text {for}\: f \neq 0 \\\left (a + b \log {\left (c \left (d e^{p}\right )^{q} \right )}\right ) \left (g^{3} x + \frac {3 g^{2} h x^{2}}{2} + g h^{2} x^{3} + \frac {h^{3} x^{4}}{4}\right ) & \text {otherwise} \end {cases} \] Input:

integrate((h*x+g)**3*(a+b*ln(c*(d*(f*x+e)**p)**q)),x)
 

Output:

Piecewise((a*g**3*x + 3*a*g**2*h*x**2/2 + a*g*h**2*x**3 + a*h**3*x**4/4 - 
b*e**4*h**3*log(c*(d*(e + f*x)**p)**q)/(4*f**4) + b*e**3*g*h**2*log(c*(d*( 
e + f*x)**p)**q)/f**3 + b*e**3*h**3*p*q*x/(4*f**3) - 3*b*e**2*g**2*h*log(c 
*(d*(e + f*x)**p)**q)/(2*f**2) - b*e**2*g*h**2*p*q*x/f**2 - b*e**2*h**3*p* 
q*x**2/(8*f**2) + b*e*g**3*log(c*(d*(e + f*x)**p)**q)/f + 3*b*e*g**2*h*p*q 
*x/(2*f) + b*e*g*h**2*p*q*x**2/(2*f) + b*e*h**3*p*q*x**3/(12*f) - b*g**3*p 
*q*x + b*g**3*x*log(c*(d*(e + f*x)**p)**q) - 3*b*g**2*h*p*q*x**2/4 + 3*b*g 
**2*h*x**2*log(c*(d*(e + f*x)**p)**q)/2 - b*g*h**2*p*q*x**3/3 + b*g*h**2*x 
**3*log(c*(d*(e + f*x)**p)**q) - b*h**3*p*q*x**4/16 + b*h**3*x**4*log(c*(d 
*(e + f*x)**p)**q)/4, Ne(f, 0)), ((a + b*log(c*(d*e**p)**q))*(g**3*x + 3*g 
**2*h*x**2/2 + g*h**2*x**3 + h**3*x**4/4), True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (146) = 292\).

Time = 0.04 (sec) , antiderivative size = 304, normalized size of antiderivative = 1.92 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\frac {1}{4} \, b h^{3} x^{4} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + \frac {1}{4} \, a h^{3} x^{4} - b f g^{3} p q {\left (\frac {x}{f} - \frac {e \log \left (f x + e\right )}{f^{2}}\right )} - \frac {1}{48} \, b f h^{3} p q {\left (\frac {12 \, e^{4} \log \left (f x + e\right )}{f^{5}} + \frac {3 \, f^{3} x^{4} - 4 \, e f^{2} x^{3} + 6 \, e^{2} f x^{2} - 12 \, e^{3} x}{f^{4}}\right )} + \frac {1}{6} \, b f g h^{2} p q {\left (\frac {6 \, e^{3} \log \left (f x + e\right )}{f^{4}} - \frac {2 \, f^{2} x^{3} - 3 \, e f x^{2} + 6 \, e^{2} x}{f^{3}}\right )} - \frac {3}{4} \, b f g^{2} h p q {\left (\frac {2 \, e^{2} \log \left (f x + e\right )}{f^{3}} + \frac {f x^{2} - 2 \, e x}{f^{2}}\right )} + b g h^{2} x^{3} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a g h^{2} x^{3} + \frac {3}{2} \, b g^{2} h x^{2} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + \frac {3}{2} \, a g^{2} h x^{2} + b g^{3} x \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a g^{3} x \] Input:

integrate((h*x+g)^3*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="maxima")
 

Output:

1/4*b*h^3*x^4*log(((f*x + e)^p*d)^q*c) + 1/4*a*h^3*x^4 - b*f*g^3*p*q*(x/f 
- e*log(f*x + e)/f^2) - 1/48*b*f*h^3*p*q*(12*e^4*log(f*x + e)/f^5 + (3*f^3 
*x^4 - 4*e*f^2*x^3 + 6*e^2*f*x^2 - 12*e^3*x)/f^4) + 1/6*b*f*g*h^2*p*q*(6*e 
^3*log(f*x + e)/f^4 - (2*f^2*x^3 - 3*e*f*x^2 + 6*e^2*x)/f^3) - 3/4*b*f*g^2 
*h*p*q*(2*e^2*log(f*x + e)/f^3 + (f*x^2 - 2*e*x)/f^2) + b*g*h^2*x^3*log((( 
f*x + e)^p*d)^q*c) + a*g*h^2*x^3 + 3/2*b*g^2*h*x^2*log(((f*x + e)^p*d)^q*c 
) + 3/2*a*g^2*h*x^2 + b*g^3*x*log(((f*x + e)^p*d)^q*c) + a*g^3*x
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 987 vs. \(2 (146) = 292\).

Time = 0.14 (sec) , antiderivative size = 987, normalized size of antiderivative = 6.25 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\text {Too large to display} \] Input:

integrate((h*x+g)^3*(a+b*log(c*(d*(f*x+e)^p)^q)),x, algorithm="giac")
 

Output:

(f*x + e)*b*g^3*p*q*log(f*x + e)/f + 3/2*(f*x + e)^2*b*g^2*h*p*q*log(f*x + 
 e)/f^2 - 3*(f*x + e)*b*e*g^2*h*p*q*log(f*x + e)/f^2 + (f*x + e)^3*b*g*h^2 
*p*q*log(f*x + e)/f^3 - 3*(f*x + e)^2*b*e*g*h^2*p*q*log(f*x + e)/f^3 + 3*( 
f*x + e)*b*e^2*g*h^2*p*q*log(f*x + e)/f^3 + 1/4*(f*x + e)^4*b*h^3*p*q*log( 
f*x + e)/f^4 - (f*x + e)^3*b*e*h^3*p*q*log(f*x + e)/f^4 + 3/2*(f*x + e)^2* 
b*e^2*h^3*p*q*log(f*x + e)/f^4 - (f*x + e)*b*e^3*h^3*p*q*log(f*x + e)/f^4 
- (f*x + e)*b*g^3*p*q/f - 3/4*(f*x + e)^2*b*g^2*h*p*q/f^2 + 3*(f*x + e)*b* 
e*g^2*h*p*q/f^2 - 1/3*(f*x + e)^3*b*g*h^2*p*q/f^3 + 3/2*(f*x + e)^2*b*e*g* 
h^2*p*q/f^3 - 3*(f*x + e)*b*e^2*g*h^2*p*q/f^3 - 1/16*(f*x + e)^4*b*h^3*p*q 
/f^4 + 1/3*(f*x + e)^3*b*e*h^3*p*q/f^4 - 3/4*(f*x + e)^2*b*e^2*h^3*p*q/f^4 
 + (f*x + e)*b*e^3*h^3*p*q/f^4 + (f*x + e)*b*g^3*q*log(d)/f + 3/2*(f*x + e 
)^2*b*g^2*h*q*log(d)/f^2 - 3*(f*x + e)*b*e*g^2*h*q*log(d)/f^2 + (f*x + e)^ 
3*b*g*h^2*q*log(d)/f^3 - 3*(f*x + e)^2*b*e*g*h^2*q*log(d)/f^3 + 3*(f*x + e 
)*b*e^2*g*h^2*q*log(d)/f^3 + 1/4*(f*x + e)^4*b*h^3*q*log(d)/f^4 - (f*x + e 
)^3*b*e*h^3*q*log(d)/f^4 + 3/2*(f*x + e)^2*b*e^2*h^3*q*log(d)/f^4 - (f*x + 
 e)*b*e^3*h^3*q*log(d)/f^4 + (f*x + e)*b*g^3*log(c)/f + 3/2*(f*x + e)^2*b* 
g^2*h*log(c)/f^2 - 3*(f*x + e)*b*e*g^2*h*log(c)/f^2 + (f*x + e)^3*b*g*h^2* 
log(c)/f^3 - 3*(f*x + e)^2*b*e*g*h^2*log(c)/f^3 + 3*(f*x + e)*b*e^2*g*h^2* 
log(c)/f^3 + 1/4*(f*x + e)^4*b*h^3*log(c)/f^4 - (f*x + e)^3*b*e*h^3*log(c) 
/f^4 + 3/2*(f*x + e)^2*b*e^2*h^3*log(c)/f^4 - (f*x + e)*b*e^3*h^3*log(c...
 

Mupad [B] (verification not implemented)

Time = 26.25 (sec) , antiderivative size = 370, normalized size of antiderivative = 2.34 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\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 {e\,\left (\frac {h^2\,\left (a\,e\,h+3\,a\,f\,g-b\,f\,g\,p\,q\right )}{f}-\frac {e\,h^3\,\left (4\,a-b\,p\,q\right )}{4\,f}\right )}{2\,f}-\frac {3\,g\,h\,\left (2\,a\,e\,h+2\,a\,f\,g-b\,f\,g\,p\,q\right )}{4\,f}\right )+x\,\left (\frac {4\,a\,f\,g^3+12\,a\,e\,g^2\,h-4\,b\,f\,g^3\,p\,q}{4\,f}+\frac {e\,\left (\frac {e\,\left (\frac {h^2\,\left (a\,e\,h+3\,a\,f\,g-b\,f\,g\,p\,q\right )}{f}-\frac {e\,h^3\,\left (4\,a-b\,p\,q\right )}{4\,f}\right )}{f}-\frac {3\,g\,h\,\left (2\,a\,e\,h+2\,a\,f\,g-b\,f\,g\,p\,q\right )}{2\,f}\right )}{f}\right )+x^3\,\left (\frac {h^2\,\left (a\,e\,h+3\,a\,f\,g-b\,f\,g\,p\,q\right )}{3\,f}-\frac {e\,h^3\,\left (4\,a-b\,p\,q\right )}{12\,f}\right )-\frac {\ln \left (e+f\,x\right )\,\left (b\,p\,q\,e^4\,h^3-4\,b\,p\,q\,e^3\,f\,g\,h^2+6\,b\,p\,q\,e^2\,f^2\,g^2\,h-4\,b\,p\,q\,e\,f^3\,g^3\right )}{4\,f^4}+\frac {h^3\,x^4\,\left (4\,a-b\,p\,q\right )}{16} \] Input:

int((g + h*x)^3*(a + b*log(c*(d*(e + f*x)^p)^q)),x)
 

Output:

log(c*(d*(e + f*x)^p)^q)*((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*((e*((h^2*(a*e*h + 3*a*f*g - b*f*g*p*q))/f - (e*h^3*(4*a 
- b*p*q))/(4*f)))/(2*f) - (3*g*h*(2*a*e*h + 2*a*f*g - b*f*g*p*q))/(4*f)) + 
 x*((4*a*f*g^3 + 12*a*e*g^2*h - 4*b*f*g^3*p*q)/(4*f) + (e*((e*((h^2*(a*e*h 
 + 3*a*f*g - b*f*g*p*q))/f - (e*h^3*(4*a - b*p*q))/(4*f)))/f - (3*g*h*(2*a 
*e*h + 2*a*f*g - b*f*g*p*q))/(2*f)))/f) + x^3*((h^2*(a*e*h + 3*a*f*g - b*f 
*g*p*q))/(3*f) - (e*h^3*(4*a - b*p*q))/(12*f)) - (log(e + f*x)*(b*e^4*h^3* 
p*q - 4*b*e*f^3*g^3*p*q + 6*b*e^2*f^2*g^2*h*p*q - 4*b*e^3*f*g*h^2*p*q))/(4 
*f^4) + (h^3*x^4*(4*a - b*p*q))/16
 

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 412, normalized size of antiderivative = 2.61 \[ \int (g+h x)^3 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx=\frac {-12 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,e^{4} h^{3}+48 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,e^{3} f g \,h^{2}-72 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,e^{2} f^{2} g^{2} h +48 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b e \,f^{3} g^{3}+48 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,f^{4} g^{3} x +72 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,f^{4} g^{2} h \,x^{2}+48 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,f^{4} g \,h^{2} x^{3}+12 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b \,f^{4} h^{3} x^{4}+48 a \,f^{4} g^{3} x +72 a \,f^{4} g^{2} h \,x^{2}+48 a \,f^{4} g \,h^{2} x^{3}+12 a \,f^{4} h^{3} x^{4}+12 b \,e^{3} f \,h^{3} p q x -48 b \,e^{2} f^{2} g \,h^{2} p q x -6 b \,e^{2} f^{2} h^{3} p q \,x^{2}+72 b e \,f^{3} g^{2} h p q x +24 b e \,f^{3} g \,h^{2} p q \,x^{2}+4 b e \,f^{3} h^{3} p q \,x^{3}-48 b \,f^{4} g^{3} p q x -36 b \,f^{4} g^{2} h p q \,x^{2}-16 b \,f^{4} g \,h^{2} p q \,x^{3}-3 b \,f^{4} h^{3} p q \,x^{4}}{48 f^{4}} \] Input:

int((h*x+g)^3*(a+b*log(c*(d*(f*x+e)^p)^q)),x)
 

Output:

( - 12*log(d**q*(e + f*x)**(p*q)*c)*b*e**4*h**3 + 48*log(d**q*(e + f*x)**( 
p*q)*c)*b*e**3*f*g*h**2 - 72*log(d**q*(e + f*x)**(p*q)*c)*b*e**2*f**2*g**2 
*h + 48*log(d**q*(e + f*x)**(p*q)*c)*b*e*f**3*g**3 + 48*log(d**q*(e + f*x) 
**(p*q)*c)*b*f**4*g**3*x + 72*log(d**q*(e + f*x)**(p*q)*c)*b*f**4*g**2*h*x 
**2 + 48*log(d**q*(e + f*x)**(p*q)*c)*b*f**4*g*h**2*x**3 + 12*log(d**q*(e 
+ f*x)**(p*q)*c)*b*f**4*h**3*x**4 + 48*a*f**4*g**3*x + 72*a*f**4*g**2*h*x* 
*2 + 48*a*f**4*g*h**2*x**3 + 12*a*f**4*h**3*x**4 + 12*b*e**3*f*h**3*p*q*x 
- 48*b*e**2*f**2*g*h**2*p*q*x - 6*b*e**2*f**2*h**3*p*q*x**2 + 72*b*e*f**3* 
g**2*h*p*q*x + 24*b*e*f**3*g*h**2*p*q*x**2 + 4*b*e*f**3*h**3*p*q*x**3 - 48 
*b*f**4*g**3*p*q*x - 36*b*f**4*g**2*h*p*q*x**2 - 16*b*f**4*g*h**2*p*q*x**3 
 - 3*b*f**4*h**3*p*q*x**4)/(48*f**4)