\(\int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx\) [820]

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

Optimal result

Integrand size = 11, antiderivative size = 18 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=x-\sqrt {2} \text {arctanh}\left (\frac {\tanh (x)}{\sqrt {2}}\right ) \]

[Out]

x-arctanh(1/2*2^(1/2)*tanh(x))*2^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {1144, 213} \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=x-\sqrt {2} \text {arctanh}\left (\frac {\tanh (x)}{\sqrt {2}}\right ) \]

[In]

Int[(Coth[x]^2 + Csch[x]^2)^(-1),x]

[Out]

x - Sqrt[2]*ArcTanh[Tanh[x]/Sqrt[2]]

Rule 213

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

Rule 1144

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

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {x^2}{2-3 x^2+x^4} \, dx,x,\tanh (x)\right ) \\ & = 2 \text {Subst}\left (\int \frac {1}{-2+x^2} \, dx,x,\tanh (x)\right )-\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\tanh (x)\right ) \\ & = x-\sqrt {2} \text {arctanh}\left (\frac {\tanh (x)}{\sqrt {2}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=x-\sqrt {2} \text {arctanh}\left (\frac {\tanh (x)}{\sqrt {2}}\right ) \]

[In]

Integrate[(Coth[x]^2 + Csch[x]^2)^(-1),x]

[Out]

x - Sqrt[2]*ArcTanh[Tanh[x]/Sqrt[2]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(36\) vs. \(2(15)=30\).

Time = 0.83 (sec) , antiderivative size = 37, normalized size of antiderivative = 2.06

method result size
risch \(x +\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}+3+2 \sqrt {2}\right )}{2}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}-2 \sqrt {2}+3\right )}{2}\) \(37\)
default \(-\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )+\ln \left (1+\tanh \left (\frac {x}{2}\right )\right )-\frac {\sqrt {2}\, \left (\ln \left (\frac {\tanh \left (\frac {x}{2}\right )^{2}+\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}{\tanh \left (\frac {x}{2}\right )^{2}-\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}\right )+2 \arctan \left (\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1\right )+2 \arctan \left (\tanh \left (\frac {x}{2}\right ) \sqrt {2}-1\right )\right )}{4}+\frac {\sqrt {2}\, \left (\ln \left (\frac {\tanh \left (\frac {x}{2}\right )^{2}-\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}{\tanh \left (\frac {x}{2}\right )^{2}+\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}\right )+2 \arctan \left (\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1\right )+2 \arctan \left (\tanh \left (\frac {x}{2}\right ) \sqrt {2}-1\right )\right )}{4}\) \(156\)

[In]

int(1/(coth(x)^2+csch(x)^2),x,method=_RETURNVERBOSE)

[Out]

x+1/2*2^(1/2)*ln(exp(2*x)+3+2*2^(1/2))-1/2*2^(1/2)*ln(exp(2*x)-2*2^(1/2)+3)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 67 vs. \(2 (15) = 30\).

Time = 0.26 (sec) , antiderivative size = 67, normalized size of antiderivative = 3.72 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (\frac {3 \, {\left (2 \, \sqrt {2} + 3\right )} \cosh \left (x\right )^{2} - 4 \, {\left (3 \, \sqrt {2} + 4\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 3 \, {\left (2 \, \sqrt {2} + 3\right )} \sinh \left (x\right )^{2} + 2 \, \sqrt {2} + 3}{\cosh \left (x\right )^{2} + \sinh \left (x\right )^{2} + 3}\right ) + x \]

[In]

integrate(1/(coth(x)^2+csch(x)^2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*log((3*(2*sqrt(2) + 3)*cosh(x)^2 - 4*(3*sqrt(2) + 4)*cosh(x)*sinh(x) + 3*(2*sqrt(2) + 3)*sinh(x)^2
 + 2*sqrt(2) + 3)/(cosh(x)^2 + sinh(x)^2 + 3)) + x

Sympy [F]

\[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=\int \frac {1}{\coth ^{2}{\left (x \right )} + \operatorname {csch}^{2}{\left (x \right )}}\, dx \]

[In]

integrate(1/(coth(x)**2+csch(x)**2),x)

[Out]

Integral(1/(coth(x)**2 + csch(x)**2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (15) = 30\).

Time = 0.28 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.00 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=\frac {1}{2} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (-2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (-2 \, x\right )} + 3}\right ) + x \]

[In]

integrate(1/(coth(x)^2+csch(x)^2),x, algorithm="maxima")

[Out]

1/2*sqrt(2)*log(-(2*sqrt(2) - e^(-2*x) - 3)/(2*sqrt(2) + e^(-2*x) + 3)) + x

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (15) = 30\).

Time = 0.27 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.00 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=-\frac {1}{2} \, \sqrt {2} \log \left (-\frac {2 \, \sqrt {2} - e^{\left (2 \, x\right )} - 3}{2 \, \sqrt {2} + e^{\left (2 \, x\right )} + 3}\right ) + x \]

[In]

integrate(1/(coth(x)^2+csch(x)^2),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*log(-(2*sqrt(2) - e^(2*x) - 3)/(2*sqrt(2) + e^(2*x) + 3)) + x

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 54, normalized size of antiderivative = 3.00 \[ \int \frac {1}{\coth ^2(x)+\text {csch}^2(x)} \, dx=x+\frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{2}\right )}{2}-\frac {\sqrt {2}\,\ln \left (8\,{\mathrm {e}}^{2\,x}+\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{2}\right )}{2} \]

[In]

int(1/(coth(x)^2 + 1/sinh(x)^2),x)

[Out]

x + (2^(1/2)*log(8*exp(2*x) - (2^(1/2)*(12*exp(2*x) + 4))/2))/2 - (2^(1/2)*log(8*exp(2*x) + (2^(1/2)*(12*exp(2
*x) + 4))/2))/2