Optimal. Leaf size=77 \[ \frac {(2 a A-b C) x}{2 a^2}+\frac {C \cosh (x)}{2 a}+\frac {\left (2 a A b+a^2 C-b^2 C\right ) \log (a+b \cosh (x)-b \sinh (x))}{2 a^2 b}+\frac {C \sinh (x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {3210}
\begin {gather*} \frac {\left (a^2 C+2 a A b-b^2 C\right ) \log (a-b \sinh (x)+b \cosh (x))}{2 a^2 b}+\frac {x (2 a A-b C)}{2 a^2}+\frac {C \sinh (x)}{2 a}+\frac {C \cosh (x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3210
Rubi steps
\begin {align*} \int \frac {A+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx &=\frac {(2 a A-b C) x}{2 a^2}+\frac {C \cosh (x)}{2 a}+\frac {\left (2 a A b+a^2 C-b^2 C\right ) \log (a+b \cosh (x)-b \sinh (x))}{2 a^2 b}+\frac {C \sinh (x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 86, normalized size = 1.12 \begin {gather*} \frac {\left (2 a A-\frac {a^2 C}{b}-b C\right ) x+2 a C \cosh (x)+\frac {2 \left (2 a A b+a^2 C-b^2 C\right ) \log \left ((a+b) \cosh \left (\frac {x}{2}\right )+(a-b) \sinh \left (\frac {x}{2}\right )\right )}{b}+2 a C \sinh (x)}{4 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.11, size = 91, normalized size = 1.18
method | result | size |
risch | \(\frac {C \,{\mathrm e}^{x}}{2 a}-\frac {C x}{2 b}+\frac {\ln \left ({\mathrm e}^{x}+\frac {b}{a}\right ) A}{a}+\frac {\ln \left ({\mathrm e}^{x}+\frac {b}{a}\right ) C}{2 b}-\frac {b \ln \left ({\mathrm e}^{x}+\frac {b}{a}\right ) C}{2 a^{2}}\) | \(62\) |
default | \(-\frac {C \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 b}-\frac {C}{a \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {\left (-2 A a +b C \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 a^{2}}+\frac {\left (2 A a b +a^{2} C -C \,b^{2}\right ) \ln \left (a \tanh \left (\frac {x}{2}\right )-b \tanh \left (\frac {x}{2}\right )+a +b \right )}{2 a^{2} b}\) | \(91\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 65, normalized size = 0.84 \begin {gather*} A {\left (\frac {x}{a} + \frac {\log \left (b e^{\left (-x\right )} + a\right )}{a}\right )} - \frac {1}{2} \, C {\left (\frac {b x}{a^{2}} - \frac {e^{x}}{a} - \frac {{\left (a^{2} - b^{2}\right )} \log \left (b e^{\left (-x\right )} + a\right )}{a^{2} b}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.46, size = 59, normalized size = 0.77 \begin {gather*} -\frac {C a^{2} x - C a b \cosh \left (x\right ) - C a b \sinh \left (x\right ) - {\left (C a^{2} + 2 \, A a b - C b^{2}\right )} \log \left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + b\right )}{2 \, a^{2} b} \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. 852 vs.
\(2 (66) = 132\).
time = 2.84, size = 852, normalized size = 11.06 \begin {gather*} \begin {cases} \tilde {\infty } \left (A x + C \cosh {\left (x \right )}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {2 A x \tanh {\left (\frac {x}{2} \right )}}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} - \frac {2 A x}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} - \frac {2 A \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} + \frac {2 A \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} - \frac {C x \tanh {\left (\frac {x}{2} \right )}}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} + \frac {C x}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} - \frac {2 C}{2 b \tanh {\left (\frac {x}{2} \right )} - 2 b} & \text {for}\: a = b \\\frac {2 A}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} + \frac {C x \sinh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} - \frac {C x \cosh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} + \frac {C \cosh {\left (x \right )}}{- 2 b \sinh {\left (x \right )} + 2 b \cosh {\left (x \right )}} & \text {for}\: a = 0 \\\frac {A x + C \cosh {\left (x \right )}}{a} & \text {for}\: b = 0 \\\frac {2 A a b x \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {2 A a b x}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {2 A a b \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {2 A a b \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {2 A a b \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {2 A a b \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {C a^{2} \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {C a^{2} \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {C a^{2} \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {C a^{2} \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {2 C a b}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {C b^{2} x \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {C b^{2} x}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {C b^{2} \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {C b^{2} \log {\left (\tanh {\left (\frac {x}{2} \right )} + 1 \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} - \frac {C b^{2} \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )} \tanh {\left (\frac {x}{2} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} + \frac {C b^{2} \log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tanh {\left (\frac {x}{2} \right )} \right )}}{2 a^{2} b \tanh {\left (\frac {x}{2} \right )} - 2 a^{2} b} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 49, normalized size = 0.64 \begin {gather*} -\frac {C x}{2 \, b} + \frac {C e^{x}}{2 \, a} + \frac {{\left (C a^{2} + 2 \, A a b - C b^{2}\right )} \log \left ({\left | a e^{x} + b \right |}\right )}{2 \, a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.12, size = 48, normalized size = 0.62 \begin {gather*} \frac {C\,{\mathrm {e}}^x}{2\,a}-\frac {C\,x}{2\,b}+\frac {\ln \left (b+a\,{\mathrm {e}}^x\right )\,\left (C\,a^2+2\,A\,a\,b-C\,b^2\right )}{2\,a^2\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________