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

Optimal result
Mathematica [B] (verified)
Rubi [A] (warning: unable to verify)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 28, antiderivative size = 123 \[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2 \log \left (\frac {f (g+h x)}{f g-e h}\right )}{h}+\frac {2 b p q \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \operatorname {PolyLog}\left (2,-\frac {h (e+f x)}{f g-e h}\right )}{h}-\frac {2 b^2 p^2 q^2 \operatorname {PolyLog}\left (3,-\frac {h (e+f x)}{f g-e h}\right )}{h} \] Output:

(a+b*ln(c*(d*(f*x+e)^p)^q))^2*ln(f*(h*x+g)/(-e*h+f*g))/h+2*b*p*q*(a+b*ln(c 
*(d*(f*x+e)^p)^q))*polylog(2,-h*(f*x+e)/(-e*h+f*g))/h-2*b^2*p^2*q^2*polylo 
g(3,-h*(f*x+e)/(-e*h+f*g))/h
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(324\) vs. \(2(123)=246\).

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

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

Output:

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

Rubi [A] (warning: unable to verify)

Time = 1.24 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.95, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {2895, 2843, 2881, 2821, 7143}

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 \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx\)

\(\Big \downarrow \) 2895

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

\(\Big \downarrow \) 2843

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

\(\Big \downarrow \) 2881

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

\(\Big \downarrow \) 2821

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

\(\Big \downarrow \) 7143

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2821
Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b 
_.))^(p_.))/(x_), x_Symbol] :> Simp[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c 
*x^n])^p/m), x] + Simp[b*n*(p/m)   Int[PolyLog[2, (-d)*f*x^m]*((a + b*Log[c 
*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 
0] && EqQ[d*e, 1]
 

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

rule 2881
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log 
[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Sym 
bol] :> Simp[1/e   Subst[Int[(k*(x/d))^r*(a + b*Log[c*x^n])^p*(f + g*Log[h* 
((e*i - d*j)/e + j*(x/e))^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, 
 f, g, h, i, j, k, l, n, p, r}, x] && EqQ[e*k - d*l, 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]]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
Maple [F]

\[\int \frac {{\left (a +b \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )\right )}^{2}}{h x +g}d x\]

Input:

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

Output:

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

Fricas [F]

\[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (b \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a\right )}^{2}}{h x + g} \,d x } \] Input:

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

Output:

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

Sympy [F]

\[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\int \frac {\left (a + b \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}\right )^{2}}{g + h x}\, dx \] Input:

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

Output:

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

Maxima [F]

\[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (b \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a\right )}^{2}}{h x + g} \,d x } \] Input:

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

Output:

a^2*log(h*x + g)/h + integrate((b^2*log(((f*x + e)^p)^q)^2 + 2*(q*log(d) + 
 log(c))*a*b + (q^2*log(d)^2 + 2*q*log(c)*log(d) + log(c)^2)*b^2 + 2*((q*l 
og(d) + log(c))*b^2 + a*b)*log(((f*x + e)^p)^q))/(h*x + g), x)
 

Giac [F]

\[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\int { \frac {{\left (b \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a\right )}^{2}}{h x + g} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )\right )}^2}{g+h\,x} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {\left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )^2}{g+h x} \, dx=\frac {3 \left (\int \frac {\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2}}{f h \,x^{2}+e h x +f g x +e g}d x \right ) b^{2} e h p q -3 \left (\int \frac {\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2}}{f h \,x^{2}+e h x +f g x +e g}d x \right ) b^{2} f g p q +6 \left (\int \frac {\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )}{f h \,x^{2}+e h x +f g x +e g}d x \right ) a b e h p q -6 \left (\int \frac {\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )}{f h \,x^{2}+e h x +f g x +e g}d x \right ) a b f g p q +3 \,\mathrm {log}\left (h x +g \right ) a^{2} p q +\mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{3} b^{2}+3 \mathrm {log}\left (d^{q} \left (f x +e \right )^{p q} c \right )^{2} a b}{3 h p q} \] Input:

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

Output:

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