Integrand size = 32, antiderivative size = 120 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {2 B (b c-a d)^2 g^2 x}{3 d^2}-\frac {B (b c-a d) g^2 (a+b x)^2}{3 b d}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{3 b}-\frac {2 B (b c-a d)^3 g^2 \log (c+d x)}{3 b d^3} \] Output:
2/3*B*(-a*d+b*c)^2*g^2*x/d^2-1/3*B*(-a*d+b*c)*g^2*(b*x+a)^2/b/d+1/3*g^2*(b *x+a)^3*(A+B*ln(e*(b*x+a)^2/(d*x+c)^2))/b-2/3*B*(-a*d+b*c)^3*g^2*ln(d*x+c) /b/d^3
Time = 0.06 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.82 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {g^2 \left ((a+b x)^3 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )+\frac {B (-b c+a d) \left (d \left (a^2 d+4 a b d x+b^2 x (-2 c+d x)\right )+2 (b c-a d)^2 \log (c+d x)\right )}{d^3}\right )}{3 b} \] Input:
Integrate[(a*g + b*g*x)^2*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2]),x]
Output:
(g^2*((a + b*x)^3*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2]) + (B*(-(b*c) + a*d)*(d*(a^2*d + 4*a*b*d*x + b^2*x*(-2*c + d*x)) + 2*(b*c - a*d)^2*Log[c + d*x]))/d^3))/(3*b)
Time = 0.29 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.90, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2948, 27, 49, 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 (a g+b g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right ) \, dx\) |
\(\Big \downarrow \) 2948 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{3 b}-\frac {2 B (b c-a d) \int \frac {g^3 (a+b x)^2}{c+d x}dx}{3 b g}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{3 b}-\frac {2 B g^2 (b c-a d) \int \frac {(a+b x)^2}{c+d x}dx}{3 b}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{3 b}-\frac {2 B g^2 (b c-a d) \int \left (\frac {(a d-b c)^2}{d^2 (c+d x)}-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}\right )dx}{3 b}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{3 b}-\frac {2 B g^2 (b c-a d) \left (\frac {(b c-a d)^2 \log (c+d x)}{d^3}-\frac {b x (b c-a d)}{d^2}+\frac {(a+b x)^2}{2 d}\right )}{3 b}\) |
Input:
Int[(a*g + b*g*x)^2*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2]),x]
Output:
(g^2*(a + b*x)^3*(A + B*Log[(e*(a + b*x)^2)/(c + d*x)^2]))/(3*b) - (2*B*(b *c - a*d)*g^2*(-((b*(b*c - a*d)*x)/d^2) + (a + b*x)^2/(2*d) + ((b*c - a*d) ^2*Log[c + d*x])/d^3))/(3*b)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ )]*(B_.))*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*( (A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Simp[B*n*((b*c - a*d)/(g*(m + 1))) Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] / ; FreeQ[{a, b, c, d, e, f, g, A, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && NeQ[m, -1] && !(EqQ[m, -2] && IntegerQ[n])
Time = 0.92 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.75
method | result | size |
risch | \(\frac {\left (b x +a \right )^{3} g^{2} B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{3 b}+\frac {g^{2} b^{2} A \,x^{3}}{3}+g^{2} b A a \,x^{2}+\frac {g^{2} b B a \,x^{2}}{3}-\frac {g^{2} b^{2} B c \,x^{2}}{3 d}+g^{2} A \,a^{2} x +\frac {2 g^{2} B \ln \left (d x +c \right ) a^{3}}{3 b}-\frac {2 g^{2} B \ln \left (d x +c \right ) a^{2} c}{d}+\frac {2 g^{2} b B \ln \left (d x +c \right ) a \,c^{2}}{d^{2}}-\frac {2 g^{2} b^{2} B \ln \left (d x +c \right ) c^{3}}{3 d^{3}}+\frac {4 g^{2} B \,a^{2} x}{3}-\frac {2 g^{2} b B a c x}{d}+\frac {2 g^{2} b^{2} B \,c^{2} x}{3 d^{2}}\) | \(210\) |
parts | \(\frac {A \,g^{2} \left (b x +a \right )^{3}}{3 b}-\frac {B \,g^{2} \left (\left (-\frac {\left (d x +c \right )^{3} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{3}-\left (-\frac {2 d a}{3}+\frac {2 b c}{3}\right ) \left (-\frac {\left (d a -b c \right )^{2} \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{3}}-\frac {\left (d x +c \right )^{2}}{2 b}-\frac {\left (-d a +b c \right ) \left (d x +c \right )}{b^{2}}+\frac {\left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right ) \ln \left (\frac {1}{d x +c}\right )}{b^{3}}\right )\right ) b^{2}+2 \left (-\frac {\left (d x +c \right )^{2} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{2}-\left (-d a +b c \right ) \left (\frac {\left (d a -b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{2}}-\frac {d x +c}{b}+\frac {\left (-d a +b c \right ) \ln \left (\frac {1}{d x +c}\right )}{b^{2}}\right )\right ) b \left (d a -b c \right )+\left (-\left (d x +c \right ) \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )-\left (-2 d a +2 b c \right ) \left (\frac {\left (-d a +b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b \left (d a -b c \right )}+\frac {\ln \left (\frac {1}{d x +c}\right )}{b}\right )\right ) \left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right )\right )}{d^{3}}\) | \(447\) |
parallelrisch | \(\frac {2 B \,a^{2} b c \,d^{2} g^{2}-4 B \,c^{3} g^{2} b^{3}-6 A \,a^{3} d^{3} g^{2}-8 B \,a^{3} d^{3} g^{2}-12 A \,a^{2} b c \,d^{2} g^{2}+10 B a \,c^{2} d \,g^{2} b^{2}+6 B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a^{2} b c \,d^{2} g^{2}-6 B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a \,b^{2} c^{2} d \,g^{2}-12 B \ln \left (b x +a \right ) a^{2} b c \,d^{2} g^{2}+12 B \ln \left (b x +a \right ) a \,b^{2} c^{2} d \,g^{2}+2 B \,x^{3} \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) b^{3} d^{3} g^{2}+6 A \,x^{2} a \,b^{2} d^{3} g^{2}+2 B \,x^{2} a \,b^{2} d^{3} g^{2}-2 B \,x^{2} b^{3} c \,d^{2} g^{2}+6 A x \,a^{2} b \,d^{3} g^{2}+8 B x \,a^{2} b \,d^{3} g^{2}+4 B x \,b^{3} c^{2} d \,g^{2}+6 B \,x^{2} \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a \,b^{2} d^{3} g^{2}+6 B x \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a^{2} b \,d^{3} g^{2}-12 B x a \,b^{2} c \,d^{2} g^{2}+2 A \,x^{3} b^{3} d^{3} g^{2}+2 B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) b^{3} c^{3} g^{2}+4 B \ln \left (b x +a \right ) a^{3} d^{3} g^{2}-4 B \ln \left (b x +a \right ) b^{3} c^{3} g^{2}}{6 b \,d^{3}}\) | \(471\) |
derivativedivides | \(-\frac {\frac {A \,g^{2} \left (-\frac {b^{2} \left (d x +c \right )^{3}}{3}-b \left (d a -b c \right ) \left (d x +c \right )^{2}-\left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right ) \left (d x +c \right )\right )}{d^{2}}+\frac {B \,g^{2} \left (\left (-\frac {\left (d x +c \right )^{3} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{3}-\left (-\frac {2 d a}{3}+\frac {2 b c}{3}\right ) \left (-\frac {\left (d a -b c \right )^{2} \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{3}}-\frac {\left (d x +c \right )^{2}}{2 b}-\frac {\left (-d a +b c \right ) \left (d x +c \right )}{b^{2}}+\frac {\left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right ) \ln \left (\frac {1}{d x +c}\right )}{b^{3}}\right )\right ) b^{2}+2 \left (-\frac {\left (d x +c \right )^{2} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{2}-\left (-d a +b c \right ) \left (\frac {\left (d a -b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{2}}-\frac {d x +c}{b}+\frac {\left (-d a +b c \right ) \ln \left (\frac {1}{d x +c}\right )}{b^{2}}\right )\right ) b \left (d a -b c \right )+\left (-\left (d x +c \right ) \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )-\left (-2 d a +2 b c \right ) \left (\frac {\left (-d a +b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b \left (d a -b c \right )}+\frac {\ln \left (\frac {1}{d x +c}\right )}{b}\right )\right ) \left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right )\right )}{d^{2}}}{d}\) | \(502\) |
default | \(-\frac {\frac {A \,g^{2} \left (-\frac {b^{2} \left (d x +c \right )^{3}}{3}-b \left (d a -b c \right ) \left (d x +c \right )^{2}-\left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right ) \left (d x +c \right )\right )}{d^{2}}+\frac {B \,g^{2} \left (\left (-\frac {\left (d x +c \right )^{3} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{3}-\left (-\frac {2 d a}{3}+\frac {2 b c}{3}\right ) \left (-\frac {\left (d a -b c \right )^{2} \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{3}}-\frac {\left (d x +c \right )^{2}}{2 b}-\frac {\left (-d a +b c \right ) \left (d x +c \right )}{b^{2}}+\frac {\left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right ) \ln \left (\frac {1}{d x +c}\right )}{b^{3}}\right )\right ) b^{2}+2 \left (-\frac {\left (d x +c \right )^{2} \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{2}-\left (-d a +b c \right ) \left (\frac {\left (d a -b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{2}}-\frac {d x +c}{b}+\frac {\left (-d a +b c \right ) \ln \left (\frac {1}{d x +c}\right )}{b^{2}}\right )\right ) b \left (d a -b c \right )+\left (-\left (d x +c \right ) \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )-\left (-2 d a +2 b c \right ) \left (\frac {\left (-d a +b c \right ) \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b \left (d a -b c \right )}+\frac {\ln \left (\frac {1}{d x +c}\right )}{b}\right )\right ) \left (a^{2} d^{2}-2 a c d b +c^{2} b^{2}\right )\right )}{d^{2}}}{d}\) | \(502\) |
Input:
int((b*g*x+a*g)^2*(A+B*ln(e*(b*x+a)^2/(d*x+c)^2)),x,method=_RETURNVERBOSE)
Output:
1/3*(b*x+a)^3*g^2*B/b*ln(e*(b*x+a)^2/(d*x+c)^2)+1/3*g^2*b^2*A*x^3+g^2*b*A* a*x^2+1/3*g^2*b*B*a*x^2-1/3*g^2*b^2/d*B*c*x^2+g^2*A*a^2*x+2/3*g^2/b*B*ln(d *x+c)*a^3-2*g^2/d*B*ln(d*x+c)*a^2*c+2*g^2*b/d^2*B*ln(d*x+c)*a*c^2-2/3*g^2* b^2/d^3*B*ln(d*x+c)*c^3+4/3*g^2*B*a^2*x-2*g^2*b/d*B*a*c*x+2/3*g^2*b^2/d^2* B*c^2*x
Leaf count of result is larger than twice the leaf count of optimal. 243 vs. \(2 (112) = 224\).
Time = 0.09 (sec) , antiderivative size = 243, normalized size of antiderivative = 2.02 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {A b^{3} d^{3} g^{2} x^{3} + 2 \, B a^{3} d^{3} g^{2} \log \left (b x + a\right ) - {\left (B b^{3} c d^{2} - {\left (3 \, A + B\right )} a b^{2} d^{3}\right )} g^{2} x^{2} + {\left (2 \, B b^{3} c^{2} d - 6 \, B a b^{2} c d^{2} + {\left (3 \, A + 4 \, B\right )} a^{2} b d^{3}\right )} g^{2} x - 2 \, {\left (B b^{3} c^{3} - 3 \, B a b^{2} c^{2} d + 3 \, B a^{2} b c d^{2}\right )} g^{2} \log \left (d x + c\right ) + {\left (B b^{3} d^{3} g^{2} x^{3} + 3 \, B a b^{2} d^{3} g^{2} x^{2} + 3 \, B a^{2} b d^{3} g^{2} x\right )} \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 )}{3 \, b d^{3}} \] Input:
integrate((b*g*x+a*g)^2*(A+B*log(e*(b*x+a)^2/(d*x+c)^2)),x, algorithm="fri cas")
Output:
1/3*(A*b^3*d^3*g^2*x^3 + 2*B*a^3*d^3*g^2*log(b*x + a) - (B*b^3*c*d^2 - (3* A + B)*a*b^2*d^3)*g^2*x^2 + (2*B*b^3*c^2*d - 6*B*a*b^2*c*d^2 + (3*A + 4*B) *a^2*b*d^3)*g^2*x - 2*(B*b^3*c^3 - 3*B*a*b^2*c^2*d + 3*B*a^2*b*c*d^2)*g^2* log(d*x + c) + (B*b^3*d^3*g^2*x^3 + 3*B*a*b^2*d^3*g^2*x^2 + 3*B*a^2*b*d^3* g^2*x)*log((b^2*e*x^2 + 2*a*b*e*x + a^2*e)/(d^2*x^2 + 2*c*d*x + c^2)))/(b* d^3)
Leaf count of result is larger than twice the leaf count of optimal. 517 vs. \(2 (107) = 214\).
Time = 1.57 (sec) , antiderivative size = 517, normalized size of antiderivative = 4.31 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {A b^{2} g^{2} x^{3}}{3} + \frac {2 B a^{3} g^{2} \log {\left (x + \frac {\frac {2 B a^{4} d^{3} g^{2}}{b} + 6 B a^{3} c d^{2} g^{2} - 6 B a^{2} b c^{2} d g^{2} + 2 B a b^{2} c^{3} g^{2}}{2 B a^{3} d^{3} g^{2} + 6 B a^{2} b c d^{2} g^{2} - 6 B a b^{2} c^{2} d g^{2} + 2 B b^{3} c^{3} g^{2}} \right )}}{3 b} - \frac {2 B c g^{2} \cdot \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right ) \log {\left (x + \frac {8 B a^{3} c d^{2} g^{2} - 6 B a^{2} b c^{2} d g^{2} + 2 B a b^{2} c^{3} g^{2} - 2 B a c g^{2} \cdot \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right ) + \frac {2 B b c^{2} g^{2} \cdot \left (3 a^{2} d^{2} - 3 a b c d + b^{2} c^{2}\right )}{d}}{2 B a^{3} d^{3} g^{2} + 6 B a^{2} b c d^{2} g^{2} - 6 B a b^{2} c^{2} d g^{2} + 2 B b^{3} c^{3} g^{2}} \right )}}{3 d^{3}} + x^{2} \left (A a b g^{2} + \frac {B a b g^{2}}{3} - \frac {B b^{2} c g^{2}}{3 d}\right ) + x \left (A a^{2} g^{2} + \frac {4 B a^{2} g^{2}}{3} - \frac {2 B a b c g^{2}}{d} + \frac {2 B b^{2} c^{2} g^{2}}{3 d^{2}}\right ) + \left (B a^{2} g^{2} x + B a b g^{2} x^{2} + \frac {B b^{2} g^{2} x^{3}}{3}\right ) \log {\left (\frac {e \left (a + b x\right )^{2}}{\left (c + d x\right )^{2}} \right )} \] Input:
integrate((b*g*x+a*g)**2*(A+B*ln(e*(b*x+a)**2/(d*x+c)**2)),x)
Output:
A*b**2*g**2*x**3/3 + 2*B*a**3*g**2*log(x + (2*B*a**4*d**3*g**2/b + 6*B*a** 3*c*d**2*g**2 - 6*B*a**2*b*c**2*d*g**2 + 2*B*a*b**2*c**3*g**2)/(2*B*a**3*d **3*g**2 + 6*B*a**2*b*c*d**2*g**2 - 6*B*a*b**2*c**2*d*g**2 + 2*B*b**3*c**3 *g**2))/(3*b) - 2*B*c*g**2*(3*a**2*d**2 - 3*a*b*c*d + b**2*c**2)*log(x + ( 8*B*a**3*c*d**2*g**2 - 6*B*a**2*b*c**2*d*g**2 + 2*B*a*b**2*c**3*g**2 - 2*B *a*c*g**2*(3*a**2*d**2 - 3*a*b*c*d + b**2*c**2) + 2*B*b*c**2*g**2*(3*a**2* d**2 - 3*a*b*c*d + b**2*c**2)/d)/(2*B*a**3*d**3*g**2 + 6*B*a**2*b*c*d**2*g **2 - 6*B*a*b**2*c**2*d*g**2 + 2*B*b**3*c**3*g**2))/(3*d**3) + x**2*(A*a*b *g**2 + B*a*b*g**2/3 - B*b**2*c*g**2/(3*d)) + x*(A*a**2*g**2 + 4*B*a**2*g* *2/3 - 2*B*a*b*c*g**2/d + 2*B*b**2*c**2*g**2/(3*d**2)) + (B*a**2*g**2*x + B*a*b*g**2*x**2 + B*b**2*g**2*x**3/3)*log(e*(a + b*x)**2/(c + d*x)**2)
Leaf count of result is larger than twice the leaf count of optimal. 437 vs. \(2 (112) = 224\).
Time = 0.05 (sec) , antiderivative size = 437, normalized size of antiderivative = 3.64 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {1}{3} \, A b^{2} g^{2} x^{3} + A a b g^{2} x^{2} + {\left (x \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a \log \left (b x + a\right )}{b} - \frac {2 \, c \log \left (d x + c\right )}{d}\right )} B a^{2} g^{2} + {\left (x^{2} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) - \frac {2 \, a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {2 \, c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {2 \, {\left (b c - a d\right )} x}{b d}\right )} B a b g^{2} + \frac {1}{3} \, {\left (x^{3} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} B b^{2} g^{2} + A a^{2} g^{2} x \] Input:
integrate((b*g*x+a*g)^2*(A+B*log(e*(b*x+a)^2/(d*x+c)^2)),x, algorithm="max ima")
Output:
1/3*A*b^2*g^2*x^3 + A*a*b*g^2*x^2 + (x*log(b^2*e*x^2/(d^2*x^2 + 2*c*d*x + c^2) + 2*a*b*e*x/(d^2*x^2 + 2*c*d*x + c^2) + a^2*e/(d^2*x^2 + 2*c*d*x + c^ 2)) + 2*a*log(b*x + a)/b - 2*c*log(d*x + c)/d)*B*a^2*g^2 + (x^2*log(b^2*e* x^2/(d^2*x^2 + 2*c*d*x + c^2) + 2*a*b*e*x/(d^2*x^2 + 2*c*d*x + c^2) + a^2* e/(d^2*x^2 + 2*c*d*x + c^2)) - 2*a^2*log(b*x + a)/b^2 + 2*c^2*log(d*x + c) /d^2 - 2*(b*c - a*d)*x/(b*d))*B*a*b*g^2 + 1/3*(x^3*log(b^2*e*x^2/(d^2*x^2 + 2*c*d*x + c^2) + 2*a*b*e*x/(d^2*x^2 + 2*c*d*x + c^2) + a^2*e/(d^2*x^2 + 2*c*d*x + c^2)) + 2*a^3*log(b*x + a)/b^3 - 2*c^3*log(d*x + c)/d^3 - ((b^2* c*d - a*b*d^2)*x^2 - 2*(b^2*c^2 - a^2*d^2)*x)/(b^2*d^2))*B*b^2*g^2 + A*a^2 *g^2*x
Leaf count of result is larger than twice the leaf count of optimal. 246 vs. \(2 (112) = 224\).
Time = 1.10 (sec) , antiderivative size = 246, normalized size of antiderivative = 2.05 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {1}{3} \, A b^{2} g^{2} x^{3} + \frac {2 \, B a^{3} g^{2} \log \left (b x + a\right )}{3 \, b} - \frac {{\left (B b^{2} c g^{2} - 3 \, A a b d g^{2} - B a b d g^{2}\right )} x^{2}}{3 \, d} + \frac {1}{3} \, {\left (B b^{2} g^{2} x^{3} + 3 \, B a b g^{2} x^{2} + 3 \, B a^{2} g^{2} x\right )} \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 ) + \frac {{\left (2 \, B b^{2} c^{2} g^{2} - 6 \, B a b c d g^{2} + 3 \, A a^{2} d^{2} g^{2} + 4 \, B a^{2} d^{2} g^{2}\right )} x}{3 \, d^{2}} - \frac {2 \, {\left (B b^{2} c^{3} g^{2} - 3 \, B a b c^{2} d g^{2} + 3 \, B a^{2} c d^{2} g^{2}\right )} \log \left (-d x - c\right )}{3 \, d^{3}} \] Input:
integrate((b*g*x+a*g)^2*(A+B*log(e*(b*x+a)^2/(d*x+c)^2)),x, algorithm="gia c")
Output:
1/3*A*b^2*g^2*x^3 + 2/3*B*a^3*g^2*log(b*x + a)/b - 1/3*(B*b^2*c*g^2 - 3*A* a*b*d*g^2 - B*a*b*d*g^2)*x^2/d + 1/3*(B*b^2*g^2*x^3 + 3*B*a*b*g^2*x^2 + 3* B*a^2*g^2*x)*log((b^2*e*x^2 + 2*a*b*e*x + a^2*e)/(d^2*x^2 + 2*c*d*x + c^2) ) + 1/3*(2*B*b^2*c^2*g^2 - 6*B*a*b*c*d*g^2 + 3*A*a^2*d^2*g^2 + 4*B*a^2*d^2 *g^2)*x/d^2 - 2/3*(B*b^2*c^3*g^2 - 3*B*a*b*c^2*d*g^2 + 3*B*a^2*c*d^2*g^2)* log(-d*x - c)/d^3
Time = 25.98 (sec) , antiderivative size = 296, normalized size of antiderivative = 2.47 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=x^2\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+2\,B\,a\,d-2\,B\,b\,c\right )}{6\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,d}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {b\,g^2\,\left (9\,A\,a\,d+3\,A\,b\,c+2\,B\,a\,d-2\,B\,b\,c\right )}{3\,d}-\frac {A\,b\,g^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,d}\right )}{3\,b\,d}-\frac {a\,g^2\,\left (3\,A\,a\,d+3\,A\,b\,c+2\,B\,a\,d-2\,B\,b\,c\right )}{d}+\frac {A\,a\,b\,c\,g^2}{d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )\,\left (B\,a^2\,g^2\,x+B\,a\,b\,g^2\,x^2+\frac {B\,b^2\,g^2\,x^3}{3}\right )-\frac {\ln \left (c+d\,x\right )\,\left (6\,B\,a^2\,c\,d^2\,g^2-6\,B\,a\,b\,c^2\,d\,g^2+2\,B\,b^2\,c^3\,g^2\right )}{3\,d^3}+\frac {A\,b^2\,g^2\,x^3}{3}+\frac {2\,B\,a^3\,g^2\,\ln \left (a+b\,x\right )}{3\,b} \] Input:
int((a*g + b*g*x)^2*(A + B*log((e*(a + b*x)^2)/(c + d*x)^2)),x)
Output:
x^2*((b*g^2*(9*A*a*d + 3*A*b*c + 2*B*a*d - 2*B*b*c))/(6*d) - (A*b*g^2*(3*a *d + 3*b*c))/(6*d)) - x*(((3*a*d + 3*b*c)*((b*g^2*(9*A*a*d + 3*A*b*c + 2*B *a*d - 2*B*b*c))/(3*d) - (A*b*g^2*(3*a*d + 3*b*c))/(3*d)))/(3*b*d) - (a*g^ 2*(3*A*a*d + 3*A*b*c + 2*B*a*d - 2*B*b*c))/d + (A*a*b*c*g^2)/d) + log((e*( a + b*x)^2)/(c + d*x)^2)*((B*b^2*g^2*x^3)/3 + B*a^2*g^2*x + B*a*b*g^2*x^2) - (log(c + d*x)*(2*B*b^2*c^3*g^2 + 6*B*a^2*c*d^2*g^2 - 6*B*a*b*c^2*d*g^2) )/(3*d^3) + (A*b^2*g^2*x^3)/3 + (2*B*a^3*g^2*log(a + b*x))/(3*b)
Time = 0.15 (sec) , antiderivative size = 354, normalized size of antiderivative = 2.95 \[ \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx=\frac {g^{2} \left (2 \,\mathrm {log}\left (d x +c \right ) a^{3} d^{3}-6 \,\mathrm {log}\left (d x +c \right ) a^{2} b c \,d^{2}+6 \,\mathrm {log}\left (d x +c \right ) a \,b^{2} c^{2} d -2 \,\mathrm {log}\left (d x +c \right ) b^{3} c^{3}+\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^{3} d^{3}+3 \,\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} b \,d^{3} x +3 \,\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^{2} d^{3} 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 ) b^{3} d^{3} x^{3}+3 a^{3} d^{3} x +3 a^{2} b \,d^{3} x^{2}+4 a^{2} b \,d^{3} x -6 a \,b^{2} c \,d^{2} x +a \,b^{2} d^{3} x^{3}+a \,b^{2} d^{3} x^{2}+2 b^{3} c^{2} d x -b^{3} c \,d^{2} x^{2}\right )}{3 d^{3}} \] Input:
int((b*g*x+a*g)^2*(A+B*log(e*(b*x+a)^2/(d*x+c)^2)),x)
Output:
(g**2*(2*log(c + d*x)*a**3*d**3 - 6*log(c + d*x)*a**2*b*c*d**2 + 6*log(c + d*x)*a*b**2*c**2*d - 2*log(c + d*x)*b**3*c**3 + 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**3*d**3 + 3*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*b*d**3*x + 3*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**2*d **3*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))*b**3*d**3*x**3 + 3*a**3*d**3*x + 3*a**2*b*d**3*x**2 + 4*a**2*b*d**3* x - 6*a*b**2*c*d**2*x + a*b**2*d**3*x**3 + a*b**2*d**3*x**2 + 2*b**3*c**2* d*x - b**3*c*d**2*x**2))/(3*d**3)