\(\int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx\) [540]

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

Optimal result

Integrand size = 25, antiderivative size = 47 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=-\frac {2 \text {arctanh}\left (\frac {a+2 c f^{c+d x}}{\sqrt {a^2-4 b c}}\right )}{\sqrt {a^2-4 b c} d \log (f)} \]

[Out]

-2*arctanh((a+2*c*f^(d*x+c))/(a^2-4*b*c)^(1/2))/d/ln(f)/(a^2-4*b*c)^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {2320, 1400, 632, 212} \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=-\frac {2 \text {arctanh}\left (\frac {a+2 c f^{c+d x}}{\sqrt {a^2-4 b c}}\right )}{d \log (f) \sqrt {a^2-4 b c}} \]

[In]

Int[(a + b*f^(-c - d*x) + c*f^(c + d*x))^(-1),x]

[Out]

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

Rule 212

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

Rule 632

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 1400

Int[(x_)^(m_.)*((a_) + (c_.)*(x_)^(n_.) + (b_.)*(x_)^(mn_))^(p_.), x_Symbol] :> Int[x^(m - n*p)*(b + a*x^n + c
*x^(2*n))^p, x] /; FreeQ[{a, b, c, m, n}, x] && EqQ[mn, -n] && IntegerQ[p] && PosQ[n]

Rule 2320

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]]]

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

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.09 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\frac {2 \arctan \left (\frac {a+2 c f^{c+d x}}{\sqrt {-a^2+4 b c}}\right )}{\sqrt {-a^2+4 b c} d \log (f)} \]

[In]

Integrate[(a + b*f^(-c - d*x) + c*f^(c + d*x))^(-1),x]

[Out]

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

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(134\) vs. \(2(43)=86\).

Time = 0.04 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.87

method result size
risch \(\frac {\ln \left (f^{-d x -c}+\frac {a \sqrt {a^{2}-4 c b}+a^{2}-4 c b}{2 b \sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}\, d \ln \left (f \right )}-\frac {\ln \left (f^{-d x -c}+\frac {a \sqrt {a^{2}-4 c b}-a^{2}+4 c b}{2 b \sqrt {a^{2}-4 c b}}\right )}{\sqrt {a^{2}-4 c b}\, d \ln \left (f \right )}\) \(135\)

[In]

int(1/(a+b*f^(-d*x-c)+c*f^(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/(a^2-4*b*c)^(1/2)/d/ln(f)*ln(f^(-d*x-c)+1/2*(a*(a^2-4*b*c)^(1/2)+a^2-4*c*b)/b/(a^2-4*b*c)^(1/2))-1/(a^2-4*b*
c)^(1/2)/d/ln(f)*ln(f^(-d*x-c)+1/2*(a*(a^2-4*b*c)^(1/2)-a^2+4*c*b)/b/(a^2-4*b*c)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 189, normalized size of antiderivative = 4.02 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\left [\frac {\log \left (\frac {2 \, c^{2} f^{2 \, d x + 2 \, c} + a^{2} - 2 \, b c + 2 \, {\left (a c - \sqrt {a^{2} - 4 \, b c} c\right )} f^{d x + c} - \sqrt {a^{2} - 4 \, b c} a}{c f^{2 \, d x + 2 \, c} + a f^{d x + c} + b}\right )}{\sqrt {a^{2} - 4 \, b c} d \log \left (f\right )}, -\frac {2 \, \sqrt {-a^{2} + 4 \, b c} \arctan \left (-\frac {2 \, \sqrt {-a^{2} + 4 \, b c} c f^{d x + c} + \sqrt {-a^{2} + 4 \, b c} a}{a^{2} - 4 \, b c}\right )}{{\left (a^{2} - 4 \, b c\right )} d \log \left (f\right )}\right ] \]

[In]

integrate(1/(a+b*f^(-d*x-c)+c*f^(d*x+c)),x, algorithm="fricas")

[Out]

[log((2*c^2*f^(2*d*x + 2*c) + a^2 - 2*b*c + 2*(a*c - sqrt(a^2 - 4*b*c)*c)*f^(d*x + c) - sqrt(a^2 - 4*b*c)*a)/(
c*f^(2*d*x + 2*c) + a*f^(d*x + c) + b))/(sqrt(a^2 - 4*b*c)*d*log(f)), -2*sqrt(-a^2 + 4*b*c)*arctan(-(2*sqrt(-a
^2 + 4*b*c)*c*f^(d*x + c) + sqrt(-a^2 + 4*b*c)*a)/(a^2 - 4*b*c))/((a^2 - 4*b*c)*d*log(f))]

Sympy [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.40 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\operatorname {RootSum} {\left (z^{2} \left (a^{2} d^{2} \log {\left (f \right )}^{2} - 4 b c d^{2} \log {\left (f \right )}^{2}\right ) - 1, \left ( i \mapsto i \log {\left (f^{c + d x} + \frac {- i a^{2} d \log {\left (f \right )} + 4 i b c d \log {\left (f \right )} + a}{2 c} \right )} \right )\right )} \]

[In]

integrate(1/(a+b*f**(-d*x-c)+c*f**(d*x+c)),x)

[Out]

RootSum(_z**2*(a**2*d**2*log(f)**2 - 4*b*c*d**2*log(f)**2) - 1, Lambda(_i, _i*log(f**(c + d*x) + (-_i*a**2*d*l
og(f) + 4*_i*b*c*d*log(f) + a)/(2*c))))

Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(1/(a+b*f^(-d*x-c)+c*f^(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*b*c-a^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.02 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\frac {2 \, \arctan \left (\frac {2 \, c f^{d x} f^{c} + a}{\sqrt {-a^{2} + 4 \, b c}}\right )}{\sqrt {-a^{2} + 4 \, b c} d \log \left (f\right )} \]

[In]

integrate(1/(a+b*f^(-d*x-c)+c*f^(d*x+c)),x, algorithm="giac")

[Out]

2*arctan((2*c*f^(d*x)*f^c + a)/sqrt(-a^2 + 4*b*c))/(sqrt(-a^2 + 4*b*c)*d*log(f))

Mupad [B] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a+b f^{-c-d x}+c f^{c+d x}} \, dx=\frac {2\,\mathrm {atan}\left (\frac {a+2\,c\,f^{c+d\,x}}{\sqrt {4\,b\,c-a^2}}\right )}{d\,\ln \left (f\right )\,\sqrt {4\,b\,c-a^2}} \]

[In]

int(1/(a + c*f^(c + d*x) + b/f^(c + d*x)),x)

[Out]

(2*atan((a + 2*c*f^(c + d*x))/(4*b*c - a^2)^(1/2)))/(d*log(f)*(4*b*c - a^2)^(1/2))