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

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

Optimal result

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(1441\) vs. \(2(297)=594\).

Time = 0.56 (sec) , antiderivative size = 1441, normalized size of antiderivative = 4.85 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{f+g x} \, dx =\text {Too large to display} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.77 (sec) , antiderivative size = 367, normalized size of antiderivative = 1.24, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {2953, 2804, 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 \frac {\left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{f+g x} \, 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-\frac {d (a+b x)}{c+d x}\right ) \left (b f-a g-\frac {(d f-c g) (a+b x)}{c+d x}\right )}d\frac {a+b x}{c+d x}\)

\(\Big \downarrow \) 2804

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2804
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{ 
u = ExpandIntegrand[(a + b*Log[c*x^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] / 
; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]
 

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]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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