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

Optimal result
Mathematica [A] (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 = 29, antiderivative size = 90 \[ \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^2} \, dx=\frac {(a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{(b f-a g) (f+g x)}+\frac {2 B (b c-a d) \log \left (\frac {f+g x}{c+d x}\right )}{(b f-a g) (d f-c g)} \] Output:

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

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.20 \[ \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^2} \, dx=\frac {-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{f+g x}+\frac {2 B (b (d f-c g) \log (a+b x)+(-b d f+a d g) \log (c+d x)+(b c-a d) g \log (f+g x))}{(b f-a g) (d f-c g)}}{g} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.56, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {2954, 2751, 16}

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

\(\Big \downarrow \) 2954

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

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

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

rule 2751
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x 
_Symbol] :> Simp[x*(d + e*x^r)^(q + 1)*((a + b*Log[c*x^n])/d), x] - Simp[b* 
(n/d)   Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q, r}, 
x] && EqQ[r*(q + 1) + 1, 0]
 

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 [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(244\) vs. \(2(90)=180\).

Time = 1.36 (sec) , antiderivative size = 245, normalized size of antiderivative = 2.72

method result size
derivativedivides \(-\frac {-\frac {d^{2} A}{\left (\frac {c g -d f}{d x +c}-g \right ) \left (c g -d f \right )}+\frac {-\frac {b B d \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{a g -b f}-\frac {B d \left (d a -b 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 (a g -b f \right ) \left (d x +c \right )}}{\frac {c g}{d x +c}-\frac {f d}{d x +c}-g}+\frac {2 B d \left (d a -b c \right ) \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right )}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}}{d}\) \(245\)
default \(-\frac {-\frac {d^{2} A}{\left (\frac {c g -d f}{d x +c}-g \right ) \left (c g -d f \right )}+\frac {-\frac {b B d \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{a g -b f}-\frac {B d \left (d a -b 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 (a g -b f \right ) \left (d x +c \right )}}{\frac {c g}{d x +c}-\frac {f d}{d x +c}-g}+\frac {2 B d \left (d a -b c \right ) \ln \left (\frac {c g}{d x +c}-\frac {f d}{d x +c}-g \right )}{a c \,g^{2}-a d f g -b c f g +b d \,f^{2}}}{d}\) \(245\)
risch \(-\frac {B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{g \left (g x +f \right )}-\frac {-2 B \ln \left (-d x -c \right ) a d \,g^{2} x +2 B \ln \left (-d x -c \right ) b d f g x +2 B \ln \left (-b x -a \right ) b c \,g^{2} x -2 B \ln \left (-b x -a \right ) b d f g x +2 B \ln \left (g x +f \right ) a d \,g^{2} x -2 B \ln \left (g x +f \right ) b c \,g^{2} x -2 B \ln \left (-d x -c \right ) a d f g +2 B \ln \left (-d x -c \right ) b d \,f^{2}+2 B \ln \left (-b x -a \right ) b c f g -2 B \ln \left (-b x -a \right ) b d \,f^{2}+2 B \ln \left (g x +f \right ) a d f g -2 B \ln \left (g x +f \right ) b c f g +A a c \,g^{2}-A a d f g -A b c f g +A b d \,f^{2}}{\left (a c \,g^{2}-a d f g -b c f g +b d \,f^{2}\right ) \left (g x +f \right ) g}\) \(292\)
parallelrisch \(\frac {2 A x \,a^{2} c^{2} g^{2}+4 B \ln \left (b x +a \right ) x \,a^{2} c d f g -4 B \ln \left (b x +a \right ) x a b \,c^{2} f g -4 B \ln \left (g x +f \right ) x \,a^{2} c d f g +4 B \ln \left (g x +f \right ) x a b \,c^{2} f g -2 B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a^{2} c^{2} f g +2 B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a b \,c^{2} f^{2}-2 A x \,a^{2} c d f g +4 B \ln \left (b x +a \right ) a^{2} c d \,f^{2}-4 B \ln \left (b x +a \right ) a b \,c^{2} f^{2}-4 B \ln \left (g x +f \right ) a^{2} c d \,f^{2}+4 B \ln \left (g x +f \right ) a b \,c^{2} f^{2}-2 A x a b \,c^{2} f g +2 A x a b c d \,f^{2}-2 B x \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a^{2} c d f g +2 B x \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right ) a b c d \,f^{2}}{2 \left (a c \,g^{2}-a d f g -b c f g +b d \,f^{2}\right ) \left (g x +f \right ) a c f}\) \(341\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 279 vs. \(2 (90) = 180\).

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

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

Output:

-(A*b*d*f^2 + A*a*c*g^2 - (A*b*c + A*a*d)*f*g - 2*(B*b*d*f^2 - B*b*c*f*g + 
 (B*b*d*f*g - B*b*c*g^2)*x)*log(b*x + a) + 2*(B*b*d*f^2 - B*a*d*f*g + (B*b 
*d*f*g - B*a*d*g^2)*x)*log(d*x + c) - 2*((B*b*c - B*a*d)*g^2*x + (B*b*c - 
B*a*d)*f*g)*log(g*x + f) + (B*b*d*f^2 + B*a*c*g^2 - (B*b*c + B*a*d)*f*g)*l 
og((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*f^3*g 
+ a*c*f*g^3 - (b*c + a*d)*f^2*g^2 + (b*d*f^2*g^2 + a*c*g^4 - (b*c + a*d)*f 
*g^3)*x)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 192 vs. \(2 (90) = 180\).

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

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 26.45 (sec) , antiderivative size = 191, normalized size of antiderivative = 2.12 \[ \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(f+g x)^2} \, dx=\frac {2\,B\,d\,\ln \left (c+d\,x\right )}{c\,g^2-d\,f\,g}-\frac {B\,\ln \left (\frac {e\,a^2+2\,e\,a\,b\,x+e\,b^2\,x^2}{c^2+2\,c\,d\,x+d^2\,x^2}\right )}{x\,g^2+f\,g}-\frac {2\,B\,b\,\ln \left (a+b\,x\right )}{a\,g^2-b\,f\,g}-\frac {A}{x\,g^2+f\,g}-\frac {2\,B\,a\,d\,\ln \left (f+g\,x\right )}{a\,c\,g^2+b\,d\,f^2-a\,d\,f\,g-b\,c\,f\,g}+\frac {2\,B\,b\,c\,\ln \left (f+g\,x\right )}{a\,c\,g^2+b\,d\,f^2-a\,d\,f\,g-b\,c\,f\,g} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

( - 2*log(a + b*x)*a*b*c*f*g - 2*log(a + b*x)*a*b*c*g**2*x + 2*log(a + b*x 
)*a*b*d*f**2 + 2*log(a + b*x)*a*b*d*f*g*x + 2*log(c + d*x)*a*b*c*f*g + 2*l 
og(c + d*x)*a*b*c*g**2*x - 2*log(c + d*x)*b**2*c*f**2 - 2*log(c + d*x)*b** 
2*c*f*g*x - 2*log(f + g*x)*a*b*d*f**2 - 2*log(f + g*x)*a*b*d*f*g*x + 2*log 
(f + g*x)*b**2*c*f**2 + 2*log(f + g*x)*b**2*c*f*g*x + 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*c*g**2*x - 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*d*f*g*x - l 
og((a**2*e + 2*a*b*e*x + b**2*e*x**2)/(c**2 + 2*c*d*x + d**2*x**2))*b**2*c 
*f*g*x + 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**2*d*f**2*x + a**2*c*g**2*x - a**2*d*f*g*x - a*b*c*f*g*x + a*b*d*f** 
2*x)/(f*(a*c*f*g**2 + a*c*g**3*x - a*d*f**2*g - a*d*f*g**2*x - b*c*f**2*g 
- b*c*f*g**2*x + b*d*f**3 + b*d*f**2*g*x))