Optimal. Leaf size=194 \[ -\frac {a^2 b^3 x}{\left (a^2-b^2\right )^3}-\frac {a^2 b x}{2 \left (a^2-b^2\right )^2}+\frac {b x}{8 \left (a^2-b^2\right )}+\frac {a^3 b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^3}+\frac {a^2 b \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )^2}+\frac {b \cosh (x) \sinh (x)}{8 \left (a^2-b^2\right )}-\frac {b \cosh ^3(x) \sinh (x)}{4 \left (a^2-b^2\right )}-\frac {a b^2 \sinh ^2(x)}{2 \left (a^2-b^2\right )^2}+\frac {a \sinh ^4(x)}{4 \left (a^2-b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 194, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 8, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3188, 2648,
2715, 8, 2644, 30, 3176, 3212} \begin {gather*} \frac {b x}{8 \left (a^2-b^2\right )}-\frac {a^2 b x}{2 \left (a^2-b^2\right )^2}+\frac {a \sinh ^4(x)}{4 \left (a^2-b^2\right )}-\frac {a b^2 \sinh ^2(x)}{2 \left (a^2-b^2\right )^2}-\frac {b \sinh (x) \cosh ^3(x)}{4 \left (a^2-b^2\right )}+\frac {b \sinh (x) \cosh (x)}{8 \left (a^2-b^2\right )}+\frac {a^2 b \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )^2}-\frac {a^2 b^3 x}{\left (a^2-b^2\right )^3}+\frac {a^3 b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2644
Rule 2648
Rule 2715
Rule 3176
Rule 3188
Rule 3212
Rubi steps
\begin {align*} \int \frac {\cosh ^2(x) \sinh ^3(x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac {a \int \cosh (x) \sinh ^3(x) \, dx}{a^2-b^2}-\frac {b \int \cosh ^2(x) \sinh ^2(x) \, dx}{a^2-b^2}+\frac {(a b) \int \frac {\cosh (x) \sinh ^2(x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=-\frac {b \cosh ^3(x) \sinh (x)}{4 \left (a^2-b^2\right )}+\frac {\left (a^2 b\right ) \int \sinh ^2(x) \, dx}{\left (a^2-b^2\right )^2}-\frac {\left (a b^2\right ) \int \cosh (x) \sinh (x) \, dx}{\left (a^2-b^2\right )^2}+\frac {\left (a^2 b^2\right ) \int \frac {\sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{\left (a^2-b^2\right )^2}+\frac {a \text {Subst}\left (\int x^3 \, dx,x,i \sinh (x)\right )}{a^2-b^2}+\frac {b \int \cosh ^2(x) \, dx}{4 \left (a^2-b^2\right )}\\ &=-\frac {a^2 b^3 x}{\left (a^2-b^2\right )^3}+\frac {a^2 b \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )^2}+\frac {b \cosh (x) \sinh (x)}{8 \left (a^2-b^2\right )}-\frac {b \cosh ^3(x) \sinh (x)}{4 \left (a^2-b^2\right )}+\frac {a \sinh ^4(x)}{4 \left (a^2-b^2\right )}+\frac {\left (i a^3 b^2\right ) \int \frac {-i b \cosh (x)-i a \sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{\left (a^2-b^2\right )^3}-\frac {\left (a^2 b\right ) \int 1 \, dx}{2 \left (a^2-b^2\right )^2}+\frac {\left (a b^2\right ) \text {Subst}(\int x \, dx,x,i \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b \int 1 \, dx}{8 \left (a^2-b^2\right )}\\ &=-\frac {a^2 b^3 x}{\left (a^2-b^2\right )^3}-\frac {a^2 b x}{2 \left (a^2-b^2\right )^2}+\frac {b x}{8 \left (a^2-b^2\right )}+\frac {a^3 b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^3}+\frac {a^2 b \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )^2}+\frac {b \cosh (x) \sinh (x)}{8 \left (a^2-b^2\right )}-\frac {b \cosh ^3(x) \sinh (x)}{4 \left (a^2-b^2\right )}-\frac {a b^2 \sinh ^2(x)}{2 \left (a^2-b^2\right )^2}+\frac {a \sinh ^4(x)}{4 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.44, size = 128, normalized size = 0.66 \begin {gather*} \frac {-4 a \left (a^4-b^4\right ) \cosh (2 x)+a \left (a^2-b^2\right )^2 \cosh (4 x)-b \left (4 \left (3 a^4 x+6 a^2 b^2 x-b^4 x-8 a^3 b \log (a \cosh (x)+b \sinh (x))\right )-8 a^2 \left (a^2-b^2\right ) \sinh (2 x)+\left (a^2-b^2\right )^2 \sinh (4 x)\right )}{32 (a-b)^3 (a+b)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.51, size = 249, normalized size = 1.28
method | result | size |
risch | \(-\frac {3 b x a}{8 \left (a +b \right )^{3}}-\frac {b^{2} x}{8 \left (a +b \right )^{3}}+\frac {{\mathrm e}^{4 x}}{64 a +64 b}-\frac {a \,{\mathrm e}^{2 x}}{16 \left (a +b \right )^{2}}-\frac {a \,{\mathrm e}^{-2 x}}{16 \left (a -b \right )^{2}}+\frac {{\mathrm e}^{-4 x}}{64 a -64 b}-\frac {2 a^{3} b^{2} x}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}+\frac {a^{3} b^{2} \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}\) | \(160\) |
default | \(\frac {4}{\left (16 a -16 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{4}}-\frac {16}{\left (32 a -32 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {-a -b}{8 \left (a -b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {-a +3 b}{8 \left (a -b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {b \left (3 a -b \right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{8 \left (a -b \right )^{3}}+\frac {a^{3} b^{2} \ln \left (a +2 b \tanh \left (\frac {x}{2}\right )+a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )\right )}{\left (a +b \right )^{3} \left (a -b \right )^{3}}+\frac {4}{\left (16 a +16 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{4}}+\frac {16}{\left (32 a +32 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )^{3}}-\frac {-a -3 b}{8 \left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}-\frac {a -b}{8 \left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {b \left (3 a +b \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 \left (a +b \right )^{3}}\) | \(249\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 153, normalized size = 0.79 \begin {gather*} \frac {a^{3} b^{2} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} - \frac {{\left (3 \, a b + b^{2}\right )} x}{8 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )}} - \frac {{\left (4 \, a e^{\left (-2 \, x\right )} - a - b\right )} e^{\left (4 \, x\right )}}{64 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {4 \, a e^{\left (-2 \, x\right )} - {\left (a - b\right )} e^{\left (-4 \, x\right )}}{64 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} \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. 1158 vs.
\(2 (180) = 360\).
time = 0.41, size = 1158, normalized size = 5.97 \begin {gather*} \frac {{\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{8} + 8 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{7} + {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \sinh \left (x\right )^{8} - 4 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{6} - 4 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4} - 7 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{6} - 8 \, {\left (3 \, a^{4} b + 8 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - b^{5}\right )} x \cosh \left (x\right )^{4} + 8 \, {\left (7 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{3} - 3 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{5} + a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5} + 2 \, {\left (35 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{4} - 30 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{2} - 4 \, {\left (3 \, a^{4} b + 8 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - b^{5}\right )} x\right )} \sinh \left (x\right )^{4} + 8 \, {\left (7 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{5} - 10 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{3} - 4 \, {\left (3 \, a^{4} b + 8 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - b^{5}\right )} x \cosh \left (x\right )\right )} \sinh \left (x\right )^{3} - 4 \, {\left (a^{5} + 2 \, a^{4} b - 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (7 \, {\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{6} - a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} + a b^{4} - 15 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{4} - 12 \, {\left (3 \, a^{4} b + 8 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - b^{5}\right )} x \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )^{2} + 64 \, {\left (a^{3} b^{2} \cosh \left (x\right )^{4} + 4 \, a^{3} b^{2} \cosh \left (x\right )^{3} \sinh \left (x\right ) + 6 \, a^{3} b^{2} \cosh \left (x\right )^{2} \sinh \left (x\right )^{2} + 4 \, a^{3} b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + a^{3} b^{2} \sinh \left (x\right )^{4}\right )} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 8 \, {\left ({\left (a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5}\right )} \cosh \left (x\right )^{7} - 3 \, {\left (a^{5} - 2 \, a^{4} b + 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )^{5} - 4 \, {\left (3 \, a^{4} b + 8 \, a^{3} b^{2} + 6 \, a^{2} b^{3} - b^{5}\right )} x \cosh \left (x\right )^{3} - {\left (a^{5} + 2 \, a^{4} b - 2 \, a^{2} b^{3} - a b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )}{64 \, {\left ({\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cosh \left (x\right )^{3} \sinh \left (x\right ) + 6 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cosh \left (x\right )^{2} \sinh \left (x\right )^{2} + 4 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sinh \left (x\right )^{4}\right )}} \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.41, size = 199, normalized size = 1.03 \begin {gather*} \frac {a^{3} b^{2} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} - \frac {{\left (3 \, a b - b^{2}\right )} x}{8 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}} + \frac {{\left (18 \, a b e^{\left (4 \, x\right )} - 6 \, b^{2} e^{\left (4 \, x\right )} - 4 \, a^{2} e^{\left (2 \, x\right )} + 4 \, a b e^{\left (2 \, x\right )} + a^{2} - 2 \, a b + b^{2}\right )} e^{\left (-4 \, x\right )}}{64 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}} + \frac {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} - 4 \, a e^{\left (2 \, x\right )}}{64 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.87, size = 127, normalized size = 0.65 \begin {gather*} \frac {{\mathrm {e}}^{-4\,x}}{64\,a-64\,b}+\frac {{\mathrm {e}}^{4\,x}}{64\,a+64\,b}-\frac {x\,\left (3\,a\,b-b^2\right )}{8\,{\left (a-b\right )}^3}-\frac {a\,{\mathrm {e}}^{2\,x}}{16\,{\left (a+b\right )}^2}-\frac {a\,{\mathrm {e}}^{-2\,x}}{16\,{\left (a-b\right )}^2}+\frac {a^3\,b^2\,\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________