3.528 \(\int \frac{d+e f^{g+h x}}{a+b f^{g+h x}+c f^{2 (g+h x)}} \, dx\)

Optimal. Leaf size=103 \[ \frac{(b d-2 a e) \tanh ^{-1}\left (\frac{b+2 c f^{g+h x}}{\sqrt{b^2-4 a c}}\right )}{a h \log (f) \sqrt{b^2-4 a c}}-\frac{d \log \left (a+b f^{g+h x}+c f^{2 g+2 h x}\right )}{2 a h \log (f)}+\frac{d x}{a} \]

[Out]

(d*x)/a + ((b*d - 2*a*e)*ArcTanh[(b + 2*c*f^(g + h*x))/Sqrt[b^2 - 4*a*c]])/(a*Sqrt[b^2 - 4*a*c]*h*Log[f]) - (d
*Log[a + b*f^(g + h*x) + c*f^(2*g + 2*h*x)])/(2*a*h*Log[f])

________________________________________________________________________________________

Rubi [A]  time = 0.141365, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {2282, 800, 634, 618, 206, 628} \[ \frac{(b d-2 a e) \tanh ^{-1}\left (\frac{b+2 c f^{g+h x}}{\sqrt{b^2-4 a c}}\right )}{a h \log (f) \sqrt{b^2-4 a c}}-\frac{d \log \left (a+b f^{g+h x}+c f^{2 g+2 h x}\right )}{2 a h \log (f)}+\frac{d x}{a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(d*x)/a + ((b*d - 2*a*e)*ArcTanh[(b + 2*c*f^(g + h*x))/Sqrt[b^2 - 4*a*c]])/(a*Sqrt[b^2 - 4*a*c]*h*Log[f]) - (d
*Log[a + b*f^(g + h*x) + c*f^(2*g + 2*h*x)])/(2*a*h*Log[f])

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{d+e f^{g+h x}}{a+b f^{g+h x}+c f^{2 (g+h x)}} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{d+e x}{x \left (a+b x+c x^2\right )} \, dx,x,f^{g+h x}\right )}{h \log (f)}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{d}{a x}+\frac{-b d+a e-c d x}{a \left (a+b x+c x^2\right )}\right ) \, dx,x,f^{g+h x}\right )}{h \log (f)}\\ &=\frac{d x}{a}+\frac{\operatorname{Subst}\left (\int \frac{-b d+a e-c d x}{a+b x+c x^2} \, dx,x,f^{g+h x}\right )}{a h \log (f)}\\ &=\frac{d x}{a}-\frac{d \operatorname{Subst}\left (\int \frac{b+2 c x}{a+b x+c x^2} \, dx,x,f^{g+h x}\right )}{2 a h \log (f)}-\frac{(b d-2 a e) \operatorname{Subst}\left (\int \frac{1}{a+b x+c x^2} \, dx,x,f^{g+h x}\right )}{2 a h \log (f)}\\ &=\frac{d x}{a}-\frac{d \log \left (a+b f^{g+h x}+c f^{2 g+2 h x}\right )}{2 a h \log (f)}+\frac{(b d-2 a e) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c f^{g+h x}\right )}{a h \log (f)}\\ &=\frac{d x}{a}+\frac{(b d-2 a e) \tanh ^{-1}\left (\frac{b+2 c f^{g+h x}}{\sqrt{b^2-4 a c}}\right )}{a \sqrt{b^2-4 a c} h \log (f)}-\frac{d \log \left (a+b f^{g+h x}+c f^{2 g+2 h x}\right )}{2 a h \log (f)}\\ \end{align*}

