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

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 = 23, antiderivative size = 134 \[ \int \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2 \, dx=\frac {(a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{b}+\frac {4 B (b c-a d) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{b d}+\frac {8 B^2 (b c-a d) \operatorname {PolyLog}\left (2,1-\frac {b c-a d}{b (c+d x)}\right )}{b d} \] Output:

(b*x+a)*(A+B*ln(e*(b*x+a)^2/(d*x+c)^2))^2/b+4*B*(-a*d+b*c)*(A+B*ln(e*(b*x+ 
a)^2/(d*x+c)^2))*ln((-a*d+b*c)/b/(d*x+c))/b/d+8*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 = 220, normalized size of antiderivative = 1.64 \[ \int \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2 \, dx=x \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2+\frac {4 B \left (a d \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )-b c \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\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)^2)/(c + d*x)^2])^2,x]
 

Output:

x*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])^2 + (4*B*(a*d*Log[a + b*x]*(A + 
 B*Log[(e*(a + b*x)^2)/(c + d*x)^2]) - b*c*(A + B*Log[(e*(a + b*x)^2)/(c + 
 d*x)^2])*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*Po 
lyLog[2, (b*(c + d*x))/(b*c - a*d)])))/(b*d)
 

Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.93, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {2936, 2942, 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)^2}{(c+d x)^2}\right )+A\right )^2 \, dx\)

\(\Big \downarrow \) 2936

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

\(\Big \downarrow \) 2942

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2858

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (-\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2778

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2005

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 B (b c-a d) \left (\frac {2 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)^2}{(c+d x)^2}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2752

\(\displaystyle \frac {(a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{b}-\frac {4 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)^2}{(c+d x)^2}\right )+A\right )}{d}-\frac {2 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)^2)/(c + d*x)^2])^2,x]
 

Output:

((a + b*x)*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])^2)/b - (4*B*(b*c - a*d 
)*(-(((A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2])*Log[(b*c - a*d)/(b*(c + d*x 
))])/d) - (2*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 2942
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(-Log[-(b*c - a*d)/(d*(a 
+ b*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)/(d*(a + b*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[b*f - a*g, 0]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

2*(x*log((b*x + a)^2*e/(d*x + c)^2) + 2*(a*e*log(b*x + a)/b - c*e*log(d*x 
+ c)/d)/e)*A*B + A^2*x + B^2*(4*(b*d*x*log(b*x + a)^2 + (b*d*x + b*c)*log( 
d*x + c)^2 - (b*d*x*log(e) + 2*(b*d*x + a*d)*log(b*x + a))*log(d*x + c))/( 
b*d) + integrate(((log(e)^2 + 4*log(e))*b^2*d*x^2 + a*b*c*log(e)^2 + (b^2* 
c*log(e)^2 + (log(e)^2 + 4*log(e))*a*b*d)*x + 4*(b^2*d*x^2*log(e) + a*b*c* 
log(e) + 2*a^2*d + (a*b*d*(log(e) + 4) + b^2*c*(log(e) - 2))*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)^2}{(c+d x)^2}\right )\right )^2 \, dx=\int { {\left (B \log \left (\frac {{\left (b x + a\right )}^{2} e}{{\left (d x + c\right )}^{2}}\right ) + A\right )}^{2} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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