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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.96, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {2963, 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 (a g+b g x)^m (c i+d i x)^{-m-2} \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right ) \, dx\)

\(\Big \downarrow \) 2963

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

\(\Big \downarrow \) 2741

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

Input:

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

Output:

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

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 2963
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.)*((h_.) + (i_.)*(x_))^(q_.), x_Symbol 
] :> Simp[d^2*((g*((a + b*x)/b))^m/(i^2*(b*c - a*d)*(i*((c + d*x)/d))^m*((a 
 + b*x)/(c + d*x))^m))   Subst[Int[x^m*(A + B*Log[e*x^n])^p, x], x, (a + b* 
x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, A, B, m, n, p, q}, x 
] && NeQ[b*c - a*d, 0] && EqQ[b*f - a*g, 0] && EqQ[d*h - c*i, 0] && EqQ[m + 
 q + 2, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(825\) vs. \(2(128)=256\).

Time = 36.54 (sec) , antiderivative size = 826, normalized size of antiderivative = 6.45

method result size
parallelrisch \(-\frac {-B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} c d \,n^{2}+A x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} a b \,d^{2} n +A x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} c d n -B \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} a b c d \,n^{2}+A \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} a b c d n +B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b \,d^{2} m n +B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{2} c d m n +B \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b c d m n +A \,x^{2} \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} d^{2} m n -B \,x^{2} \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} d^{2} n^{2}+A \,x^{2} \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} d^{2} n +B \,x^{2} \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{2} d^{2} m n +A x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} a b \,d^{2} m n +A x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} b^{2} c d m n +B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b \,d^{2} n +B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{2} c d n +A \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} a b c d m n +B \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) a b c d n +B \,x^{2} \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m} \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right ) b^{2} d^{2} n -B x \left (g \left (b x +a \right )\right )^{m} \left (i \left (d x +c \right )\right )^{-2-m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 
)^(-2-m)*ln(e*((b*x+a)/(d*x+c))^n)*b^2*c*d*n+A*(g*(b*x+a))^m*(i*(d*x+c))^( 
-2-m)*a*b*c*d*m*n+B*(g*(b*x+a))^m*(i*(d*x+c))^(-2-m)*ln(e*((b*x+a)/(d*x+c) 
)^n)*a*b*c*d*n+B*x^2*(g*(b*x+a))^m*(i*(d*x+c))^(-2-m)*ln(e*((b*x+a)/(d*x+c 
))^n)*b^2*d^2*n-B*x*(g*(b*x+a))^m*(i*(d*x+c))^(-2-m)*a*b*d^2*n^2)/n/(a*d*m 
-b*c*m+a*d-b*c)/(1+m)/b/d
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 274 vs. \(2 (128) = 256\).

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

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

Output:

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

Sympy [F(-2)]

Exception generated. \[ \int (a g+b g x)^m (c i+d i x)^{-2-m} \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \] Input:

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

Output:

Exception raised: HeuristicGCDFailed >> no luck
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

 - (int((a*g + b*g*x)**m/((c*i + d*i*x)**m*c**2 + 2*(c*i + d*i*x)**m*c*d*x 
 + (c*i + d*i*x)**m*d**2*x**2),x)*a + int(((a*g + b*g*x)**m*log(((a + b*x) 
**n*e)/(c + d*x)**n))/((c*i + d*i*x)**m*c**2 + 2*(c*i + d*i*x)**m*c*d*x + 
(c*i + d*i*x)**m*d**2*x**2),x)*b)