\(\int \frac {1}{a+b \text {sech}(c+d x)} \, dx\) [91]

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

Optimal result

Integrand size = 12, antiderivative size = 59 \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\frac {x}{a}-\frac {2 b \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b} d} \]

[Out]

x/a-2*b*arctan((a-b)^(1/2)*tanh(1/2*d*x+1/2*c)/(a+b)^(1/2))/a/d/(a-b)^(1/2)/(a+b)^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3868, 2738, 214} \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\frac {x}{a}-\frac {2 b \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}} \]

[In]

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

[Out]

x/a - (2*b*ArcTan[(Sqrt[a - b]*Tanh[(c + d*x)/2])/Sqrt[a + b]])/(a*Sqrt[a - b]*Sqrt[a + b]*d)

Rule 214

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

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3868

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

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

Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.02 \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\frac {\frac {c}{d}+x+\frac {2 b \arctan \left (\frac {(-a+b) \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2} d}}{a} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.41

method result size
derivativedivides \(\frac {\frac {\ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a}-\frac {2 b \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) \(83\)
default \(\frac {\frac {\ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a}-\frac {2 b \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) \(83\)
risch \(\frac {x}{a}-\frac {b \ln \left ({\mathrm e}^{d x +c}+\frac {b \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, d a}+\frac {b \ln \left ({\mathrm e}^{d x +c}+\frac {b \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, d a}\) \(136\)

[In]

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

[Out]

1/d*(1/a*ln(1+tanh(1/2*d*x+1/2*c))-1/a*ln(tanh(1/2*d*x+1/2*c)-1)-2*b/a/((a+b)*(a-b))^(1/2)*arctan((a-b)*tanh(1
/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 270, normalized size of antiderivative = 4.58 \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\left [\frac {{\left (a^{2} - b^{2}\right )} d x - \sqrt {-a^{2} + b^{2}} b \log \left (\frac {a^{2} \cosh \left (d x + c\right )^{2} + a^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) - a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cosh \left (d x + c\right ) + a \sinh \left (d x + c\right ) + b\right )}}{a \cosh \left (d x + c\right )^{2} + a \sinh \left (d x + c\right )^{2} + 2 \, b \cosh \left (d x + c\right ) + 2 \, {\left (a \cosh \left (d x + c\right ) + b\right )} \sinh \left (d x + c\right ) + a}\right )}{{\left (a^{3} - a b^{2}\right )} d}, \frac {{\left (a^{2} - b^{2}\right )} d x + 2 \, \sqrt {a^{2} - b^{2}} b \arctan \left (-\frac {a \cosh \left (d x + c\right ) + a \sinh \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )}{{\left (a^{3} - a b^{2}\right )} d}\right ] \]

[In]

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

[Out]

[((a^2 - b^2)*d*x - sqrt(-a^2 + b^2)*b*log((a^2*cosh(d*x + c)^2 + a^2*sinh(d*x + c)^2 + 2*a*b*cosh(d*x + c) -
a^2 + 2*b^2 + 2*(a^2*cosh(d*x + c) + a*b)*sinh(d*x + c) + 2*sqrt(-a^2 + b^2)*(a*cosh(d*x + c) + a*sinh(d*x + c
) + b))/(a*cosh(d*x + c)^2 + a*sinh(d*x + c)^2 + 2*b*cosh(d*x + c) + 2*(a*cosh(d*x + c) + b)*sinh(d*x + c) + a
)))/((a^3 - a*b^2)*d), ((a^2 - b^2)*d*x + 2*sqrt(a^2 - b^2)*b*arctan(-(a*cosh(d*x + c) + a*sinh(d*x + c) + b)/
sqrt(a^2 - b^2)))/((a^3 - a*b^2)*d)]

Sympy [F]

\[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\int \frac {1}{a + b \operatorname {sech}{\left (c + d x \right )}}\, dx \]

[In]

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

[Out]

Integral(1/(a + b*sech(c + d*x)), x)

Maxima [F(-2)]

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

[In]

integrate(1/(a+b*sech(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^2-4*a^2>0)', see `assume?`
 for more de

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.95 \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=-\frac {\frac {2 \, b \arctan \left (\frac {a e^{\left (d x + c\right )} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a} - \frac {d x + c}{a}}{d} \]

[In]

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

[Out]

-(2*b*arctan((a*e^(d*x + c) + b)/sqrt(a^2 - b^2))/(sqrt(a^2 - b^2)*a) - (d*x + c)/a)/d

Mupad [B] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.22 \[ \int \frac {1}{a+b \text {sech}(c+d x)} \, dx=\frac {x}{a}+\frac {b\,\ln \left (\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{a^2}-\frac {2\,b\,\left (a+b\,{\mathrm {e}}^{c+d\,x}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a\,d\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {b\,\ln \left (\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{a^2}+\frac {2\,b\,\left (a+b\,{\mathrm {e}}^{c+d\,x}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a\,d\,\sqrt {a+b}\,\sqrt {b-a}} \]

[In]

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

[Out]

x/a + (b*log((2*b*exp(c + d*x))/a^2 - (2*b*(a + b*exp(c + d*x)))/(a^2*(a + b)^(1/2)*(b - a)^(1/2))))/(a*d*(a +
 b)^(1/2)*(b - a)^(1/2)) - (b*log((2*b*exp(c + d*x))/a^2 + (2*b*(a + b*exp(c + d*x)))/(a^2*(a + b)^(1/2)*(b -
a)^(1/2))))/(a*d*(a + b)^(1/2)*(b - a)^(1/2))