Optimal. Leaf size=102 \[ -\frac {a x}{2 \left (a^2-b^2\right )}-\frac {a b^2 x}{\left (a^2-b^2\right )^2}-\frac {b \sinh ^2(x)}{2 \left (a^2-b^2\right )}+\frac {a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac {a^2 b \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {3109, 2564, 30, 2635, 8, 3097, 3133} \[ -\frac {a x}{2 \left (a^2-b^2\right )}-\frac {a b^2 x}{\left (a^2-b^2\right )^2}-\frac {b \sinh ^2(x)}{2 \left (a^2-b^2\right )}+\frac {a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac {a^2 b \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2564
Rule 2635
Rule 3097
Rule 3109
Rule 3133
Rubi steps
\begin {align*} \int \frac {\cosh (x) \sinh ^2(x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac {a \int \sinh ^2(x) \, dx}{a^2-b^2}-\frac {b \int \cosh (x) \sinh (x) \, dx}{a^2-b^2}+\frac {(a b) \int \frac {\sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=-\frac {a b^2 x}{\left (a^2-b^2\right )^2}+\frac {a \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )}+\frac {\left (i a^2 b\right ) \int \frac {-i b \cosh (x)-i a \sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{\left (a^2-b^2\right )^2}-\frac {a \int 1 \, dx}{2 \left (a^2-b^2\right )}+\frac {b \operatorname {Subst}(\int x \, dx,x,i \sinh (x))}{a^2-b^2}\\ &=-\frac {a b^2 x}{\left (a^2-b^2\right )^2}-\frac {a x}{2 \left (a^2-b^2\right )}+\frac {a^2 b \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {a \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )}-\frac {b \sinh ^2(x)}{2 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.25, size = 73, normalized size = 0.72 \[ \frac {\left (b^3-a^2 b\right ) \cosh (2 x)+a \left (-2 x \left (a^2+b^2\right )+\left (a^2-b^2\right ) \sinh (2 x)+4 a b \log (a \cosh (x)+b \sinh (x))\right )}{4 (a-b)^2 (a+b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.45, size = 334, normalized size = 3.27 \[ \frac {{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{4} + 4 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x) \sinh \relax (x)^{3} + {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \relax (x)^{4} - 4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} x \cosh \relax (x)^{2} - a^{3} - a^{2} b + a b^{2} + b^{3} + 2 \, {\left (3 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{2} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} x\right )} \sinh \relax (x)^{2} + 8 \, {\left (a^{2} b \cosh \relax (x)^{2} + 2 \, a^{2} b \cosh \relax (x) \sinh \relax (x) + a^{2} b \sinh \relax (x)^{2}\right )} \log \left (\frac {2 \, {\left (a \cosh \relax (x) + b \sinh \relax (x)\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + 4 \, {\left ({\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \relax (x)^{3} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} x \cosh \relax (x)\right )} \sinh \relax (x)}{8 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \relax (x)^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.11, size = 101, normalized size = 0.99 \[ \frac {a^{2} b \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {a x}{2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} + \frac {{\left (2 \, a e^{\left (2 \, x\right )} - a + b\right )} e^{\left (-2 \, x\right )}}{8 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} + \frac {e^{\left (2 \, x\right )}}{8 \, {\left (a + b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.21, size = 145, normalized size = 1.42 \[ \frac {4}{\left (8 a +8 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {8}{\left (16 a +16 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right ) a}{2 \left (a +b \right )^{2}}+\frac {a^{2} b \ln \left (a +2 \tanh \left (\frac {x}{2}\right ) b +a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}-\frac {4}{\left (8 a -8 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {8}{\left (16 a -16 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right ) a}{2 \left (a -b \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 83, normalized size = 0.81 \[ \frac {a^{2} b \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {a x}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {e^{\left (2 \, x\right )}}{8 \, {\left (a + b\right )}} - \frac {e^{\left (-2 \, x\right )}}{8 \, {\left (a - b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.68, size = 81, normalized size = 0.79 \[ \frac {{\mathrm {e}}^{2\,x}}{8\,a+8\,b}-\frac {{\mathrm {e}}^{-2\,x}}{8\,a-8\,b}-\frac {a\,x}{2\,{\left (a-b\right )}^2}+\frac {a^2\,b\,\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^4-2\,a^2\,b^2+b^4} \]
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]
________________________________________________________________________________________