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]

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

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 52, normalized size of antiderivative = 1.00, 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 verified.

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

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]

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.06, 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 verified.

[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)

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 297, normalized size = 5.71 \[ \left [\frac {\sqrt {\frac {a - b}{a + b}} \log \left (\frac {b^{2} \cosh \relax (x)^{4} + 4 \, b^{2} \cosh \relax (x) \sinh \relax (x)^{3} + b^{2} \sinh \relax (x)^{4} + 2 \, a b \cosh \relax (x)^{2} + 2 \, {\left (3 \, b^{2} \cosh \relax (x)^{2} + a b\right )} \sinh \relax (x)^{2} + 2 \, a^{2} - b^{2} + 4 \, {\left (b^{2} \cosh \relax (x)^{3} + a b \cosh \relax (x)\right )} \sinh \relax (x) + 2 \, {\left ({\left (a b + b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a b + b^{2}\right )} \sinh \relax (x)^{2} + a^{2} + a b\right )} \sqrt {\frac {a - b}{a + b}}}{b \cosh \relax (x)^{4} + 4 \, b \cosh \relax (x) \sinh \relax (x)^{3} + b \sinh \relax (x)^{4} + 2 \, a \cosh \relax (x)^{2} + 2 \, {\left (3 \, b \cosh \relax (x)^{2} + a\right )} \sinh \relax (x)^{2} + 4 \, {\left (b \cosh \relax (x)^{3} + a \cosh \relax (x)\right )} \sinh \relax (x) + b}\right ) + 2 \, x}{4 \, b}, \frac {\sqrt {-\frac {a - b}{a + b}} \arctan \left (-\frac {{\left (b \cosh \relax (x)^{2} + 2 \, b \cosh \relax (x) \sinh \relax (x) + b \sinh \relax (x)^{2} + a\right )} \sqrt {-\frac {a - b}{a + b}}}{a - b}\right ) + x}{2 \, b}\right ] \]

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

________________________________________________________________________________________

giac [A]  time = 0.14, size = 49, normalized size = 0.94 \[ -\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} \]

Verification 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

________________________________________________________________________________________

maple [B]  time = 0.26, size = 92, normalized size = 1.77 \[ -\frac {\ln \left (\tanh \relax (x )-1\right )}{4 b}+\frac {\ln \left (1+\tanh \relax (x )\right )}{4 b}-\frac {\arctanh \left (\frac {\left (a -b \right ) \tanh \relax (x )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right ) a}{2 b \sqrt {\left (a +b \right ) \left (a -b \right )}}+\frac {\arctanh \left (\frac {\left (a -b \right ) \tanh \relax (x )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \sqrt {\left (a +b \right ) \left (a -b \right )}} \]

Verification 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(tanh(x)-1)+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))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification 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 >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 0.26, size = 120, normalized size = 2.31 \[ \frac {x}{2\,b}-\frac {\ln \left (\frac {{\mathrm {e}}^{2\,x}\,\left (a-b\right )}{b^2}+\frac {\sqrt {a-b}\,\left (b+a\,{\mathrm {e}}^{2\,x}\right )}{b^2\,\sqrt {a+b}}\right )\,\sqrt {a-b}}{4\,b\,\sqrt {a+b}}+\frac {\ln \left (\frac {{\mathrm {e}}^{2\,x}\,\left (a-b\right )}{b^2}-\frac {\sqrt {a-b}\,\left (b+a\,{\mathrm {e}}^{2\,x}\right )}{b^2\,\sqrt {a+b}}\right )\,\sqrt {a-b}}{4\,b\,\sqrt {a+b}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cosh ^{2}{\relax (x )}}{a + b \cosh {\left (2 x \right )}}\, dx \]

Verification 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)

________________________________________________________________________________________