### 3.572 $$\int \frac{a+b \text{sech}(x)}{c+d \cosh (x)} \, dx$$

Optimal. Leaf size=62 $\frac{2 (a c-b d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c \sqrt{c-d} \sqrt{c+d}}+\frac{b \tan ^{-1}(\sinh (x))}{c}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.156827, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.333, Rules used = {2828, 3001, 3770, 2659, 208} $\frac{2 (a c-b d) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tanh \left (\frac{x}{2}\right )}{\sqrt{c+d}}\right )}{c \sqrt{c-d} \sqrt{c+d}}+\frac{b \tan ^{-1}(\sinh (x))}{c}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a + b*Sech[x])/(c + d*Cosh[x]),x]

[Out]

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

Rule 2828

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> In
t[((a + b*Sin[e + f*x])^m*(d + c*Sin[e + f*x])^n)/Sin[e + f*x]^n, x] /; FreeQ[{a, b, c, d, e, f, m}, x] && Int
egerQ[n]

Rule 3001

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)])), x_Symbol] :> Dist[(A*b - a*B)/(b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] + Dist[(B*c - A
*d)/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
&& NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 2659

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 208

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

Rubi steps

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

Mathematica [A]  time = 0.124403, size = 63, normalized size = 1.02 $\frac{2 \left (\frac{(b d-a c) \tan ^{-1}\left (\frac{(c-d) \tanh \left (\frac{x}{2}\right )}{\sqrt{d^2-c^2}}\right )}{\sqrt{d^2-c^2}}+b \tan ^{-1}\left (\tanh \left (\frac{x}{2}\right )\right )\right )}{c}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(a + b*Sech[x])/(c + d*Cosh[x]),x]

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 89, normalized size = 1.4 \begin{align*} 2\,{\frac{b\arctan \left ( \tanh \left ( x/2 \right ) \right ) }{c}}+2\,{\frac{a}{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{ \left ( c-d \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }-2\,{\frac{bd}{c\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{ \left ( c-d \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 5.78853, size = 643, normalized size = 10.37 \begin{align*} \left [-\frac{{\left (a c - b d\right )} \sqrt{c^{2} - d^{2}} \log \left (\frac{d^{2} \cosh \left (x\right )^{2} + d^{2} \sinh \left (x\right )^{2} + 2 \, c d \cosh \left (x\right ) + 2 \, c^{2} - d^{2} + 2 \,{\left (d^{2} \cosh \left (x\right ) + c d\right )} \sinh \left (x\right ) + 2 \, \sqrt{c^{2} - d^{2}}{\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{d \cosh \left (x\right )^{2} + d \sinh \left (x\right )^{2} + 2 \, c \cosh \left (x\right ) + 2 \,{\left (d \cosh \left (x\right ) + c\right )} \sinh \left (x\right ) + d}\right ) - 2 \,{\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{c^{3} - c d^{2}}, -\frac{2 \,{\left ({\left (a c - b d\right )} \sqrt{-c^{2} + d^{2}} \arctan \left (-\frac{\sqrt{-c^{2} + d^{2}}{\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{c^{2} - d^{2}}\right ) -{\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{c^{3} - c d^{2}}\right ] \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{a + b \operatorname{sech}{\left (x \right )}}{c + d \cosh{\left (x \right )}}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.15093, size = 72, normalized size = 1.16 \begin{align*} \frac{2 \, b \arctan \left (e^{x}\right )}{c} + \frac{2 \,{\left (a c - b d\right )} \arctan \left (\frac{d e^{x} + c}{\sqrt{-c^{2} + d^{2}}}\right )}{\sqrt{-c^{2} + d^{2}} c} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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