Optimal. Leaf size=72 \[ \frac {a \sinh (x)}{a^2-b^2}-\frac {b \cosh (x)}{a^2-b^2}+\frac {a b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.546, Rules used = {3518, 3109, 2637, 2638, 3074, 206} \[ \frac {a \sinh (x)}{a^2-b^2}-\frac {b \cosh (x)}{a^2-b^2}+\frac {a b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 2637
Rule 2638
Rule 3074
Rule 3109
Rule 3518
Rubi steps
\begin {align*} \int \frac {\cosh (x)}{a+b \coth (x)} \, dx &=-\left (i \int \frac {\cosh (x) \sinh (x)}{-i b \cosh (x)-i a \sinh (x)} \, dx\right )\\ &=\frac {a \int \cosh (x) \, dx}{a^2-b^2}-\frac {b \int \sinh (x) \, dx}{a^2-b^2}+\frac {(i a b) \int \frac {1}{-i b \cosh (x)-i a \sinh (x)} \, dx}{a^2-b^2}\\ &=-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \sinh (x)}{a^2-b^2}-\frac {(a b) \operatorname {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,-a \cosh (x)-b \sinh (x)\right )}{a^2-b^2}\\ &=\frac {a b \tanh ^{-1}\left (\frac {a \cosh (x)+b \sinh (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.31, size = 79, normalized size = 1.10 \[ \frac {a \sinh (x)}{a^2-b^2}+\frac {b \cosh (x)}{b^2-a^2}+\frac {2 a b \tan ^{-1}\left (\frac {a+b \tanh \left (\frac {x}{2}\right )}{\sqrt {b-a} \sqrt {a+b}}\right )}{(b-a)^{3/2} (a+b)^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.42, size = 431, normalized size = 5.99 \[ \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 \relax (x)^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x) \sinh \relax (x) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \relax (x)^{2} + 2 \, {\left (a b \cosh \relax (x) + a b \sinh \relax (x)\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (\cosh \relax (x) + \sinh \relax (x)\right )} + a - b}{{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} - a + b}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \relax (x)\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 \relax (x)^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x) \sinh \relax (x) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \relax (x)^{2} + 4 \, {\left (a b \cosh \relax (x) + a b \sinh \relax (x)\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (\frac {\sqrt {-a^{2} + b^{2}}}{{\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x)}\right )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \relax (x)\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.12, size = 71, normalized size = 0.99 \[ -\frac {2 \, a b \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {-a^{2} + b^{2}}}\right )}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {e^{\left (-x\right )}}{2 \, {\left (a - b\right )}} + \frac {e^{x}}{2 \, {\left (a + b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 92, normalized size = 1.28 \[ -\frac {2 a b \arctan \left (\frac {2 \tanh \left (\frac {x}{2}\right ) b +2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {-a^{2}+b^{2}}}-\frac {4}{\left (4 a -4 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {4}{\left (4 a +4 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.53, size = 158, normalized size = 2.19 \[ \frac {{\mathrm {e}}^x}{2\,a+2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,a-2\,b}+\frac {2\,\mathrm {atan}\left (\frac {a\,b\,{\mathrm {e}}^x\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}}{a^3\,\sqrt {a^2\,b^2}+b^3\,\sqrt {a^2\,b^2}-a\,b^2\,\sqrt {a^2\,b^2}-a^2\,b\,\sqrt {a^2\,b^2}}\right )\,\sqrt {a^2\,b^2}}{\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cosh {\relax (x )}}{a + b \coth {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________