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

Optimal. Leaf size=32 \[ x-\frac {\tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{\sqrt {2}}-\frac {\tanh (x)}{2-\tanh ^2(x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {481, 12, 400, 212} \begin {gather*} x-\frac {\tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right )}{\sqrt {2}}-\frac {\tanh (x)}{2-\tanh ^2(x)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - ArcTanh[Tanh[x]/Sqrt[2]]/Sqrt[2] - Tanh[x]/(2 - Tanh[x]^2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 212

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

Rule 400

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

Rule 481

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-a)*e^(
2*n - 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(b*n*(b*c - a*d)*(p + 1))), x] + Dist[e^
(2*n)/(b*n*(b*c - a*d)*(p + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1)
+ (a*d*(m - n + n*q + 1) + b*c*n*(p + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0]
 && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 64, normalized size = 2.00 \begin {gather*} \frac {(3+\cosh (2 x)) \text {csch}^4(x) \left (6 x+2 x \cosh (2 x)-\sqrt {2} \tanh ^{-1}\left (\frac {\tanh (x)}{\sqrt {2}}\right ) (3+\cosh (2 x))-2 \sinh (2 x)\right )}{8 \left (\coth ^2(x)+\text {csch}^2(x)\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((3 + Cosh[2*x])*Csch[x]^4*(6*x + 2*x*Cosh[2*x] - Sqrt[2]*ArcTanh[Tanh[x]/Sqrt[2]]*(3 + Cosh[2*x]) - 2*Sinh[2*
x]))/(8*(Coth[x]^2 + Csch[x]^2)^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(182\) vs. \(2(29)=58\).
time = 1.19, size = 183, normalized size = 5.72

method result size
risch \(x +\frac {6 \,{\mathrm e}^{2 x}+2}{{\mathrm e}^{4 x}+6 \,{\mathrm e}^{2 x}+1}+\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}+3+2 \sqrt {2}\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 x}+3-2 \sqrt {2}\right )}{4}\) \(61\)
default \(\frac {-\left (\tanh ^{3}\left (\frac {x}{2}\right )\right )-\tanh \left (\frac {x}{2}\right )}{\tanh ^{4}\left (\frac {x}{2}\right )+1}-\frac {\sqrt {2}\, \left (\ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )+\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}{\tanh ^{2}\left (\frac {x}{2}\right )-\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 )}{8}+\frac {\sqrt {2}\, \left (\ln \left (\frac {\tanh ^{2}\left (\frac {x}{2}\right )-\tanh \left (\frac {x}{2}\right ) \sqrt {2}+1}{\tanh ^{2}\left (\frac {x}{2}\right )+\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 )}{8}+\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )\) \(183\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(-1/2*tanh(1/2*x)^3-1/2*tanh(1/2*x))/(tanh(1/2*x)^4+1)-1/8*2^(1/2)*(ln((tanh(1/2*x)^2+tanh(1/2*x)*2^(1/2)+1)
/(tanh(1/2*x)^2-tanh(1/2*x)*2^(1/2)+1))+2*arctan(tanh(1/2*x)*2^(1/2)+1)+2*arctan(tanh(1/2*x)*2^(1/2)-1))+1/8*2
^(1/2)*(ln((tanh(1/2*x)^2-tanh(1/2*x)*2^(1/2)+1)/(tanh(1/2*x)^2+tanh(1/2*x)*2^(1/2)+1))+2*arctan(tanh(1/2*x)*2
^(1/2)+1)+2*arctan(tanh(1/2*x)*2^(1/2)-1))+ln(tanh(1/2*x)+1)-ln(tanh(1/2*x)-1)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (26) = 52\).
time = 0.49, size = 60, normalized size = 1.88 \begin {gather*} \frac {1}{4} \, \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 - \frac {2 \, {\left (3 \, e^{\left (-2 \, x\right )} + 1\right )}}{6 \, e^{\left (-2 \, x\right )} + e^{\left (-4 \, x\right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 262 vs. \(2 (26) = 52\).
time = 0.40, size = 262, normalized size = 8.19 \begin {gather*} \frac {4 \, x \cosh \left (x\right )^{4} + 16 \, x \cosh \left (x\right ) \sinh \left (x\right )^{3} + 4 \, x \sinh \left (x\right )^{4} + 24 \, {\left (x + 1\right )} \cosh \left (x\right )^{2} + 24 \, {\left (x \cosh \left (x\right )^{2} + x + 1\right )} \sinh \left (x\right )^{2} + {\left (\sqrt {2} \cosh \left (x\right )^{4} + 4 \, \sqrt {2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sqrt {2} \sinh \left (x\right )^{4} + 6 \, {\left (\sqrt {2} \cosh \left (x\right )^{2} + \sqrt {2}\right )} \sinh \left (x\right )^{2} + 6 \, \sqrt {2} \cosh \left (x\right )^{2} + 4 \, {\left (\sqrt {2} \cosh \left (x\right )^{3} + 3 \, \sqrt {2} \cosh \left (x\right )\right )} \sinh \left (x\right ) + \sqrt {2}\right )} \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 ) + 16 \, {\left (x \cosh \left (x\right )^{3} + 3 \, {\left (x + 1\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \, x + 8}{4 \, {\left (\cosh \left (x\right )^{4} + 4 \, \cosh \left (x\right ) \sinh \left (x\right )^{3} + \sinh \left (x\right )^{4} + 6 \, {\left (\cosh \left (x\right )^{2} + 1\right )} \sinh \left (x\right )^{2} + 6 \, \cosh \left (x\right )^{2} + 4 \, {\left (\cosh \left (x\right )^{3} + 3 \, \cosh \left (x\right )\right )} \sinh \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(4*x*cosh(x)^4 + 16*x*cosh(x)*sinh(x)^3 + 4*x*sinh(x)^4 + 24*(x + 1)*cosh(x)^2 + 24*(x*cosh(x)^2 + x + 1)*
sinh(x)^2 + (sqrt(2)*cosh(x)^4 + 4*sqrt(2)*cosh(x)*sinh(x)^3 + sqrt(2)*sinh(x)^4 + 6*(sqrt(2)*cosh(x)^2 + sqrt
(2))*sinh(x)^2 + 6*sqrt(2)*cosh(x)^2 + 4*(sqrt(2)*cosh(x)^3 + 3*sqrt(2)*cosh(x))*sinh(x) + 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)/(cos
h(x)^2 + sinh(x)^2 + 3)) + 16*(x*cosh(x)^3 + 3*(x + 1)*cosh(x))*sinh(x) + 4*x + 8)/(cosh(x)^4 + 4*cosh(x)*sinh
(x)^3 + sinh(x)^4 + 6*(cosh(x)^2 + 1)*sinh(x)^2 + 6*cosh(x)^2 + 4*(cosh(x)^3 + 3*cosh(x))*sinh(x) + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\left (\coth ^{2}{\left (x \right )} + \operatorname {csch}^{2}{\left (x \right )}\right )^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral((coth(x)**2 + csch(x)**2)**(-2), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (26) = 52\).
time = 0.41, size = 60, normalized size = 1.88 \begin {gather*} -\frac {1}{4} \, \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 + \frac {2 \, {\left (3 \, e^{\left (2 \, x\right )} + 1\right )}}{e^{\left (4 \, x\right )} + 6 \, e^{\left (2 \, x\right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 77, normalized size = 2.41 \begin {gather*} x+\frac {\sqrt {2}\,\ln \left (4\,{\mathrm {e}}^{2\,x}-\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{4}\right )}{4}-\frac {\sqrt {2}\,\ln \left (4\,{\mathrm {e}}^{2\,x}+\frac {\sqrt {2}\,\left (12\,{\mathrm {e}}^{2\,x}+4\right )}{4}\right )}{4}+\frac {6\,{\mathrm {e}}^{2\,x}+2}{6\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________