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

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

Optimal result

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(402\) vs. \(2(196)=392\).

Time = 0.51 (sec) , antiderivative size = 402, normalized size of antiderivative = 2.05 \[ \int \frac {\left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{(f+g x)^2} \, dx=\frac {-\frac {\left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{f+g x}+\frac {B \left (2 b (d f-c g) \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )-2 d (b f-a g) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \log (c+d x)+2 (b c-a d) g \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \log (f+g x)-b B (d f-c g) \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 d (b f-a g) \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 )-2 B (b c-a d) g \left (\left (\log \left (\frac {g (a+b x)}{-b f+a g}\right )-\log \left (\frac {g (c+d x)}{-d f+c g}\right )\right ) \log (f+g x)+\operatorname {PolyLog}\left (2,\frac {b (f+g x)}{b f-a g}\right )-\operatorname {PolyLog}\left (2,\frac {d (f+g x)}{d f-c g}\right )\right )\right )}{(b f-a g) (d f-c g)}}{g} \] Input:

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

Output:

(-((A + B*Log[(e*(a + b*x))/(c + d*x)])^2/(f + g*x)) + (B*(2*b*(d*f - c*g) 
*Log[a + b*x]*(A + B*Log[(e*(a + b*x))/(c + d*x)]) - 2*d*(b*f - a*g)*(A + 
B*Log[(e*(a + b*x))/(c + d*x)])*Log[c + d*x] + 2*(b*c - a*d)*g*(A + B*Log[ 
(e*(a + b*x))/(c + d*x)])*Log[f + g*x] - b*B*(d*f - c*g)*(Log[a + b*x]*(Lo 
g[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*d*(b*f - a*g)*((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)]) - 
 2*B*(b*c - a*d)*g*((Log[(g*(a + b*x))/(-(b*f) + a*g)] - Log[(g*(c + d*x)) 
/(-(d*f) + c*g)])*Log[f + g*x] + PolyLog[2, (b*(f + g*x))/(b*f - a*g)] - P 
olyLog[2, (d*(f + g*x))/(d*f - c*g)])))/((b*f - a*g)*(d*f - c*g)))/g
 

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2954, 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 (\frac {e (a+b x)}{c+d x}\right )+A\right )^2}{(f+g x)^2} \, dx\)

\(\Big \downarrow \) 2954

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

\(\Big \downarrow \) 2754

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

\(\Big \downarrow \) 2838

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

Input:

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

Output:

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

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 2954
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d) 
 Subst[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] && EqQ[n + mn, 0] && IGtQ[n, 0] && NeQ[b*c - a*d, 0] && IntegerQ[m 
] && IGtQ[p, 0]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

integrate((A+B*log(e*(b*x+a)/(d*x+c)))^2/(g*x+f)^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)/(g^2*x^2 + 2*f*g*x + f^2), x)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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