Optimal. Leaf size=39 \[ \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3177, 3212}
\begin {gather*} \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3177
Rule 3212
Rubi steps
\begin {align*} \int \frac {\cosh (x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac {a x}{a^2-b^2}-\frac {(i b) \int \frac {-i b \cosh (x)-i a \sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=\frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 29, normalized size = 0.74 \begin {gather*} \frac {a x-b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.02, size = 71, normalized size = 1.82
method | result | size |
risch | \(\frac {x}{a +b}+\frac {2 b x}{a^{2}-b^{2}}-\frac {b \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a^{2}-b^{2}}\) | \(55\) |
default | \(-\frac {b \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 ) \left (a +b \right )}+\frac {2 \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 a -2 b}-\frac {2 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 b +2 a}\) | \(71\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 41, normalized size = 1.05 \begin {gather*} -\frac {b \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{2} - b^{2}} + \frac {x}{a + b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 42, normalized size = 1.08 \begin {gather*} \frac {{\left (a + b\right )} x - b \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^{2} - b^{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. 150 vs.
\(2 (29) = 58\).
time = 0.31, size = 150, normalized size = 3.85 \begin {gather*} \begin {cases} \tilde {\infty } \log {\left (\sinh {\left (x \right )} \right )} & \text {for}\: a = 0 \wedge b = 0 \\\frac {\log {\left (\sinh {\left (x \right )} \right )}}{b} & \text {for}\: a = 0 \\\frac {x \sinh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} - \frac {x \cosh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} - \frac {\cosh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} & \text {for}\: a = - b \\\frac {x \sinh {\left (x \right )}}{2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} + \frac {x \cosh {\left (x \right )}}{2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} - \frac {\cosh {\left (x \right )}}{2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} & \text {for}\: a = b \\\frac {a x}{a^{2} - b^{2}} - \frac {b \log {\left (\cosh {\left (x \right )} + \frac {b \sinh {\left (x \right )}}{a} \right )}}{a^{2} - b^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 43, normalized size = 1.10 \begin {gather*} -\frac {b \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{2} - b^{2}} + \frac {x}{a - b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.52, size = 29, normalized size = 0.74 \begin {gather*} \frac {a\,x-b\,\ln \left (a\,\mathrm {cosh}\left (x\right )+b\,\mathrm {sinh}\left (x\right )\right )}{a^2-b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________