Optimal. Leaf size=81 \[ \frac {(2 a A-b (B+C)) x}{2 a^2}+\frac {\left (2 a A b-a^2 (B-C)-b^2 (B+C)\right ) \log (a+b \cosh (x)-b \sinh (x))}{2 a^2 b}+\frac {(B+C) (\cosh (x)+\sinh (x))}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {3209}
\begin {gather*} \frac {\left (-\left (a^2 (B-C)\right )+2 a A b-b^2 (B+C)\right ) \log (a-b \sinh (x)+b \cosh (x))}{2 a^2 b}+\frac {x (2 a A-b (B+C))}{2 a^2}+\frac {(B+C) (\sinh (x)+\cosh (x))}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3209
Rubi steps
\begin {align*} \int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx &=\frac {(2 a A-b (B+C)) x}{2 a^2}+\frac {\left (2 a A b-a^2 (B-C)-b^2 (B+C)\right ) \log (a+b \cosh (x)-b \sinh (x))}{2 a^2 b}+\frac {(B+C) (\cosh (x)+\sinh (x))}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 102, normalized size = 1.26 \begin {gather*} \frac {\left (2 a A b+a^2 (B-C)-b^2 (B+C)\right ) x+2 a b (B+C) \cosh (x)-2 \left (-2 a A b+a^2 (B-C)+b^2 (B+C)\right ) \log \left ((a+b) \cosh \left (\frac {x}{2}\right )+(a-b) \sinh \left (\frac {x}{2}\right )\right )+2 a b (B+C) \sinh (x)}{4 a^2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.11, size = 112, normalized size = 1.38
method | result | size |
risch | \(\frac {B \,{\mathrm e}^{x}}{2 a}+\frac {C \,{\mathrm e}^{x}}{2 a}+\frac {B x}{2 b}-\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 ) B}{2 b}-\frac {b \ln \left ({\mathrm e}^{x}+\frac {b}{a}\right ) B}{2 a^{2}}+\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}}\) | \(108\) |
default | \(\frac {\left (2 A a b -B \,a^{2}-B \,b^{2}+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}+\frac {\left (B -C \right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 b}-\frac {B +C}{a \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {\left (-2 A a +B b +b C \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 a^{2}}\) | \(112\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 105, normalized size = 1.30 \begin {gather*} A {\left (\frac {x}{a} + \frac {\log \left (b e^{\left (-x\right )} + a\right )}{a}\right )} - \frac {1}{2} \, B {\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 )} - \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.36, size = 70, normalized size = 0.86 \begin {gather*} \frac {{\left (B - C\right )} a^{2} x + {\left (B + C\right )} a b \cosh \left (x\right ) + {\left (B + C\right )} a b \sinh \left (x\right ) - {\left ({\left (B - C\right )} a^{2} - 2 \, A a b + {\left (B + C\right )} 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. 1420 vs.
\(2 (70) = 140\).
time = 3.29, size = 1420, normalized size = 17.53 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 69, normalized size = 0.85 \begin {gather*} \frac {{\left (B - C\right )} x}{2 \, b} + \frac {B e^{x} + C e^{x}}{2 \, a} - \frac {{\left (B a^{2} - C a^{2} - 2 \, A a b + B b^{2} + 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 = 1.63, size = 64, normalized size = 0.79 \begin {gather*} \frac {x\,\left (B-C\right )}{2\,b}+\frac {{\mathrm {e}}^x\,\left (B+C\right )}{2\,a}-\frac {\ln \left (b+a\,{\mathrm {e}}^x\right )\,\left (B\,a^2+B\,b^2-C\,a^2+C\,b^2-2\,A\,a\,b\right )}{2\,a^2\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________