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

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

Optimal result

Integrand size = 33, antiderivative size = 208 \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(g+h x)^2} \, dx=\frac {(a+b x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(b g-a h) (g+h x)}+\frac {2 B (b c-a d) n \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \log \left (1-\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{(b g-a h) (d g-c h)}+\frac {2 B^2 (b c-a d) n^2 \operatorname {PolyLog}\left (2,\frac {(d g-c h) (a+b x)}{(b g-a h) (c+d x)}\right )}{(b g-a h) (d g-c h)} \] Output:

(b*x+a)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/(-a*h+b*g)/(h*x+g)+2*B*(-a*d+b 
*c)*n*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))*ln(1-(-c*h+d*g)*(b*x+a)/(-a*h+b*g) 
/(d*x+c))/(-a*h+b*g)/(-c*h+d*g)+2*B^2*(-a*d+b*c)*n^2*polylog(2,(-c*h+d*g)* 
(b*x+a)/(-a*h+b*g)/(d*x+c))/(-a*h+b*g)/(-c*h+d*g)
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(3460\) vs. \(2(208)=416\).

Time = 1.06 (sec) , antiderivative size = 3460, normalized size of antiderivative = 16.63 \[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(g+h x)^2} \, dx=\text {Result too large to show} \] Input:

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

Output:

(-(A^2*b*d*g^2) + A^2*b*c*g*h + a*A^2*d*g*h - a*A^2*c*h^2 + 2*A*b*B*d*g^2* 
n*Log[a + b*x] - 2*A*b*B*c*g*h*n*Log[a + b*x] + 2*A*b*B*d*g*h*n*x*Log[a + 
b*x] - 2*A*b*B*c*h^2*n*x*Log[a + b*x] - b*B^2*d*g^2*n^2*Log[a + b*x]^2 + b 
*B^2*c*g*h*n^2*Log[a + b*x]^2 - b*B^2*d*g*h*n^2*x*Log[a + b*x]^2 + b*B^2*c 
*h^2*n^2*x*Log[a + b*x]^2 - 2*A*b*B*d*g^2*n*Log[c + d*x] + 2*a*A*B*d*g*h*n 
*Log[c + d*x] - 2*A*b*B*d*g*h*n*x*Log[c + d*x] + 2*a*A*B*d*h^2*n*x*Log[c + 
 d*x] + 2*b*B^2*d*g^2*n^2*Log[a + b*x]*Log[c + d*x] - 2*a*B^2*d*g*h*n^2*Lo 
g[a + b*x]*Log[c + d*x] + 2*b*B^2*d*g*h*n^2*x*Log[a + b*x]*Log[c + d*x] - 
2*a*B^2*d*h^2*n^2*x*Log[a + b*x]*Log[c + d*x] - b*B^2*d*g^2*n^2*Log[c + d* 
x]^2 + a*B^2*d*g*h*n^2*Log[c + d*x]^2 - b*B^2*d*g*h*n^2*x*Log[c + d*x]^2 + 
 a*B^2*d*h^2*n^2*x*Log[c + d*x]^2 - 2*b*B^2*c*g*h*n^2*Log[a + b*x]*Log[(h* 
(c + d*x))/(-(d*g) + c*h)] + 2*a*B^2*d*g*h*n^2*Log[a + b*x]*Log[(h*(c + d* 
x))/(-(d*g) + c*h)] - 2*b*B^2*c*h^2*n^2*x*Log[a + b*x]*Log[(h*(c + d*x))/( 
-(d*g) + c*h)] + 2*a*B^2*d*h^2*n^2*x*Log[a + b*x]*Log[(h*(c + d*x))/(-(d*g 
) + c*h)] + b*B^2*c*g*h*n^2*Log[(h*(c + d*x))/(-(d*g) + c*h)]^2 - a*B^2*d* 
g*h*n^2*Log[(h*(c + d*x))/(-(d*g) + c*h)]^2 + b*B^2*c*h^2*n^2*x*Log[(h*(c 
+ d*x))/(-(d*g) + c*h)]^2 - a*B^2*d*h^2*n^2*x*Log[(h*(c + d*x))/(-(d*g) + 
c*h)]^2 - 2*b*B^2*c*g*h*n^2*Log[(-(b*c) + a*d)/(d*(a + b*x))]*Log[((b*g - 
a*h)*(c + d*x))/((d*g - c*h)*(a + b*x))] + 2*a*B^2*d*g*h*n^2*Log[(-(b*c) + 
 a*d)/(d*(a + b*x))]*Log[((b*g - a*h)*(c + d*x))/((d*g - c*h)*(a + b*x)...
 

Rubi [A] (warning: unable to verify)

Time = 0.65 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.06, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {2973, 2953, 2755, 2754, 2838}

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

\(\Big \downarrow \) 2973

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

\(\Big \downarrow \) 2953

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

\(\Big \downarrow \) 2755

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

\(\Big \downarrow \) 2754

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

\(\Big \downarrow \) 2838

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2755
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_))^2, x_Sy 
mbol] :> Simp[x*((a + b*Log[c*x^n])^p/(d*(d + e*x))), x] - Simp[b*n*(p/d) 
 Int[(a + b*Log[c*x^n])^(p - 1)/(d + e*x), x], x] /; FreeQ[{a, b, c, d, e, 
n, p}, x] && GtQ[p, 0]
 

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

