Optimal. Leaf size=85 \[ \frac {(b-a \cosh (x)) \text {csch}^2(x)}{2 \left (a^2-b^2\right )}-\frac {a \log (1-\cosh (x))}{4 (a+b)^2}+\frac {a \log (1+\cosh (x))}{4 (a-b)^2}-\frac {a^2 b \log (b+a \cosh (x))}{\left (a^2-b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2916, 12,
837, 815} \begin {gather*} -\frac {a^2 b \log (a \cosh (x)+b)}{\left (a^2-b^2\right )^2}+\frac {\text {csch}^2(x) (b-a \cosh (x))}{2 \left (a^2-b^2\right )}-\frac {a \log (1-\cosh (x))}{4 (a+b)^2}+\frac {a \log (\cosh (x)+1)}{4 (a-b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 815
Rule 837
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int \frac {\text {csch}^3(x)}{a+b \text {sech}(x)} \, dx &=-\int \frac {\coth (x) \text {csch}^2(x)}{-b-a \cosh (x)} \, dx\\ &=-\left (a^3 \text {Subst}\left (\int \frac {x}{a (-b+x) \left (a^2-x^2\right )^2} \, dx,x,-a \cosh (x)\right )\right )\\ &=-\left (a^2 \text {Subst}\left (\int \frac {x}{(-b+x) \left (a^2-x^2\right )^2} \, dx,x,-a \cosh (x)\right )\right )\\ &=\frac {(b-a \cosh (x)) \text {csch}^2(x)}{2 \left (a^2-b^2\right )}-\frac {\text {Subst}\left (\int \frac {a^2 b+a^2 x}{(-b+x) \left (a^2-x^2\right )} \, dx,x,-a \cosh (x)\right )}{2 \left (a^2-b^2\right )}\\ &=\frac {(b-a \cosh (x)) \text {csch}^2(x)}{2 \left (a^2-b^2\right )}-\frac {\text {Subst}\left (\int \left (\frac {a (a+b)}{2 (a-b) (a-x)}-\frac {2 a^2 b}{(a-b) (a+b) (b-x)}+\frac {a (a-b)}{2 (a+b) (a+x)}\right ) \, dx,x,-a \cosh (x)\right )}{2 \left (a^2-b^2\right )}\\ &=\frac {(b-a \cosh (x)) \text {csch}^2(x)}{2 \left (a^2-b^2\right )}-\frac {a \log (1-\cosh (x))}{4 (a+b)^2}+\frac {a \log (1+\cosh (x))}{4 (a-b)^2}-\frac {a^2 b \log (b+a \cosh (x))}{\left (a^2-b^2\right )^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.23, size = 86, normalized size = 1.01 \begin {gather*} \frac {1}{8} \left (-\frac {\text {csch}^2\left (\frac {x}{2}\right )}{a+b}-\frac {4 a \left (2 a b \log (b+a \cosh (x))-2 a b \log (\sinh (x))+\left (a^2+b^2\right ) \log \left (\tanh \left (\frac {x}{2}\right )\right )\right )}{(a-b)^2 (a+b)^2}-\frac {\text {sech}^2\left (\frac {x}{2}\right )}{a-b}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.88, size = 82, normalized size = 0.96
method | result | size |
default | \(\frac {\tanh ^{2}\left (\frac {x}{2}\right )}{8 a -8 b}-\frac {1}{8 \left (a +b \right ) \tanh \left (\frac {x}{2}\right )^{2}}-\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{2 \left (a +b \right )^{2}}-\frac {a^{2} b \ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+a +b \right )}{\left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(82\) |
risch | \(-\frac {x a}{2 \left (a^{2}-2 a b +b^{2}\right )}+\frac {a x}{2 a^{2}+4 a b +2 b^{2}}+\frac {2 a^{2} b x}{a^{4}-2 a^{2} b^{2}+b^{4}}-\frac {{\mathrm e}^{x} \left ({\mathrm e}^{2 x} a -2 \,{\mathrm e}^{x} b +a \right )}{\left ({\mathrm e}^{2 x}-1\right )^{2} \left (a^{2}-b^{2}\right )}+\frac {a \ln \left ({\mathrm e}^{x}+1\right )}{2 a^{2}-4 a b +2 b^{2}}-\frac {a \ln \left ({\mathrm e}^{x}-1\right )}{2 \left (a^{2}+2 a b +b^{2}\right )}-\frac {a^{2} b \ln \left ({\mathrm e}^{2 x}+\frac {2 b \,{\mathrm e}^{x}}{a}+1\right )}{a^{4}-2 a^{2} b^{2}+b^{4}}\) | \(176\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 148, normalized size = 1.74 \begin {gather*} -\frac {a^{2} b \log \left (2 \, b e^{\left (-x\right )} + a e^{\left (-2 \, x\right )} + a\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac {a \log \left (e^{\left (-x\right )} + 1\right )}{2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac {a \log \left (e^{\left (-x\right )} - 1\right )}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {a e^{\left (-x\right )} - 2 \, b e^{\left (-2 \, x\right )} + a e^{\left (-3 \, x\right )}}{a^{2} - b^{2} - 2 \, {\left (a^{2} - b^{2}\right )} e^{\left (-2 \, x\right )} + {\left (a^{2} - b^{2}\right )} e^{\left (-4 \, x\right )}} \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. 828 vs.
\(2 (80) = 160\).
time = 0.45, size = 828, normalized size = 9.74 \begin {gather*} -\frac {2 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{3} + 2 \, {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{3} - 4 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (2 \, a^{2} b - 2 \, b^{3} - 3 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} + 2 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right ) + 2 \, {\left (a^{2} b \cosh \left (x\right )^{4} + 4 \, a^{2} b \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{2} b \sinh \left (x\right )^{4} - 2 \, a^{2} b \cosh \left (x\right )^{2} + a^{2} b + 2 \, {\left (3 \, a^{2} b \cosh \left (x\right )^{2} - a^{2} b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (a^{2} b \cosh \left (x\right )^{3} - a^{2} b \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left ({\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sinh \left (x\right )^{4} + a^{3} + 2 \, a^{2} b + a b^{2} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2} - 3 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{3} - {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) + {\left ({\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \sinh \left (x\right )^{4} + a^{3} - 2 \, a^{2} b + a b^{2} - 2 \, {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} - 2 \, a^{2} b + a b^{2} - 3 \, {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cosh \left (x\right )^{3} - {\left (a^{3} - 2 \, a^{2} b + a b^{2}\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 (a^{3} - a b^{2} + 3 \, {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} - 4 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{4} + a^{4} - 2 \, a^{2} b^{2} + b^{4} - 2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4} - 3 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{3} - {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\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 {\operatorname {csch}^{3}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 174 vs.
\(2 (80) = 160\).
time = 0.39, size = 174, normalized size = 2.05 \begin {gather*} -\frac {a^{3} b \log \left ({\left | a {\left (e^{\left (-x\right )} + e^{x}\right )} + 2 \, b \right |}\right )}{a^{5} - 2 \, a^{3} b^{2} + a b^{4}} + \frac {a \log \left (e^{\left (-x\right )} + e^{x} + 2\right )}{4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac {a \log \left (e^{\left (-x\right )} + e^{x} - 2\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {a^{2} b {\left (e^{\left (-x\right )} + e^{x}\right )}^{2} + 2 \, a^{3} {\left (e^{\left (-x\right )} + e^{x}\right )} - 2 \, a b^{2} {\left (e^{\left (-x\right )} + e^{x}\right )} - 8 \, a^{2} b + 4 \, b^{3}}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left ({\left (e^{\left (-x\right )} + e^{x}\right )}^{2} - 4\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.83, size = 255, normalized size = 3.00 \begin {gather*} \frac {\frac {2\,\left (a^2\,b-b^3\right )}{{\left (a^2-b^2\right )}^2}+\frac {{\mathrm {e}}^x\,\left (a\,b^2-a^3\right )}{{\left (a^2-b^2\right )}^2}}{{\mathrm {e}}^{2\,x}-1}+\frac {\frac {2\,b}{a^2-b^2}-\frac {2\,a\,{\mathrm {e}}^x}{a^2-b^2}}{{\mathrm {e}}^{4\,x}-2\,{\mathrm {e}}^{2\,x}+1}-\frac {a\,\ln \left ({\mathrm {e}}^x-1\right )}{2\,a^2+4\,a\,b+2\,b^2}+\frac {a\,\ln \left ({\mathrm {e}}^x+1\right )}{2\,a^2-4\,a\,b+2\,b^2}-\frac {a^2\,b\,\ln \left (a^6\,{\mathrm {e}}^{2\,x}+a^6+a^2\,b^4-14\,a^4\,b^2+a^2\,b^4\,{\mathrm {e}}^{2\,x}-14\,a^4\,b^2\,{\mathrm {e}}^{2\,x}+2\,a\,b^5\,{\mathrm {e}}^x+2\,a^5\,b\,{\mathrm {e}}^x-28\,a^3\,b^3\,{\mathrm {e}}^x\right )}{a^4-2\,a^2\,b^2+b^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________