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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

x*(a + b*Log[c*(d + e/(f + g*x))^p])^2 - (b*p*(2*d*f*Log[f + g*x]*(a + b*L 
og[c*(d + e/(f + g*x))^p]) - 2*(e + d*f)*(a + b*Log[c*(d + e/(f + g*x))^p] 
)*Log[e + d*(f + g*x)] + b*d*f*p*(Log[f + g*x]*(Log[f + g*x] - 2*Log[(e + 
d*f + d*g*x)/e]) - 2*PolyLog[2, -((d*(f + g*x))/e)]) - b*(e + d*f)*p*((2*L 
og[-((d*(f + g*x))/e)] - Log[e + d*f + d*g*x])*Log[e + d*f + d*g*x] + 2*Po 
lyLog[2, (e + d*f + d*g*x)/e])))/(d*g)
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.90, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.227, Rules used = {2933, 2899, 2904, 2841, 2752}

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

\(\Big \downarrow \) 2933

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

\(\Big \downarrow \) 2899

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

\(\Big \downarrow \) 2904

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

\(\Big \downarrow \) 2841

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

\(\Big \downarrow \) 2752

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2752
Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLo 
g[2, 1 - c*x], x] /; FreeQ[{c, d, e}, x] && EqQ[e + c*d, 0]
 

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

rule 2899
Int[((a_.) + Log[(c_.)*((d_) + (e_.)/(x_))^(p_.)]*(b_.))^(q_), x_Symbol] :> 
 Simp[(e + d*x)*((a + b*Log[c*(d + e/x)^p])^q/d), x] + Simp[b*e*p*(q/d)   I 
nt[(a + b*Log[c*(d + e/x)^p])^(q - 1)/x, x], x] /; FreeQ[{a, b, c, d, e, p} 
, x] && IGtQ[q, 0]
 

rule 2904
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m 
_.), x_Symbol] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*L 
og[c*(d + e*x)^p])^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n, p, q}, 
 x] && IntegerQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0]) & 
&  !(EqQ[q, 1] && ILtQ[n, 0] && IGtQ[m, 0])
 

rule 2933
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*((f_.) + (g_.)*(x_))^(n_))^(p_.)]*(b_. 
))^(q_.), x_Symbol] :> Simp[1/g   Subst[Int[(a + b*Log[c*(d + e*x^n)^p])^q, 
 x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && IGtQ[q, 0] 
 && (EqQ[q, 1] || IntegerQ[n])
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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