Optimal. Leaf size=73 \[ -\frac {b^2 \text {ArcTan}\left (\frac {\cosh (x) (b+a \tanh (x))}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \sinh (x)}{a^2-b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 73, 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 = {3592, 3567,
2717, 3590, 212} \begin {gather*} -\frac {b^2 \text {ArcTan}\left (\frac {\cosh (x) (a \tanh (x)+b)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {a \sinh (x)}{a^2-b^2}-\frac {b \cosh (x)}{a^2-b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2717
Rule 3567
Rule 3590
Rule 3592
Rubi steps
\begin {align*} \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx &=\frac {\int \cosh (x) (a-b \tanh (x)) \, dx}{a^2-b^2}-\frac {b^2 \int \frac {\text {sech}(x)}{a+b \tanh (x)} \, dx}{a^2-b^2}\\ &=-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \int \cosh (x) \, dx}{a^2-b^2}-\frac {\left (i b^2\right ) \text {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,\cosh (x) (-i b-i a \tanh (x))\right )}{a^2-b^2}\\ &=-\frac {b^2 \tan ^{-1}\left (\frac {\cosh (x) (b+a \tanh (x))}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \sinh (x)}{a^2-b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 80, normalized size = 1.10 \begin {gather*} -\frac {2 b^2 \text {ArcTan}\left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2}}+\frac {b \cosh (x)}{-a^2+b^2}+\frac {a \sinh (x)}{a^2-b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.70, size = 93, normalized size = 1.27
method | result | size |
default | \(-\frac {2 b^{2} \arctan \left (\frac {2 a \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}-\frac {2}{\left (2 b +2 a \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {2}{\left (2 a -2 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}\) | \(93\) |
risch | \(\frac {{\mathrm e}^{x}}{2 b +2 a}-\frac {{\mathrm e}^{-x}}{2 \left (a -b \right )}-\frac {b^{2} \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right )}+\frac {b^{2} \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right )}\) | \(122\) |
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. 190 vs.
\(2 (69) = 138\).
time = 0.57, size = 435, normalized size = 5.96 \begin {gather*} \left [-\frac {a^{3} + a^{2} b - a b^{2} - b^{3} - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\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 {{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} - a + b}{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} + a - b}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )\right )}}, -\frac {a^{3} + a^{2} b - a b^{2} - b^{3} - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\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 {\sqrt {a^{2} - b^{2}}}{{\left (a + b\right )} \cosh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\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 \tanh {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 61, normalized size = 0.84 \begin {gather*} -\frac {2 \, b^{2} \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {a^{2} - b^{2}}}\right )}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} - \frac {e^{\left (-x\right )}}{2 \, {\left (a - b\right )}} + \frac {e^{x}}{2 \, {\left (a + b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.36, size = 157, normalized size = 2.15 \begin {gather*} \frac {{\mathrm {e}}^x}{2\,a+2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,a-2\,b}-\frac {b^2\,\ln \left (-\frac {2\,b^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{-a^3-a^2\,b+a\,b^2+b^3}\right )}{{\left (a+b\right )}^{3/2}\,{\left (b-a\right )}^{3/2}}+\frac {b^2\,\ln \left (\frac {2\,b^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{-a^3-a^2\,b+a\,b^2+b^3}\right )}{{\left (a+b\right )}^{3/2}\,{\left (b-a\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________