Mathematica [A]  time = 0.0330984, size = 102, normalized size = 0.99 \[ -\frac{\frac{2 (b d-2 a e) \tan ^{-1}\left (\frac{b+2 c f^{g+h x}}{\sqrt{4 a c-b^2}}\right )}{h \log (f) \sqrt{4 a c-b^2}}+\frac{d \log \left (a+f^{g+h x} \left (b+c f^{g+h x}\right )\right )}{h \log (f)}-2 d x}{2 a} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(-2*d*x + (2*(b*d - 2*a*e)*ArcTan[(b + 2*c*f^(g + h*x))/Sqrt[-b^2 + 4*a*c]])/(Sqrt[-b^2 + 4*a*c]*h*Log[f]) +
(d*Log[a + f^(g + h*x)*(b + c*f^(g + h*x))])/(h*Log[f]))/(2*a)

________________________________________________________________________________________

Maple [B]  time = 0.002, size = 993, normalized size = 9.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4/(4*ln(f)^2*a^2*c*h^2-ln(f)^2*a*b^2*h^2)*ln(f)^2*a*c*d*h^2*x-1/(4*ln(f)^2*a^2*c*h^2-ln(f)^2*a*b^2*h^2)*ln(f)^
2*b^2*d*h^2*x+4/(4*ln(f)^2*a^2*c*h^2-ln(f)^2*a*b^2*h^2)*ln(f)^2*a*c*d*g*h-1/(4*ln(f)^2*a^2*c*h^2-ln(f)^2*a*b^2
*h^2)*ln(f)^2*b^2*d*g*h-2/(4*a*c-b^2)/h/ln(f)*ln(f^(h*x+g)+1/2*(2*a*b*e-b^2*d+(-16*a^3*c*e^2+4*a^2*b^2*e^2+16*
a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2))/c/(2*a*e-b*d))*c*d+1/2/a/(4*a*c-b^2)/h/ln(f)*ln(f^(h*x+g
)+1/2*(2*a*b*e-b^2*d+(-16*a^3*c*e^2+4*a^2*b^2*e^2+16*a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2))/c/(
2*a*e-b*d))*b^2*d+1/2/a/(4*a*c-b^2)/h/ln(f)*ln(f^(h*x+g)+1/2*(2*a*b*e-b^2*d+(-16*a^3*c*e^2+4*a^2*b^2*e^2+16*a^
2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2))/c/(2*a*e-b*d))*(-16*a^3*c*e^2+4*a^2*b^2*e^2+16*a^2*b*c*d*e
-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2)-2/(4*a*c-b^2)/h/ln(f)*ln(f^(h*x+g)-1/2*(-2*a*b*e+b^2*d+(-16*a^3*c*e^
2+4*a^2*b^2*e^2+16*a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2))/c/(2*a*e-b*d))*c*d+1/2/a/(4*a*c-b^2)/
h/ln(f)*ln(f^(h*x+g)-1/2*(-2*a*b*e+b^2*d+(-16*a^3*c*e^2+4*a^2*b^2*e^2+16*a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2
+b^4*d^2)^(1/2))/c/(2*a*e-b*d))*b^2*d-1/2/a/(4*a*c-b^2)/h/ln(f)*ln(f^(h*x+g)-1/2*(-2*a*b*e+b^2*d+(-16*a^3*c*e^
2+4*a^2*b^2*e^2+16*a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2))/c/(2*a*e-b*d))*(-16*a^3*c*e^2+4*a^2*b
^2*e^2+16*a^2*b*c*d*e-4*a*b^3*d*e-4*a*b^2*c*d^2+b^4*d^2)^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.42942, size = 755, normalized size = 7.33 \begin{align*} \left [\frac{2 \,{\left (b^{2} - 4 \, a c\right )} d h x \log \left (f\right ) -{\left (b^{2} - 4 \, a c\right )} d \log \left (c f^{2 \, h x + 2 \, g} + b f^{h x + g} + a\right ) - \sqrt{b^{2} - 4 \, a c}{\left (b d - 2 \, a e\right )} \log \left (\frac{2 \, c^{2} f^{2 \, h x + 2 \, g} + b^{2} - 2 \, a c + 2 \,{\left (b c - \sqrt{b^{2} - 4 \, a c} c\right )} f^{h x + g} - \sqrt{b^{2} - 4 \, a c} b}{c f^{2 \, h x + 2 \, g} + b f^{h x + g} + a}\right )}{2 \,{\left (a b^{2} - 4 \, a^{2} c\right )} h \log \left (f\right )}, \frac{2 \,{\left (b^{2} - 4 \, a c\right )} d h x \log \left (f\right ) -{\left (b^{2} - 4 \, a c\right )} d \log \left (c f^{2 \, h x + 2 \, g} + b f^{h x + g} + a\right ) + 2 \, \sqrt{-b^{2} + 4 \, a c}{\left (b d - 2 \, a e\right )} \arctan \left (-\frac{2 \, \sqrt{-b^{2} + 4 \, a c} c f^{h x + g} + \sqrt{-b^{2} + 4 \, a c} b}{b^{2} - 4 \, a c}\right )}{2 \,{\left (a b^{2} - 4 \, a^{2} c\right )} h \log \left (f\right )}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[1/2*(2*(b^2 - 4*a*c)*d*h*x*log(f) - (b^2 - 4*a*c)*d*log(c*f^(2*h*x + 2*g) + b*f^(h*x + g) + a) - sqrt(b^2 - 4
*a*c)*(b*d - 2*a*e)*log((2*c^2*f^(2*h*x + 2*g) + b^2 - 2*a*c + 2*(b*c - sqrt(b^2 - 4*a*c)*c)*f^(h*x + g) - sqr
t(b^2 - 4*a*c)*b)/(c*f^(2*h*x + 2*g) + b*f^(h*x + g) + a)))/((a*b^2 - 4*a^2*c)*h*log(f)), 1/2*(2*(b^2 - 4*a*c)
*d*h*x*log(f) - (b^2 - 4*a*c)*d*log(c*f^(2*h*x + 2*g) + b*f^(h*x + g) + a) + 2*sqrt(-b^2 + 4*a*c)*(b*d - 2*a*e
)*arctan(-(2*sqrt(-b^2 + 4*a*c)*c*f^(h*x + g) + sqrt(-b^2 + 4*a*c)*b)/(b^2 - 4*a*c)))/((a*b^2 - 4*a^2*c)*h*log
(f))]

________________________________________________________________________________________

Sympy [A]  time = 0.893791, size = 139, normalized size = 1.35 \begin{align*} \operatorname{RootSum}{\left (z^{2} \left (4 a^{2} c h^{2} \log{\left (f \right )}^{2} - a b^{2} h^{2} \log{\left (f \right )}^{2}\right ) + z \left (4 a c d h \log{\left (f \right )} - b^{2} d h \log{\left (f \right )}\right ) + a e^{2} - b d e + c d^{2}, \left ( i \mapsto i \log{\left (f^{g + h x} + \frac{4 i a^{2} c h \log{\left (f \right )} - i a b^{2} h \log{\left (f \right )} + a b e + 2 a c d - b^{2} d}{2 a c e - b c d} \right )} \right )\right )} + \frac{d x}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

RootSum(_z**2*(4*a**2*c*h**2*log(f)**2 - a*b**2*h**2*log(f)**2) + _z*(4*a*c*d*h*log(f) - b**2*d*h*log(f)) + a*
e**2 - b*d*e + c*d**2, Lambda(_i, _i*log(f**(g + h*x) + (4*_i*a**2*c*h*log(f) - _i*a*b**2*h*log(f) + a*b*e + 2
*a*c*d - b**2*d)/(2*a*c*e - b*c*d)))) + d*x/a

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{e f^{h x + g} + d}{c f^{2 \, h x + 2 \, g} + b f^{h x + g} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((e*f^(h*x + g) + d)/(c*f^(2*h*x + 2*g) + b*f^(h*x + g) + a), x)