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.0617367, antiderivative size = 39, normalized size of antiderivative = 1., 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 = {3098, 3133} \[ \frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3098
Rule 3133
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.0416025, size = 29, normalized size = 0.74 \[ \frac{a x-b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 71, normalized size = 1.8 \begin{align*} 2\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) }{2\,a-2\,b}}-{\frac{b}{ \left ( a+b \right ) \left ( a-b \right ) }\ln \left ( a+2\,\tanh \left ( x/2 \right ) b+a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) }-2\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) }{2\,b+2\,a}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.15067, size = 55, normalized size = 1.41 \begin{align*} -\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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.83174, size = 108, normalized size = 2.77 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.716007, size = 146, normalized size = 3.74 \begin{align*} \begin{cases} \tilde{\infty } \log{\left (\sinh{\left (x \right )} \right )} & \text{for}\: a = 0 \wedge b = 0 \\\frac{x}{a} & \text{for}\: b = 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 (\frac{a \cosh{\left (x \right )}}{b} + \sinh{\left (x \right )} \right )}}{a^{2} - b^{2}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14327, size = 58, normalized size = 1.49 \begin{align*} -\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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]