Optimal. Leaf size=74 \[ \frac {a \sinh (x)}{a^2-b^2}-\frac {b \cosh (x)}{a^2-b^2}-\frac {a^2 \tan ^{-1}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3099, 3074, 206, 2638} \[ \frac {a \sinh (x)}{a^2-b^2}-\frac {b \cosh (x)}{a^2-b^2}-\frac {a^2 \tan ^{-1}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 2638
Rule 3074
Rule 3099
Rubi steps
\begin {align*} \int \frac {\sinh ^2(x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac {a \sinh (x)}{a^2-b^2}-\frac {a^2 \int \frac {1}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}-\frac {b \int \sinh (x) \, dx}{a^2-b^2}\\ &=-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \sinh (x)}{a^2-b^2}-\frac {\left (i a^2\right ) \operatorname {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,-i b \cosh (x)-i a \sinh (x)\right )}{a^2-b^2}\\ &=-\frac {a^2 \tan ^{-1}\left (\frac {b \cosh (x)+a \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.20, size = 89, normalized size = 1.20 \[ \frac {a \left (\sqrt {a-b} (a+b) \sinh (x)-2 a \sqrt {a+b} \tan ^{-1}\left (\frac {a \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a-b} \sqrt {a+b}}\right )\right )-b \sqrt {a-b} (a+b) \cosh (x)}{(a-b)^{3/2} (a+b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.45, size = 435, normalized size = 5.88 \[ \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^{2} \cosh \relax (x) + a^{2} \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^{2} \cosh \relax (x) + a^{2} \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 = 61, normalized size = 0.82 \[ -\frac {2 \, a^{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 )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.20, size = 93, normalized size = 1.26 \[ -\frac {8}{\left (8 a -8 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {2 a^{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 {8}{\left (8 a +8 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.72, size = 157, normalized size = 2.12 \[ \frac {{\mathrm {e}}^x}{2\,a+2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,a-2\,b}-\frac {a^2\,\ln \left (-\frac {2\,a^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,a^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 {a^2\,\ln \left (\frac {2\,a^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,a^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}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________