Optimal. Leaf size=93 \[ -\frac {2 a b x}{\left (a^2-b^2\right )^2}+\frac {a^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b \sinh (x)}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {3190, 3177,
3212, 3176, 3154} \begin {gather*} -\frac {2 a b x}{\left (a^2-b^2\right )^2}+\frac {b \sinh (x)}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {a^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3154
Rule 3176
Rule 3177
Rule 3190
Rule 3212
Rubi steps
\begin {align*} \int \frac {\cosh (x) \sinh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx &=\frac {a \int \frac {\sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}-\frac {b \int \frac {\cosh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}+\frac {(a b) \int \frac {1}{(a \cosh (x)+b \sinh (x))^2} \, dx}{a^2-b^2}\\ &=-\frac {2 a b x}{\left (a^2-b^2\right )^2}+\frac {b \sinh (x)}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {\left (i a^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 )^2}+\frac {\left (i 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 )^2}\\ &=-\frac {2 a b x}{\left (a^2-b^2\right )^2}+\frac {a^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}+\frac {b \sinh (x)}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 60, normalized size = 0.65 \begin {gather*} \frac {-2 a b x+\left (a^2+b^2\right ) \log (a \cosh (x)+b \sinh (x))+\frac {(a-b) b (a+b) \sinh (x)}{a \cosh (x)+b \sinh (x)}}{(a-b)^2 (a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.36, size = 108, normalized size = 1.16
method | result | size |
default | \(-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{\left (a -b \right )^{2}}+\frac {\frac {2 b \left (a^{2}-b^{2}\right ) \tanh \left (\frac {x}{2}\right )}{a +2 b \tanh \left (\frac {x}{2}\right )+a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}+\left (a^{2}+b^{2}\right ) \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 )^{2} \left (a +b \right )^{2}}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{\left (a +b \right )^{2}}\) | \(108\) |
risch | \(\frac {x}{a^{2}+2 a b +b^{2}}-\frac {2 x \,a^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}-\frac {2 x \,b^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}-\frac {2 a b}{\left (a -b \right ) \left (a^{2}+2 a b +b^{2}\right ) \left ({\mathrm e}^{2 x} a +b \,{\mathrm e}^{2 x}+a -b \right )}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right ) a^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right ) b^{2}}{a^{4}-2 a^{2} b^{2}+b^{4}}\) | \(182\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 107, normalized size = 1.15 \begin {gather*} \frac {2 \, a b}{a^{4} - 2 \, a^{2} b^{2} + b^{4} + {\left (a^{4} - 2 \, a^{3} b + 2 \, a b^{3} - b^{4}\right )} e^{\left (-2 \, x\right )}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac {x}{a^{2} + 2 \, a b + b^{2}} \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. 376 vs.
\(2 (93) = 186\).
time = 0.39, size = 376, normalized size = 4.04 \begin {gather*} -\frac {{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} x \cosh \left (x\right )^{2} + 2 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} x \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} x \sinh \left (x\right )^{2} + 2 \, a^{2} b - 2 \, a b^{2} + {\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} x - {\left (a^{3} - a^{2} b + a b^{2} - b^{3} + {\left (a^{3} + a^{2} b + a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{3} + a^{2} b + a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{3} + a^{2} b + a b^{2} + b^{3}\right )} \sinh \left (x\right )^{2}\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 )}{a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5} + {\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} + 2 \, {\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 ) + {\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 )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 962 vs.
\(2 (83) = 166\).
time = 0.66, size = 962, normalized size = 10.34 \begin {gather*} \begin {cases} \tilde {\infty } \log {\left (\sinh {\left (x \right )} \right )} & \text {for}\: a = 0 \wedge b = 0 \\- \frac {2 x \sinh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} - 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {4 x \sinh {\left (x \right )} \cosh {\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} - 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} - \frac {2 x \cosh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} - 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {\sinh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} - 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {\cosh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} - 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} & \text {for}\: a = - b \\\frac {2 x \sinh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} + 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {4 x \sinh {\left (x \right )} \cosh {\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} + 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {2 x \cosh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} + 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {\sinh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} + 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} + \frac {\cosh ^{2}{\left (x \right )}}{8 b^{2} \sinh ^{2}{\left (x \right )} + 16 b^{2} \sinh {\left (x \right )} \cosh {\left (x \right )} + 8 b^{2} \cosh ^{2}{\left (x \right )}} & \text {for}\: a = b \\\frac {\log {\left (\sinh {\left (x \right )} \right )}}{b^{2}} & \text {for}\: a = 0 \\\frac {a^{3} \log {\left (\cosh {\left (x \right )} + \frac {b \sinh {\left (x \right )}}{a} \right )} \cosh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} - \frac {a^{3} \cosh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} - \frac {2 a^{2} b x \cosh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} + \frac {a^{2} b \log {\left (\cosh {\left (x \right )} + \frac {b \sinh {\left (x \right )}}{a} \right )} \sinh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} - \frac {2 a b^{2} x \sinh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} + \frac {a b^{2} \log {\left (\cosh {\left (x \right )} + \frac {b \sinh {\left (x \right )}}{a} \right )} \cosh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} + \frac {a b^{2} \cosh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} + \frac {b^{3} \log {\left (\cosh {\left (x \right )} + \frac {b \sinh {\left (x \right )}}{a} \right )} \sinh {\left (x \right )}}{a^{5} \cosh {\left (x \right )} + a^{4} b \sinh {\left (x \right )} - 2 a^{3} b^{2} \cosh {\left (x \right )} - 2 a^{2} b^{3} \sinh {\left (x \right )} + a b^{4} \cosh {\left (x \right )} + b^{5} \sinh {\left (x \right )}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 128, normalized size = 1.38 \begin {gather*} \frac {{\left (a^{2} + b^{2}\right )} \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 {x}{a^{2} - 2 \, a b + b^{2}} - \frac {a^{2} e^{\left (2 \, x\right )} + b^{2} e^{\left (2 \, x\right )} + a^{2} - b^{2}}{{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} {\left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.93, size = 98, normalized size = 1.05 \begin {gather*} \ln \left (a\,\mathrm {cosh}\left (x\right )+b\,\mathrm {sinh}\left (x\right )\right )\,\left (\frac {1}{2\,{\left (a+b\right )}^2}+\frac {1}{2\,{\left (a-b\right )}^2}\right )-\frac {\frac {a\,\mathrm {cosh}\left (x\right )}{a^2-b^2}+\frac {2\,a^2\,b\,x\,\mathrm {cosh}\left (x\right )}{{\left (a^2-b^2\right )}^2}+\frac {2\,a\,b^2\,x\,\mathrm {sinh}\left (x\right )}{{\left (a^2-b^2\right )}^2}}{a\,\mathrm {cosh}\left (x\right )+b\,\mathrm {sinh}\left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________