rule 2953
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d)   Sub 
st[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m + 2 
)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n} 
, x] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]
 

rule 2973
Int[((A_.) + Log[(e_.)*(u_)^(n_.)*(v_)^(mn_)]*(B_.))^(p_.)*(w_.), x_Symbol] 
 :> Subst[Int[w*(A + B*Log[e*(u/v)^n])^p, x], e*(u/v)^n, e*(u^n/v^n)] /; Fr 
eeQ[{e, A, B, n, p}, x] && EqQ[n + mn, 0] && LinearQ[{u, v}, x] &&  !Intege 
rQ[n]
 
Maple [F]

\[\int \frac {{\left (A +B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right )\right )}^{2}}{\left (h x +g \right )^{2}}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{(g+h x)^2} \, dx=\text {too large to display} \] Input:

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

Output:

( - 2*int((log(((a + b*x)**n*e)/(c + d*x)**n)*x)/(a**2*c**2*g**2*h**2 + 2* 
a**2*c**2*g*h**3*x + a**2*c**2*h**4*x**2 + a**2*c*d*g**2*h**2*x + 2*a**2*c 
*d*g*h**3*x**2 + a**2*c*d*h**4*x**3 + a*b*c**2*g**2*h**2*x + 2*a*b*c**2*g* 
h**3*x**2 + a*b*c**2*h**4*x**3 - a*b*c*d*g**4 - 2*a*b*c*d*g**3*h*x + 2*a*b 
*c*d*g*h**3*x**3 + a*b*c*d*h**4*x**4 - a*b*d**2*g**4*x - 2*a*b*d**2*g**3*h 
*x**2 - a*b*d**2*g**2*h**2*x**3 - b**2*c*d*g**4*x - 2*b**2*c*d*g**3*h*x**2 
 - b**2*c*d*g**2*h**2*x**3 - b**2*d**2*g**4*x**2 - 2*b**2*d**2*g**3*h*x**3 
 - b**2*d**2*g**2*h**2*x**4),x)*a**4*b**2*c**3*d*g**2*h**6*n - 2*int((log( 
((a + b*x)**n*e)/(c + d*x)**n)*x)/(a**2*c**2*g**2*h**2 + 2*a**2*c**2*g*h** 
3*x + a**2*c**2*h**4*x**2 + a**2*c*d*g**2*h**2*x + 2*a**2*c*d*g*h**3*x**2 
+ a**2*c*d*h**4*x**3 + a*b*c**2*g**2*h**2*x + 2*a*b*c**2*g*h**3*x**2 + a*b 
*c**2*h**4*x**3 - a*b*c*d*g**4 - 2*a*b*c*d*g**3*h*x + 2*a*b*c*d*g*h**3*x** 
3 + a*b*c*d*h**4*x**4 - a*b*d**2*g**4*x - 2*a*b*d**2*g**3*h*x**2 - a*b*d** 
2*g**2*h**2*x**3 - b**2*c*d*g**4*x - 2*b**2*c*d*g**3*h*x**2 - b**2*c*d*g** 
2*h**2*x**3 - b**2*d**2*g**4*x**2 - 2*b**2*d**2*g**3*h*x**3 - b**2*d**2*g* 
*2*h**2*x**4),x)*a**4*b**2*c**3*d*g*h**7*n*x + 4*int((log(((a + b*x)**n*e) 
/(c + d*x)**n)*x)/(a**2*c**2*g**2*h**2 + 2*a**2*c**2*g*h**3*x + a**2*c**2* 
h**4*x**2 + a**2*c*d*g**2*h**2*x + 2*a**2*c*d*g*h**3*x**2 + a**2*c*d*h**4* 
x**3 + a*b*c**2*g**2*h**2*x + 2*a*b*c**2*g*h**3*x**2 + a*b*c**2*h**4*x**3 
- a*b*c*d*g**4 - 2*a*b*c*d*g**3*h*x + 2*a*b*c*d*g*h**3*x**3 + a*b*c*d*h...