Optimal. Leaf size=62 \[ -\frac {b x}{a^2}+\frac {2 b^2 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}+\frac {\sinh (x)}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {3938, 12, 3868,
2738, 211} \begin {gather*} \frac {2 b^2 \text {ArcTan}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}-\frac {b x}{a^2}+\frac {\sinh (x)}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 211
Rule 2738
Rule 3868
Rule 3938
Rubi steps
\begin {align*} \int \frac {\cosh (x)}{a+b \text {sech}(x)} \, dx &=\frac {\sinh (x)}{a}-\frac {\int \frac {b}{a+b \text {sech}(x)} \, dx}{a}\\ &=\frac {\sinh (x)}{a}-\frac {b \int \frac {1}{a+b \text {sech}(x)} \, dx}{a}\\ &=-\frac {b x}{a^2}+\frac {\sinh (x)}{a}+\frac {b \int \frac {1}{1+\frac {a \cosh (x)}{b}} \, dx}{a^2}\\ &=-\frac {b x}{a^2}+\frac {\sinh (x)}{a}+\frac {(2 b) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}-\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{a^2}\\ &=-\frac {b x}{a^2}+\frac {2 b^2 \tan ^{-1}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b}}+\frac {\sinh (x)}{a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 57, normalized size = 0.92 \begin {gather*} \frac {b \left (-x-\frac {2 b \text {ArcTan}\left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}\right )+a \sinh (x)}{a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.82, size = 94, normalized size = 1.52
method | result | size |
default | \(-\frac {1}{a \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a^{2}}+\frac {2 b^{2} \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {1}{a \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a^{2}}\) | \(94\) |
risch | \(-\frac {b x}{a^{2}}+\frac {{\mathrm e}^{x}}{2 a}-\frac {{\mathrm e}^{-x}}{2 a}-\frac {b^{2} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, a^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{x}+\frac {b \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, a}\right )}{\sqrt {-a^{2}+b^{2}}\, a^{2}}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \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. 175 vs.
\(2 (52) = 104\).
time = 0.39, size = 430, normalized size = 6.94 \begin {gather*} \left [-\frac {a^{3} - a b^{2} + 2 \, {\left (a^{2} b - b^{3}\right )} x \cosh \left (x\right ) - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} - {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {a^{2} \cosh \left (x\right )^{2} + a^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) - a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + b\right )}}{a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) + 2 \, {\left (a \cosh \left (x\right ) + b\right )} \sinh \left (x\right ) + a}\right ) + 2 \, {\left ({\left (a^{2} b - b^{3}\right )} x - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} \cosh \left (x\right ) + {\left (a^{4} - a^{2} b^{2}\right )} \sinh \left (x\right )\right )}}, -\frac {a^{3} - a b^{2} + 2 \, {\left (a^{2} b - b^{3}\right )} x \cosh \left (x\right ) - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )^{2} - {\left (a^{3} - a b^{2}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cosh \left (x\right ) + a \sinh \left (x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right ) + 2 \, {\left ({\left (a^{2} b - b^{3}\right )} x - {\left (a^{3} - a b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} \cosh \left (x\right ) + {\left (a^{4} - a^{2} b^{2}\right )} \sinh \left (x\right )\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 {\cosh {\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 [A]
time = 0.41, size = 62, normalized size = 1.00 \begin {gather*} \frac {2 \, b^{2} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{\sqrt {a^{2} - b^{2}} a^{2}} - \frac {b x}{a^{2}} - \frac {e^{\left (-x\right )}}{2 \, a} + \frac {e^{x}}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.48, size = 139, normalized size = 2.24 \begin {gather*} \frac {{\mathrm {e}}^x}{2\,a}-\frac {{\mathrm {e}}^{-x}}{2\,a}-\frac {b\,x}{a^2}+\frac {b^2\,\ln \left (-\frac {2\,b^2\,{\mathrm {e}}^x}{a^3}-\frac {2\,b^2\,\left (a+b\,{\mathrm {e}}^x\right )}{a^3\,\sqrt {a+b}\,\sqrt {b-a}}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {b^2\,\ln \left (\frac {2\,b^2\,\left (a+b\,{\mathrm {e}}^x\right )}{a^3\,\sqrt {a+b}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{a^3}\right )}{a^2\,\sqrt {a+b}\,\sqrt {b-a}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________