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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 214, normalized size of antiderivative = 1.65 \[ \int \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=x \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2+\frac {B \left (2 a d \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )-2 b c \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \log (c+d x)-a B d \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )+b B c \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )\right )}{b d} \] Input:

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

Output:

x*(A + B*Log[(e*(a + b*x))/(c + d*x)])^2 + (B*(2*a*d*Log[a + b*x]*(A + B*L 
og[(e*(a + b*x))/(c + d*x)]) - 2*b*c*(A + B*Log[(e*(a + b*x))/(c + d*x)])* 
Log[c + d*x] - a*B*d*(Log[a + b*x]*(Log[a + b*x] - 2*Log[(b*(c + d*x))/(b* 
c - a*d)]) - 2*PolyLog[2, (d*(a + b*x))/(-(b*c) + a*d)]) + b*B*c*((2*Log[( 
d*(a + b*x))/(-(b*c) + a*d)] - Log[c + d*x])*Log[c + d*x] + 2*PolyLog[2, ( 
b*(c + d*x))/(b*c - a*d)])))/(b*d)
 

Rubi [A] (verified)

Time = 0.67 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.92, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {2936, 2944, 2858, 27, 25, 2778, 2005, 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 (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )^2 \, dx\)

\(\Big \downarrow \) 2936

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

\(\Big \downarrow \) 2944

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

\(\Big \downarrow \) 2858

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2778

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

\(\Big \downarrow \) 2005

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

\(\Big \downarrow \) 2752

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2005
Int[(Fx_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[x^(m 
+ n*p)*(b + a/x^n)^p*Fx, x] /; FreeQ[{a, b, m, n}, x] && IntegerQ[p] && Neg 
Q[n]
 

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 2778
Int[((a_.) + Log[(c_.)*(x_)^(n_)]*(b_.))/((x_)*((d_) + (e_.)*(x_)^(r_.))), 
x_Symbol] :> Simp[1/n   Subst[Int[(a + b*Log[c*x])/(x*(d + e*x^(r/n))), x], 
 x, x^n], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IntegerQ[r/n]
 

rule 2858
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_ 
.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))^(r_.), x_Symbol] :> Simp[1/e   Subst[In 
t[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x, d + 
e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - 
d*g, 0] && (IGtQ[p, 0] || IGtQ[r, 0]) && IntegerQ[2*r]
 

rule 2936
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))^(p_.), x_Symbol] :> Simp[(a + b*x)*((A + B*Log[e*((a + b*x)^n/(c 
+ d*x)^n)])^p/b), x] - Simp[B*n*p*((b*c - a*d)/b)   Int[(A + B*Log[e*((a + 
b*x)^n/(c + d*x)^n)])^(p - 1)/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, A, 
 B, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && IGtQ[p, 0]
 

rule 2944
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(-Log[(b*c - a*d)/(b*(c + 
 d*x))])*((A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/g), x] + Simp[B*n*((b*c 
- a*d)/g)   Int[Log[(b*c - a*d)/(b*(c + d*x))]/((a + b*x)*(c + d*x)), x], x 
] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && EqQ[n + mn, 0] && NeQ[b*c 
- a*d, 0] && EqQ[d*f - c*g, 0]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

2*(x*log((b*x + a)*e/(d*x + c)) + (a*e*log(b*x + a)/b - c*e*log(d*x + c)/d 
)/e)*A*B + A^2*x + B^2*((b*d*x*log(b*x + a)^2 + (b*d*x + b*c)*log(d*x + c) 
^2 - 2*(b*d*x*log(e) + (b*d*x + a*d)*log(b*x + a))*log(d*x + c))/(b*d) + i 
ntegrate(((log(e)^2 + 2*log(e))*b^2*d*x^2 + a*b*c*log(e)^2 + (b^2*c*log(e) 
^2 + (log(e)^2 + 2*log(e))*a*b*d)*x + 2*(b^2*d*x^2*log(e) + a*b*c*log(e) + 
 a^2*d + (a*b*d*(log(e) + 2) + b^2*c*(log(e) - 1))*x)*log(b*x + a))/(b^2*d 
*x^2 + a*b*c + (b^2*c + a*b*d)*x), x))
                                                                                    
                                                                                    
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(2*int((log((a*e + b*e*x)/(c + d*x))*x)/(a*c + a*d*x + b*c*x + b*d*x**2),x 
)*a*b**2*d**2 - 2*int((log((a*e + b*e*x)/(c + d*x))*x)/(a*c + a*d*x + b*c* 
x + b*d*x**2),x)*b**3*c*d + 2*log(c + d*x)*a**2*d - 2*log(c + d*x)*a*b*c + 
 log((a*e + b*e*x)/(c + d*x))**2*b**2*d*x + 2*log((a*e + b*e*x)/(c + d*x)) 
*a**2*d + 2*log((a*e + b*e*x)/(c + d*x))*a*b*d*x + a**2*d*x)/d