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

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

Optimal result

Integrand size = 41, antiderivative size = 89 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=-\frac {B g n (a+b x)^2}{4 (b c-a d) i^3 (c+d x)^2}+\frac {g (a+b x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 (b c-a d) i^3 (c+d x)^2} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(215\) vs. \(2(89)=178\).

Time = 0.18 (sec) , antiderivative size = 215, normalized size of antiderivative = 2.42 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=\frac {g \left (\frac {(b c-a d) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{2 d^2 (c+d x)^2}-\frac {b \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{d^2 (c+d x)}+\frac {b B n \left (\frac {1}{c+d x}+\frac {b \log (a+b x)}{b c-a d}-\frac {b \log (c+d x)}{b c-a d}\right )}{d^2}-\frac {B n \left (\frac {b c-a d}{(c+d x)^2}+\frac {2 b}{c+d x}+\frac {2 b^2 \log (a+b x)}{b c-a d}-\frac {2 b^2 \log (c+d x)}{b c-a d}\right )}{4 d^2}\right )}{i^3} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.85, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {2961, 2741}

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 (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{(c i+d i x)^3} \, dx\)

\(\Big \downarrow \) 2961

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

\(\Big \downarrow \) 2741

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2741
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> 
Simp[(d*x)^(m + 1)*((a + b*Log[c*x^n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^( 
m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1]
 

rule 2961
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.)*((h_.) + (i_.)*(x_))^(q_.), x_Symbol 
] :> Simp[(b*c - a*d)^(m + q + 1)*(g/b)^m*(i/d)^q   Subst[Int[x^m*((A + B*L 
og[e*x^n])^p/(b - d*x)^(m + q + 2)), x], x, (a + b*x)/(c + d*x)], x] /; Fre 
eQ[{a, b, c, d, e, f, g, h, i, A, B, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[ 
b*f - a*g, 0] && EqQ[d*h - c*i, 0] && IntegersQ[m, q]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(236\) vs. \(2(85)=170\).

Time = 4.89 (sec) , antiderivative size = 237, normalized size of antiderivative = 2.66

method result size
parallelrisch \(-\frac {4 B x \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a \,b^{2} d^{4} g n -B \,a^{2} b \,d^{4} g \,n^{2}+B \,b^{3} c^{2} d^{2} g \,n^{2}+2 A \,a^{2} b \,d^{4} g n -2 A \,b^{3} c^{2} d^{2} g n +2 B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a^{2} b \,d^{4} g n +2 B \,x^{2} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{3} d^{4} g n -2 B x a \,b^{2} d^{4} g \,n^{2}+2 B x \,b^{3} c \,d^{3} g \,n^{2}+4 A x a \,b^{2} d^{4} g n -4 A x \,b^{3} c \,d^{3} g n}{4 i^{3} \left (d x +c \right )^{2} b \,d^{4} n \left (d a -b c \right )}\) \(237\)

Input:

int((b*g*x+a*g)*(A+B*ln(e*((b*x+a)/(d*x+c))^n))/(d*i*x+c*i)^3,x,method=_RE 
TURNVERBOSE)
 

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (85) = 170\).

Time = 0.11 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.81 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=\frac {{\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g n - 2 \, {\left (A b^{2} c^{2} - A a^{2} d^{2}\right )} g + 2 \, {\left ({\left (B b^{2} c d - B a b d^{2}\right )} g n - 2 \, {\left (A b^{2} c d - A a b d^{2}\right )} g\right )} x - 2 \, {\left (2 \, {\left (B b^{2} c d - B a b d^{2}\right )} g x + {\left (B b^{2} c^{2} - B a^{2} d^{2}\right )} g\right )} \log \left (e\right ) + 2 \, {\left (B b^{2} d^{2} g n x^{2} + 2 \, B a b d^{2} g n x + B a^{2} d^{2} g n\right )} \log \left (\frac {b x + a}{d x + c}\right )}{4 \, {\left ({\left (b c d^{4} - a d^{5}\right )} i^{3} x^{2} + 2 \, {\left (b c^{2} d^{3} - a c d^{4}\right )} i^{3} x + {\left (b c^{3} d^{2} - a c^{2} d^{3}\right )} i^{3}\right )}} \] Input:

integrate((b*g*x+a*g)*(A+B*log(e*((b*x+a)/(d*x+c))^n))/(d*i*x+c*i)^3,x, al 
gorithm="fricas")
 

Output:

1/4*((B*b^2*c^2 - B*a^2*d^2)*g*n - 2*(A*b^2*c^2 - A*a^2*d^2)*g + 2*((B*b^2 
*c*d - B*a*b*d^2)*g*n - 2*(A*b^2*c*d - A*a*b*d^2)*g)*x - 2*(2*(B*b^2*c*d - 
 B*a*b*d^2)*g*x + (B*b^2*c^2 - B*a^2*d^2)*g)*log(e) + 2*(B*b^2*d^2*g*n*x^2 
 + 2*B*a*b*d^2*g*n*x + B*a^2*d^2*g*n)*log((b*x + a)/(d*x + c)))/((b*c*d^4 
- a*d^5)*i^3*x^2 + 2*(b*c^2*d^3 - a*c*d^4)*i^3*x + (b*c^3*d^2 - a*c^2*d^3) 
*i^3)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 578 vs. \(2 (85) = 170\).

Time = 0.05 (sec) , antiderivative size = 578, normalized size of antiderivative = 6.49 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=\frac {1}{4} \, B b g n {\left (\frac {b c^{2} - 3 \, a c d + 2 \, {\left (b c d - 2 \, a d^{2}\right )} x}{{\left (b c d^{4} - a d^{5}\right )} i^{3} x^{2} + 2 \, {\left (b c^{2} d^{3} - a c d^{4}\right )} i^{3} x + {\left (b c^{3} d^{2} - a c^{2} d^{3}\right )} i^{3}} + \frac {2 \, {\left (b^{2} c - 2 \, a b d\right )} \log \left (b x + a\right )}{{\left (b^{2} c^{2} d^{2} - 2 \, a b c d^{3} + a^{2} d^{4}\right )} i^{3}} - \frac {2 \, {\left (b^{2} c - 2 \, a b d\right )} \log \left (d x + c\right )}{{\left (b^{2} c^{2} d^{2} - 2 \, a b c d^{3} + a^{2} d^{4}\right )} i^{3}}\right )} + \frac {1}{4} \, B a g n {\left (\frac {2 \, b d x + 3 \, b c - a d}{{\left (b c d^{3} - a d^{4}\right )} i^{3} x^{2} + 2 \, {\left (b c^{2} d^{2} - a c d^{3}\right )} i^{3} x + {\left (b c^{3} d - a c^{2} d^{2}\right )} i^{3}} + \frac {2 \, b^{2} \log \left (b x + a\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} i^{3}} - \frac {2 \, b^{2} \log \left (d x + c\right )}{{\left (b^{2} c^{2} d - 2 \, a b c d^{2} + a^{2} d^{3}\right )} i^{3}}\right )} - \frac {{\left (2 \, d x + c\right )} B b g \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )}{2 \, {\left (d^{4} i^{3} x^{2} + 2 \, c d^{3} i^{3} x + c^{2} d^{2} i^{3}\right )}} - \frac {{\left (2 \, d x + c\right )} A b g}{2 \, {\left (d^{4} i^{3} x^{2} + 2 \, c d^{3} i^{3} x + c^{2} d^{2} i^{3}\right )}} - \frac {B a g \log \left (e {\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n}\right )}{2 \, {\left (d^{3} i^{3} x^{2} + 2 \, c d^{2} i^{3} x + c^{2} d i^{3}\right )}} - \frac {A a g}{2 \, {\left (d^{3} i^{3} x^{2} + 2 \, c d^{2} i^{3} x + c^{2} d i^{3}\right )}} \] Input:

integrate((b*g*x+a*g)*(A+B*log(e*((b*x+a)/(d*x+c))^n))/(d*i*x+c*i)^3,x, al 
gorithm="maxima")
 

Output:

1/4*B*b*g*n*((b*c^2 - 3*a*c*d + 2*(b*c*d - 2*a*d^2)*x)/((b*c*d^4 - a*d^5)* 
i^3*x^2 + 2*(b*c^2*d^3 - a*c*d^4)*i^3*x + (b*c^3*d^2 - a*c^2*d^3)*i^3) + 2 
*(b^2*c - 2*a*b*d)*log(b*x + a)/((b^2*c^2*d^2 - 2*a*b*c*d^3 + a^2*d^4)*i^3 
) - 2*(b^2*c - 2*a*b*d)*log(d*x + c)/((b^2*c^2*d^2 - 2*a*b*c*d^3 + a^2*d^4 
)*i^3)) + 1/4*B*a*g*n*((2*b*d*x + 3*b*c - a*d)/((b*c*d^3 - a*d^4)*i^3*x^2 
+ 2*(b*c^2*d^2 - a*c*d^3)*i^3*x + (b*c^3*d - a*c^2*d^2)*i^3) + 2*b^2*log(b 
*x + a)/((b^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*i^3) - 2*b^2*log(d*x + c)/((b 
^2*c^2*d - 2*a*b*c*d^2 + a^2*d^3)*i^3)) - 1/2*(2*d*x + c)*B*b*g*log(e*(b*x 
/(d*x + c) + a/(d*x + c))^n)/(d^4*i^3*x^2 + 2*c*d^3*i^3*x + c^2*d^2*i^3) - 
 1/2*(2*d*x + c)*A*b*g/(d^4*i^3*x^2 + 2*c*d^3*i^3*x + c^2*d^2*i^3) - 1/2*B 
*a*g*log(e*(b*x/(d*x + c) + a/(d*x + c))^n)/(d^3*i^3*x^2 + 2*c*d^2*i^3*x + 
 c^2*d*i^3) - 1/2*A*a*g/(d^3*i^3*x^2 + 2*c*d^2*i^3*x + c^2*d*i^3)
 

Giac [A] (verification not implemented)

Time = 0.63 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.13 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=\frac {1}{4} \, {\left (\frac {2 \, {\left (b x + a\right )}^{2} B g n \log \left (\frac {b x + a}{d x + c}\right )}{{\left (d x + c\right )}^{2} i^{3}} - \frac {{\left (B g n - 2 \, B g \log \left (e\right ) - 2 \, A g\right )} {\left (b x + a\right )}^{2}}{{\left (d x + c\right )}^{2} i^{3}}\right )} {\left (\frac {b c}{{\left (b c - a d\right )}^{2}} - \frac {a d}{{\left (b c - a d\right )}^{2}}\right )} \] Input:

integrate((b*g*x+a*g)*(A+B*log(e*((b*x+a)/(d*x+c))^n))/(d*i*x+c*i)^3,x, al 
gorithm="giac")
 

Output:

1/4*(2*(b*x + a)^2*B*g*n*log((b*x + a)/(d*x + c))/((d*x + c)^2*i^3) - (B*g 
*n - 2*B*g*log(e) - 2*A*g)*(b*x + a)^2/((d*x + c)^2*i^3))*(b*c/(b*c - a*d) 
^2 - a*d/(b*c - a*d)^2)
 

Mupad [B] (verification not implemented)

Time = 26.33 (sec) , antiderivative size = 205, normalized size of antiderivative = 2.30 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=-\frac {x\,\left (2\,A\,b\,d\,g-B\,b\,d\,g\,n\right )+A\,a\,d\,g+A\,b\,c\,g-\frac {B\,a\,d\,g\,n}{2}-\frac {B\,b\,c\,g\,n}{2}}{2\,c^2\,d^2\,i^3+4\,c\,d^3\,i^3\,x+2\,d^4\,i^3\,x^2}-\frac {\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (\frac {B\,a\,g}{2\,d}+\frac {B\,b\,c\,g}{2\,d^2}+\frac {B\,b\,g\,x}{d}\right )}{c^2\,i^3+2\,c\,d\,i^3\,x+d^2\,i^3\,x^2}+\frac {B\,b^2\,g\,n\,\mathrm {atan}\left (\frac {b\,c\,2{}\mathrm {i}+b\,d\,x\,2{}\mathrm {i}}{a\,d-b\,c}+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{d^2\,i^3\,\left (a\,d-b\,c\right )} \] Input:

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

Output:

(B*b^2*g*n*atan((b*c*2i + b*d*x*2i)/(a*d - b*c) + 1i)*1i)/(d^2*i^3*(a*d - 
b*c)) - (log(e*((a + b*x)/(c + d*x))^n)*((B*a*g)/(2*d) + (B*b*c*g)/(2*d^2) 
 + (B*b*g*x)/d))/(c^2*i^3 + d^2*i^3*x^2 + 2*c*d*i^3*x) - (x*(2*A*b*d*g - B 
*b*d*g*n) + A*a*d*g + A*b*c*g - (B*a*d*g*n)/2 - (B*b*c*g*n)/2)/(2*c^2*d^2* 
i^3 + 2*d^4*i^3*x^2 + 4*c*d^3*i^3*x)
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 357, normalized size of antiderivative = 4.01 \[ \int \frac {(a g+b g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(c i+d i x)^3} \, dx=\frac {g i \left (-2 \,\mathrm {log}\left (b x +a \right ) a \,b^{2} c^{2} n -4 \,\mathrm {log}\left (b x +a \right ) a \,b^{2} c d n x -2 \,\mathrm {log}\left (b x +a \right ) a \,b^{2} d^{2} n \,x^{2}+2 \,\mathrm {log}\left (d x +c \right ) a \,b^{2} c^{2} n +4 \,\mathrm {log}\left (d x +c \right ) a \,b^{2} c d n x +2 \,\mathrm {log}\left (d x +c \right ) a \,b^{2} d^{2} n \,x^{2}-2 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a^{2} b c d +2 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a \,b^{2} c^{2}+2 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) a \,b^{2} d^{2} x^{2}-2 \,\mathrm {log}\left (\frac {\left (b x +a \right )^{n} e}{\left (d x +c \right )^{n}}\right ) b^{3} c d \,x^{2}-2 a^{3} c d +2 a^{2} b \,c^{2}+a^{2} b c d n +2 a^{2} b \,d^{2} x^{2}-a \,b^{2} c^{2} n -2 a \,b^{2} c d \,x^{2}-a \,b^{2} d^{2} n \,x^{2}+b^{3} c d n \,x^{2}\right )}{4 c d \left (a \,d^{3} x^{2}-b c \,d^{2} x^{2}+2 a c \,d^{2} x -2 b \,c^{2} d x +a \,c^{2} d -b \,c^{3}\right )} \] Input:

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

Output:

(g*i*( - 2*log(a + b*x)*a*b**2*c**2*n - 4*log(a + b*x)*a*b**2*c*d*n*x - 2* 
log(a + b*x)*a*b**2*d**2*n*x**2 + 2*log(c + d*x)*a*b**2*c**2*n + 4*log(c + 
 d*x)*a*b**2*c*d*n*x + 2*log(c + d*x)*a*b**2*d**2*n*x**2 - 2*log(((a + b*x 
)**n*e)/(c + d*x)**n)*a**2*b*c*d + 2*log(((a + b*x)**n*e)/(c + d*x)**n)*a* 
b**2*c**2 + 2*log(((a + b*x)**n*e)/(c + d*x)**n)*a*b**2*d**2*x**2 - 2*log( 
((a + b*x)**n*e)/(c + d*x)**n)*b**3*c*d*x**2 - 2*a**3*c*d + 2*a**2*b*c**2 
+ a**2*b*c*d*n + 2*a**2*b*d**2*x**2 - a*b**2*c**2*n - 2*a*b**2*c*d*x**2 - 
a*b**2*d**2*n*x**2 + b**3*c*d*n*x**2))/(4*c*d*(a*c**2*d + 2*a*c*d**2*x + a 
*d**3*x**2 - b*c**3 - 2*b*c**2*d*x - b*c*d**2*x**2))