### 3.1036 $$\int \frac{\cosh ^2(x)}{a+b \cosh (2 x)} \, dx$$

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

[Out]

x/(2*b) - (Sqrt[a - b]*ArcTanh[(Sqrt[a - b]*Tanh[x])/Sqrt[a + b]])/(2*b*Sqrt[a + b])

________________________________________________________________________________________

Rubi [A]  time = 0.106355, antiderivative size = 52, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.133, Rules used = {1093, 208} $\frac{x}{2 b}-\frac{\sqrt{a-b} \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh (x)}{\sqrt{a+b}}\right )}{2 b \sqrt{a+b}}$

Antiderivative was successfully veriﬁed.

[In]

Int[Cosh[x]^2/(a + b*Cosh[2*x]),x]

[Out]

x/(2*b) - (Sqrt[a - b]*ArcTanh[(Sqrt[a - b]*Tanh[x])/Sqrt[a + b]])/(2*b*Sqrt[a + b])

Rule 1093

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

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{\cosh ^2(x)}{a+b \cosh (2 x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{a+b-2 a x^2+(a-b) x^4} \, dx,x,\tanh (x)\right )\\ &=\frac{(a-b) \operatorname{Subst}\left (\int \frac{1}{-a-b+(a-b) x^2} \, dx,x,\tanh (x)\right )}{2 b}-\frac{(a-b) \operatorname{Subst}\left (\int \frac{1}{-a+b+(a-b) x^2} \, dx,x,\tanh (x)\right )}{2 b}\\ &=\frac{x}{2 b}-\frac{\sqrt{a-b} \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh (x)}{\sqrt{a+b}}\right )}{2 b \sqrt{a+b}}\\ \end{align*}

Mathematica [A]  time = 0.0607476, size = 50, normalized size = 0.96 $\frac{\frac{(a-b) \tan ^{-1}\left (\frac{(a-b) \tanh (x)}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}+x}{2 b}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Cosh[x]^2/(a + b*Cosh[2*x]),x]

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.033, size = 92, normalized size = 1.8 \begin{align*}{\frac{\ln \left ( 1+\tanh \left ( x \right ) \right ) }{4\,b}}-{\frac{a}{2\,b}{\it Artanh} \left ({ \left ( a-b \right ) \tanh \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}}+{\frac{1}{2}{\it Artanh} \left ({ \left ( a-b \right ) \tanh \left ( x \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}}-{\frac{\ln \left ( \tanh \left ( x \right ) -1 \right ) }{4\,b}} \end{align*}

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

[In]

int(cosh(x)^2/(a+b*cosh(2*x)),x)

[Out]

1/4/b*ln(1+tanh(x))-1/2/b/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tanh(x)/((a+b)*(a-b))^(1/2))*a+1/2/((a+b)*(a-b))^(
1/2)*arctanh((a-b)*tanh(x)/((a+b)*(a-b))^(1/2))-1/4/b*ln(tanh(x)-1)

________________________________________________________________________________________

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(cosh(x)^2/(a+b*cosh(2*x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.96277, size = 821, normalized size = 15.79 \begin{align*} \left [\frac{\sqrt{\frac{a - b}{a + b}} \log \left (\frac{b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \, a b \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b^{2} \cosh \left (x\right )^{2} + a b\right )} \sinh \left (x\right )^{2} + 2 \, a^{2} - b^{2} + 4 \,{\left (b^{2} \cosh \left (x\right )^{3} + a b \cosh \left (x\right )\right )} \sinh \left (x\right ) + 2 \,{\left ({\left (a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a b + b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} + a b\right )} \sqrt{\frac{a - b}{a + b}}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, a \cosh \left (x\right )^{2} + 2 \,{\left (3 \, b \cosh \left (x\right )^{2} + a\right )} \sinh \left (x\right )^{2} + 4 \,{\left (b \cosh \left (x\right )^{3} + a \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) + 2 \, x}{4 \, b}, \frac{\sqrt{-\frac{a - b}{a + b}} \arctan \left (-\frac{{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + a\right )} \sqrt{-\frac{a - b}{a + b}}}{a - b}\right ) + x}{2 \, b}\right ] \end{align*}

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

[In]

integrate(cosh(x)^2/(a+b*cosh(2*x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

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

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

[In]

integrate(cosh(x)**2/(a+b*cosh(2*x)),x)

[Out]

Integral(cosh(x)**2/(a + b*cosh(2*x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.14756, size = 66, normalized size = 1.27 \begin{align*} -\frac{{\left (a - b\right )} \arctan \left (\frac{b e^{\left (2 \, x\right )} + a}{\sqrt{-a^{2} + b^{2}}}\right )}{2 \, \sqrt{-a^{2} + b^{2}} b} + \frac{x}{2 \, b} \end{align*}

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

[In]

integrate(cosh(x)^2/(a+b*cosh(2*x)),x, algorithm="giac")

[Out]

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