Optimal. Leaf size=163 \[ \frac {2 a^2 b \text {ArcTan}\left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {b^3 \text {ArcTan}\left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {a^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {b^2 \cosh (x)}{\left (a^2-b^2\right )^2}-\frac {2 a b \sinh (x)}{\left (a^2-b^2\right )^2}+\frac {a b^2}{\left (a^2-b^2\right )^2 (a \cosh (x)+b \sinh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 163, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 8, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {3190, 3179,
2717, 3153, 212, 3188, 2718, 3234} \begin {gather*} \frac {2 a^2 b \text {ArcTan}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {b^3 \text {ArcTan}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}-\frac {2 a b \sinh (x)}{\left (a^2-b^2\right )^2}+\frac {b^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {a^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {a b^2}{\left (a^2-b^2\right )^2 (a \cosh (x)+b \sinh (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2717
Rule 2718
Rule 3153
Rule 3179
Rule 3188
Rule 3190
Rule 3234
Rubi steps
\begin {align*} \int \frac {\cosh ^2(x) \sinh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx &=\frac {a \int \frac {\cosh (x) \sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}-\frac {b \int \frac {\cosh ^2(x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}+\frac {(a b) \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx}{a^2-b^2}\\ &=\frac {b^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {a b^2}{\left (a^2-b^2\right )^2 (a \cosh (x)+b \sinh (x))}+\frac {a^2 \int \sinh (x) \, dx}{\left (a^2-b^2\right )^2}-2 \frac {(a b) \int \cosh (x) \, dx}{\left (a^2-b^2\right )^2}+2 \frac {\left (a^2 b\right ) \int \frac {1}{a \cosh (x)+b \sinh (x)} \, dx}{\left (a^2-b^2\right )^2}+\frac {b^3 \int \frac {1}{a \cosh (x)+b \sinh (x)} \, dx}{\left (a^2-b^2\right )^2}\\ &=\frac {a^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {b^2 \cosh (x)}{\left (a^2-b^2\right )^2}-\frac {2 a b \sinh (x)}{\left (a^2-b^2\right )^2}+\frac {a b^2}{\left (a^2-b^2\right )^2 (a \cosh (x)+b \sinh (x))}+2 \frac {\left (i a^2 b\right ) \text {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,-i b \cosh (x)-i a \sinh (x)\right )}{\left (a^2-b^2\right )^2}+\frac {\left (i b^3\right ) \text {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,-i b \cosh (x)-i a \sinh (x)\right )}{\left (a^2-b^2\right )^2}\\ &=\frac {2 a^2 b \tan ^{-1}\left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {b^3 \tan ^{-1}\left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {a^2 \cosh (x)}{\left (a^2-b^2\right )^2}+\frac {b^2 \cosh (x)}{\left (a^2-b^2\right )^2}-\frac {2 a b \sinh (x)}{\left (a^2-b^2\right )^2}+\frac {a b^2}{\left (a^2-b^2\right )^2 (a \cosh (x)+b \sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.64, size = 264, normalized size = 1.62 \begin {gather*} -\frac {a \sqrt {a-b} (a+b)+2 a b \sqrt {a+b} \text {ArcTan}\left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right ) \cosh (x)+2 b^2 \sqrt {a+b} \text {ArcTan}\left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right ) \sinh (x)}{4 (a-b)^{3/2} (a+b)^2 (a \cosh (x)+b \sinh (x))}+\frac {1}{4} \left (\frac {6 b \left (3 a^2+b^2\right ) \text {ArcTan}\left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2}}+\frac {4 \left (a^2+b^2\right ) \cosh (x)}{(a-b)^2 (a+b)^2}-\frac {8 a b \sinh (x)}{(a-b)^2 (a+b)^2}+\frac {a \left (a^2+3 b^2\right )}{(a-b)^2 (a+b)^2 (a \cosh (x)+b \sinh (x))}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.47, size = 130, normalized size = 0.80
method | result | size |
default | \(-\frac {1}{\left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {4 b \left (\frac {\frac {b^{2} \tanh \left (\frac {x}{2}\right )}{2}+\frac {a b}{2}}{a +2 b \tanh \left (\frac {x}{2}\right )+a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}+\frac {\left (2 a^{2}+b^{2}\right ) \arctan \left (\frac {2 a \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}+\frac {1}{\left (a -b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )}\) | \(130\) |
risch | \(\frac {{\mathrm e}^{x}}{2 a^{2}+4 a b +2 b^{2}}+\frac {{\mathrm e}^{-x}}{2 a^{2}-4 a b +2 b^{2}}+\frac {2 a \,b^{2} {\mathrm e}^{x}}{\left (a -b \right )^{2} \left (a^{2}+2 a b +b^{2}\right ) \left ({\mathrm e}^{2 x} a +b \,{\mathrm e}^{2 x}+a -b \right )}-\frac {2 b \,a^{2} \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {b^{3} \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {2 b \,a^{2} \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {b^{3} \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(284\) |
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. 875 vs.
\(2 (155) = 310\).
time = 0.36, size = 1805, normalized size = 11.07 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 179, normalized size = 1.10 \begin {gather*} \frac {2 \, {\left (2 \, a^{2} b + b^{3}\right )} \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {a^{2} - b^{2}}}\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} - b^{2}}} + \frac {e^{x}}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {a^{3} e^{\left (2 \, x\right )} + 3 \, a^{2} b e^{\left (2 \, x\right )} + 7 \, a b^{2} e^{\left (2 \, x\right )} + b^{3} e^{\left (2 \, x\right )} + a^{3} + a^{2} b - a b^{2} - b^{3}}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (a e^{\left (3 \, x\right )} + b e^{\left (3 \, x\right )} + a e^{x} - b e^{x}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.82, size = 397, normalized size = 2.44 \begin {gather*} \frac {{\mathrm {e}}^{-x}}{2\,{\left (a-b\right )}^2}+\frac {{\mathrm {e}}^x}{2\,{\left (a+b\right )}^2}+\frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (b^3\,\sqrt {a^{10}-5\,a^8\,b^2+10\,a^6\,b^4-10\,a^4\,b^6+5\,a^2\,b^8-b^{10}}+2\,a^2\,b\,\sqrt {a^{10}-5\,a^8\,b^2+10\,a^6\,b^4-10\,a^4\,b^6+5\,a^2\,b^8-b^{10}}\right )}{a^5\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}-b^5\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}+2\,a^2\,b^3\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}-2\,a^3\,b^2\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}+a\,b^4\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}-a^4\,b\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}}\right )\,\sqrt {4\,a^4\,b^2+4\,a^2\,b^4+b^6}}{\sqrt {a^{10}-5\,a^8\,b^2+10\,a^6\,b^4-10\,a^4\,b^6+5\,a^2\,b^8-b^{10}}}+\frac {2\,a\,b^2\,{\mathrm {e}}^x}{{\left (a+b\right )}^2\,{\left (a-b\right )}^2\,\left (a-b+{\mathrm {e}}^{2\,x}\,\left (a+b\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________