Optimal. Leaf size=80 \[ \frac {2 b \tanh ^{-1}(\cosh (x))}{a^3}-\frac {2 \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^3 \sqrt {a^2+b^2}}-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {2802, 3135,
3080, 3855, 2739, 632, 212} \begin {gather*} \frac {2 b \tanh ^{-1}(\cosh (x))}{a^3}-\frac {2 \coth (x)}{a^2}-\frac {2 \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^3 \sqrt {a^2+b^2}}+\frac {\coth (x)}{a (a+b \sinh (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 2739
Rule 2802
Rule 3080
Rule 3135
Rule 3855
Rubi steps
\begin {align*} \int \frac {\coth ^2(x)}{(a+b \sinh (x))^2} \, dx &=\int \frac {\text {csch}^2(x) \left (1+\sinh ^2(x)\right )}{(a+b \sinh (x))^2} \, dx\\ &=\frac {\coth (x)}{a (a+b \sinh (x))}+\frac {\int \frac {\text {csch}^2(x) \left (2 \left (a^2+b^2\right )+\left (a^2+b^2\right ) \sinh ^2(x)\right )}{a+b \sinh (x)} \, dx}{a \left (a^2+b^2\right )}\\ &=-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))}+\frac {i \int \frac {\text {csch}(x) \left (2 i b \left (a^2+b^2\right )-i a \left (a^2+b^2\right ) \sinh (x)\right )}{a+b \sinh (x)} \, dx}{a^2 \left (a^2+b^2\right )}\\ &=-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))}-\frac {(2 b) \int \text {csch}(x) \, dx}{a^3}+\frac {\left (a^2+2 b^2\right ) \int \frac {1}{a+b \sinh (x)} \, dx}{a^3}\\ &=\frac {2 b \tanh ^{-1}(\cosh (x))}{a^3}-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))}+\frac {\left (2 \left (a^2+2 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x-a x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^3}\\ &=\frac {2 b \tanh ^{-1}(\cosh (x))}{a^3}-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))}-\frac {\left (4 \left (a^2+2 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2\right )-x^2} \, dx,x,2 b-2 a \tanh \left (\frac {x}{2}\right )\right )}{a^3}\\ &=\frac {2 b \tanh ^{-1}(\cosh (x))}{a^3}-\frac {2 \left (a^2+2 b^2\right ) \tanh ^{-1}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{a^3 \sqrt {a^2+b^2}}-\frac {2 \coth (x)}{a^2}+\frac {\coth (x)}{a (a+b \sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 102, normalized size = 1.28 \begin {gather*} -\frac {-\frac {4 \left (a^2+2 b^2\right ) \text {ArcTan}\left (\frac {b-a \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+a \coth \left (\frac {x}{2}\right )+4 b \log \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {2 a b \cosh (x)}{a+b \sinh (x)}+a \tanh \left (\frac {x}{2}\right )}{2 a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.65, size = 118, normalized size = 1.48
method | result | size |
default | \(-\frac {\tanh \left (\frac {x}{2}\right )}{2 a^{2}}-\frac {2 \left (\frac {-b^{2} \tanh \left (\frac {x}{2}\right )-a b}{a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 b \tanh \left (\frac {x}{2}\right )-a}-\frac {\left (a^{2}+2 b^{2}\right ) \arctanh \left (\frac {2 a \tanh \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\sqrt {a^{2}+b^{2}}}\right )}{a^{3}}-\frac {1}{2 a^{2} \tanh \left (\frac {x}{2}\right )}-\frac {2 b \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a^{3}}\) | \(118\) |
risch | \(\frac {2 a \,{\mathrm e}^{3 x}-4 b \,{\mathrm e}^{2 x}-6 a \,{\mathrm e}^{x}+4 b}{a^{2} \left ({\mathrm e}^{2 x}-1\right ) \left (b \,{\mathrm e}^{2 x}+2 a \,{\mathrm e}^{x}-b \right )}+\frac {2 b \ln \left ({\mathrm e}^{x}+1\right )}{a^{3}}-\frac {2 b \ln \left ({\mathrm e}^{x}-1\right )}{a^{3}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right )}{\sqrt {a^{2}+b^{2}}\, a}+\frac {2 \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}-a^{2}-b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) b^{2}}{\sqrt {a^{2}+b^{2}}\, a^{3}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right )}{\sqrt {a^{2}+b^{2}}\, a}-\frac {2 \ln \left ({\mathrm e}^{x}+\frac {a \sqrt {a^{2}+b^{2}}+a^{2}+b^{2}}{\sqrt {a^{2}+b^{2}}\, b}\right ) b^{2}}{\sqrt {a^{2}+b^{2}}\, a^{3}}\) | \(285\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 165 vs.
\(2 (76) = 152\).
time = 0.49, size = 165, normalized size = 2.06 \begin {gather*} -\frac {2 \, {\left (3 \, a e^{\left (-x\right )} - 2 \, b e^{\left (-2 \, x\right )} - a e^{\left (-3 \, x\right )} + 2 \, b\right )}}{2 \, a^{3} e^{\left (-x\right )} - 2 \, a^{2} b e^{\left (-2 \, x\right )} - 2 \, a^{3} e^{\left (-3 \, x\right )} + a^{2} b e^{\left (-4 \, x\right )} + a^{2} b} + \frac {2 \, b \log \left (e^{\left (-x\right )} + 1\right )}{a^{3}} - \frac {2 \, b \log \left (e^{\left (-x\right )} - 1\right )}{a^{3}} + \frac {{\left (a^{2} + 2 \, b^{2}\right )} \log \left (\frac {b e^{\left (-x\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-x\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1257 vs.
\(2 (76) = 152\).
time = 0.48, size = 1257, normalized size = 15.71 \begin {gather*} \frac {4 \, a^{3} b + 4 \, a b^{3} + 2 \, {\left (a^{4} + a^{2} b^{2}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{4} + a^{2} b^{2}\right )} \sinh \left (x\right )^{3} - 4 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (2 \, a^{3} b + 2 \, a b^{3} - 3 \, {\left (a^{4} + a^{2} b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} + {\left ({\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )^{4} + {\left (a^{2} b + 2 \, b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{3} + 2 \, a b^{2} + 2 \, {\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} + a^{2} b + 2 \, b^{3} - 2 \, {\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} b + 2 \, b^{3} - 3 \, {\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )^{2} - 3 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cosh \left (x\right ) + 2 \, {\left (2 \, {\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )^{3} - a^{3} - 2 \, a b^{2} + 3 \, {\left (a^{3} + 2 \, a b^{2}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} b + 2 \, b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) - b}\right ) - 6 \, {\left (a^{4} + a^{2} b^{2}\right )} \cosh \left (x\right ) + 2 \, {\left ({\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{4} + {\left (a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{4} + a^{2} b^{2} + b^{4} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{3} b + a b^{3} + 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} b^{2} + b^{4} - 3 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{3} b + a b^{3} - 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - 2 \, {\left ({\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{4} + {\left (a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{4} + a^{2} b^{2} + b^{4} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{3} b + a b^{3} + 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{2} b^{2} + b^{4} - 3 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{3} b + a b^{3} - 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right ) - 2 \, {\left (3 \, a^{4} + 3 \, a^{2} b^{2} - 3 \, {\left (a^{4} + a^{2} b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (a^{3} b + a b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{a^{5} b + a^{3} b^{3} + {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )^{4} + {\left (a^{5} b + a^{3} b^{3}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{6} + a^{4} b^{2}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{6} + a^{4} b^{2} + 2 \, {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 2 \, {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{5} b + a^{3} b^{3} - 3 \, {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )^{2} - 3 \, {\left (a^{6} + a^{4} b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 2 \, {\left (a^{6} + a^{4} b^{2}\right )} \cosh \left (x\right ) - 2 \, {\left (a^{6} + a^{4} b^{2} - 2 \, {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{6} + a^{4} b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{5} b + a^{3} b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\coth ^{2}{\left (x \right )}}{\left (a + b \sinh {\left (x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 148, normalized size = 1.85 \begin {gather*} \frac {2 \, b \log \left (e^{x} + 1\right )}{a^{3}} - \frac {2 \, b \log \left ({\left | e^{x} - 1 \right |}\right )}{a^{3}} + \frac {{\left (a^{2} + 2 \, b^{2}\right )} \log \left (\frac {{\left | 2 \, b e^{x} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{x} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} a^{3}} + \frac {2 \, {\left (a e^{\left (3 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} - 3 \, a e^{x} + 2 \, b\right )}}{{\left (b e^{\left (4 \, x\right )} + 2 \, a e^{\left (3 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} - 2 \, a e^{x} + b\right )} a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.78, size = 897, normalized size = 11.21 \begin {gather*} \frac {\frac {4\,\left (25\,a^8\,b^8+65\,a^6\,b^{10}+56\,a^4\,b^{12}+16\,a^2\,b^{14}\right )}{a^4\,b^4\,\left (25\,a^6\,b^3+65\,a^4\,b^5+56\,a^2\,b^7+16\,b^9\right )}-\frac {6\,{\mathrm {e}}^x\,\left (25\,a^9\,b^8+65\,a^7\,b^{10}+56\,a^5\,b^{12}+16\,a^3\,b^{14}\right )}{a^4\,b^5\,\left (25\,a^6\,b^3+65\,a^4\,b^5+56\,a^2\,b^7+16\,b^9\right )}-\frac {4\,{\mathrm {e}}^{2\,x}\,\left (25\,a^8\,b^8+65\,a^6\,b^{10}+56\,a^4\,b^{12}+16\,a^2\,b^{14}\right )}{a^4\,b^4\,\left (25\,a^6\,b^3+65\,a^4\,b^5+56\,a^2\,b^7+16\,b^9\right )}+\frac {2\,{\mathrm {e}}^{3\,x}\,\left (25\,a^9\,b^8+65\,a^7\,b^{10}+56\,a^5\,b^{12}+16\,a^3\,b^{14}\right )}{a^4\,b^5\,\left (25\,a^6\,b^3+65\,a^4\,b^5+56\,a^2\,b^7+16\,b^9\right )}}{b-2\,a\,{\mathrm {e}}^x+2\,a\,{\mathrm {e}}^{3\,x}-2\,b\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{4\,x}}-\frac {2\,b\,\ln \left (64\,{\mathrm {e}}^x-64\right )}{a^3}+\frac {2\,b\,\ln \left (64\,{\mathrm {e}}^x+64\right )}{a^3}-\frac {\ln \left (\frac {\left (a^2+2\,b^2\right )\,\left (\frac {32\,\left (a^4-16\,{\mathrm {e}}^x\,a^3\,b+12\,a^2\,b^2-12\,{\mathrm {e}}^x\,a\,b^3+8\,b^4\right )}{a^4\,b^4}+\frac {\left (a^2+2\,b^2\right )\,\left (\frac {32\,\left (-4\,{\mathrm {e}}^x\,a^3+2\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2+4\,b^3\right )}{b^5}-\frac {32\,\left (a^2+2\,b^2\right )\,\sqrt {a^2+b^2}\,\left (-4\,{\mathrm {e}}^x\,a^5+3\,a^4\,b-3\,{\mathrm {e}}^x\,a^3\,b^2+2\,a^2\,b^3\right )}{b^5\,\left (a^5+a^3\,b^2\right )}\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2}\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2}-\frac {64\,\left (a^2+2\,b^2\right )\,\left (4\,b-7\,a\,{\mathrm {e}}^x\right )}{a^6\,b^3}\right )\,\left (a^2+2\,b^2\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2}+\frac {\ln \left (-\frac {\left (a^2+2\,b^2\right )\,\left (\frac {32\,\left (a^4-16\,{\mathrm {e}}^x\,a^3\,b+12\,a^2\,b^2-12\,{\mathrm {e}}^x\,a\,b^3+8\,b^4\right )}{a^4\,b^4}-\frac {\left (a^2+2\,b^2\right )\,\left (\frac {32\,\left (-4\,{\mathrm {e}}^x\,a^3+2\,a^2\,b-7\,{\mathrm {e}}^x\,a\,b^2+4\,b^3\right )}{b^5}+\frac {32\,\left (a^2+2\,b^2\right )\,\sqrt {a^2+b^2}\,\left (-4\,{\mathrm {e}}^x\,a^5+3\,a^4\,b-3\,{\mathrm {e}}^x\,a^3\,b^2+2\,a^2\,b^3\right )}{b^5\,\left (a^5+a^3\,b^2\right )}\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2}\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2}-\frac {64\,\left (a^2+2\,b^2\right )\,\left (4\,b-7\,a\,{\mathrm {e}}^x\right )}{a^6\,b^3}\right )\,\left (a^2+2\,b^2\right )\,\sqrt {a^2+b^2}}{a^5+a^3\,b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________