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

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(1412\) vs. \(2(261)=522\).

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

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

Output:

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

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 239, normalized size of antiderivative = 0.92, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.075, Rules used = {2962, 2795, 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 {(a g+b g x) \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )^2}{(c i+d i x)^2} \, dx\)

\(\Big \downarrow \) 2962

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

\(\Big \downarrow \) 2795

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2795
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + 
(e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[ 
c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b 
, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0 
] && IntegerQ[m] && IntegerQ[r]))
 

rule 2962
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.)*((h_.) + (i_.)*(x_))^(q_.), x_Sy 
mbol] :> Simp[(b*c - a*d)^(m + q + 1)*(g/b)^m*(i/d)^q   Subst[Int[x^m*((A + 
 B*Log[e*x^n])^p/(b - d*x)^(m + q + 2)), x], x, (a + b*x)/(c + d*x)], x] /; 
 FreeQ[{a, b, c, d, e, f, g, h, i, A, B, n, p}, x] && EqQ[n + mn, 0] && IGt 
Q[n, 0] && NeQ[b*c - a*d, 0] && EqQ[b*f - a*g, 0] && EqQ[d*h - c*i, 0] && I 
ntegersQ[m, q]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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