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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (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 = 26, antiderivative size = 211 \[ \int (g+h x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2 \, dx=-\frac {2 a b (f g-e h) p q x}{f}+\frac {2 b^2 (f g-e h) p^2 q^2 x}{f}+\frac {b^2 h p^2 q^2 (e+f x)^2}{4 f^2}-\frac {2 b^2 (f g-e h) p q (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f^2}-\frac {b h p q (e+f x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 f^2}+\frac {(f g-e h) (e+f x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{f^2}+\frac {h (e+f x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{2 f^2} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 1.12 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {2895, 2848, 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) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2 \, dx\)

\(\Big \downarrow \) 2895

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

\(\Big \downarrow \) 2848

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2848
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)*((f_.) + (g_. 
)*(x_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(f + g*x)^q*(a + b*Log[c*(d 
 + e*x)^n])^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*f - 
 d*g, 0] && IGtQ[q, 0]
 

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. \(539\) vs. \(2(205)=410\).

Time = 2.00 (sec) , antiderivative size = 540, normalized size of antiderivative = 2.56

method result size
parallelrisch \(-\frac {-4 x \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b^{2} e f h p q -16 \ln \left (f x +e \right ) a b e f g p q -2 x^{2} {\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )}^{2} b^{2} f^{2} h -4 x {\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )}^{2} b^{2} f^{2} g -4 {\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )}^{2} b^{2} e f g -6 b^{2} e^{2} h \,p^{2} q^{2}+4 a^{2} e f g -2 x^{2} a^{2} f^{2} h +2 {\ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )}^{2} b^{2} e^{2} h -4 x \,a^{2} f^{2} g -4 x a b e f h p q -8 \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b^{2} e f g p q +16 \ln \left (f x +e \right ) b^{2} e f g \,p^{2} q^{2}+4 \ln \left (f x +e \right ) a b \,e^{2} h p q -8 a b e f g p q -8 x \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) a b \,f^{2} g +8 \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) a b e f g -10 \ln \left (f x +e \right ) b^{2} e^{2} h \,p^{2} q^{2}-x^{2} b^{2} f^{2} h \,p^{2} q^{2}-8 x \,b^{2} f^{2} g \,p^{2} q^{2}-4 x^{2} \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) a b \,f^{2} h +4 \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b^{2} e^{2} h p q +4 a b \,e^{2} h p q +8 b^{2} e f g \,p^{2} q^{2}+2 x^{2} \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b^{2} f^{2} h p q +6 x \,b^{2} e f h \,p^{2} q^{2}+2 x^{2} a b \,f^{2} h p q +8 x \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right ) b^{2} f^{2} g p q +8 x a b \,f^{2} g p q}{4 f^{2}}\) \(540\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 622 vs. \(2 (205) = 410\).

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

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

Output:

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 466 vs. \(2 (202) = 404\).

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 939 vs. \(2 (205) = 410\).

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 445, normalized size of antiderivative = 2.11 \[ \int (g+h x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2 \, dx=\frac {-2 \mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2} b^{2} e^{2} h +4 \mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2} b^{2} e f g +4 \mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2} b^{2} f^{2} g x +2 \mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2} b^{2} f^{2} h \,x^{2}-4 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) a b \,e^{2} h +8 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) a b e f g +8 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) a b \,f^{2} g x +4 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) a b \,f^{2} h \,x^{2}+6 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b^{2} e^{2} h p q -8 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b^{2} e f g p q +4 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b^{2} e f h p q x -8 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b^{2} f^{2} g p q x -2 \,\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right ) b^{2} f^{2} h p q \,x^{2}+4 a^{2} f^{2} g x +2 a^{2} f^{2} h \,x^{2}+4 a b e f h p q x -8 a b \,f^{2} g p q x -2 a b \,f^{2} h p q \,x^{2}-6 b^{2} e f h \,p^{2} q^{2} x +8 b^{2} f^{2} g \,p^{2} q^{2} x +b^{2} f^{2} h \,p^{2} q^{2} x^{2}}{4 f^{2}} \] Input:

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

Output:

( - 2*log(d**q*(e + f*x)**(p*q)*c)**2*b**2*e**2*h + 4*log(d**q*(e + f*x)** 
(p*q)*c)**2*b**2*e*f*g + 4*log(d**q*(e + f*x)**(p*q)*c)**2*b**2*f**2*g*x + 
 2*log(d**q*(e + f*x)**(p*q)*c)**2*b**2*f**2*h*x**2 - 4*log(d**q*(e + f*x) 
**(p*q)*c)*a*b*e**2*h + 8*log(d**q*(e + f*x)**(p*q)*c)*a*b*e*f*g + 8*log(d 
**q*(e + f*x)**(p*q)*c)*a*b*f**2*g*x + 4*log(d**q*(e + f*x)**(p*q)*c)*a*b* 
f**2*h*x**2 + 6*log(d**q*(e + f*x)**(p*q)*c)*b**2*e**2*h*p*q - 8*log(d**q* 
(e + f*x)**(p*q)*c)*b**2*e*f*g*p*q + 4*log(d**q*(e + f*x)**(p*q)*c)*b**2*e 
*f*h*p*q*x - 8*log(d**q*(e + f*x)**(p*q)*c)*b**2*f**2*g*p*q*x - 2*log(d**q 
*(e + f*x)**(p*q)*c)*b**2*f**2*h*p*q*x**2 + 4*a**2*f**2*g*x + 2*a**2*f**2* 
h*x**2 + 4*a*b*e*f*h*p*q*x - 8*a*b*f**2*g*p*q*x - 2*a*b*f**2*h*p*q*x**2 - 
6*b**2*e*f*h*p**2*q**2*x + 8*b**2*f**2*g*p**2*q**2*x + b**2*f**2*h*p**2*q* 
*2*x**2)/(4*f**2)