Optimal. Leaf size=86 \[ \frac {(2 a A-b (B-C)) x}{2 a^2}-\frac {\left (2 a A b-b^2 (B-C)-a^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 = 86, normalized size of antiderivative = 1.00, number of steps
used = 1, number of rules used = 1, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, 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) (\cosh (x)-\sinh (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-b^2 (B-C)-a^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.21, size = 103, normalized size = 1.20 \begin {gather*} \frac {\left (2 a A+b (-B+C)+\frac {a^2 (B+C)}{b}\right ) x-2 a (B-C) \cosh (x)+\frac {2 \left (-2 a A b+b^2 (B-C)+a^2 (B+C)\right ) \log \left ((a+b) \cosh \left (\frac {x}{2}\right )+(-a+b) \sinh \left (\frac {x}{2}\right )\right )}{b}+2 a (B-C) \sinh (x)}{4 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.06, size = 121, normalized size = 1.41
method | result | size |
default | \(\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}}-\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}\) | \(121\) |
risch | \(-\frac {B \,{\mathrm e}^{-x}}{2 a}+\frac {C \,{\mathrm e}^{-x}}{2 a}+\frac {x A}{a}-\frac {b x B}{2 a^{2}}+\frac {b x C}{2 a^{2}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a}{b}\right ) A}{a}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a}{b}\right ) B}{2 b}+\frac {b \ln \left ({\mathrm e}^{x}+\frac {a}{b}\right ) B}{2 a^{2}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a}{b}\right ) C}{2 b}-\frac {b \ln \left ({\mathrm e}^{x}+\frac {a}{b}\right ) C}{2 a^{2}}\) | \(121\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 99, normalized size = 1.15 \begin {gather*} \frac {1}{2} \, C {\left (\frac {x}{b} + \frac {e^{\left (-x\right )}}{a} + \frac {{\left (a^{2} - b^{2}\right )} \log \left (a e^{\left (-x\right )} + b\right )}{a^{2} b}\right )} + \frac {1}{2} \, B {\left (\frac {x}{b} - \frac {e^{\left (-x\right )}}{a} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (a e^{\left (-x\right )} + b\right )}{a^{2} b}\right )} - \frac {A \log \left (a e^{\left (-x\right )} + b\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 134, normalized size = 1.56 \begin {gather*} -\frac {{\left (B - C\right )} a b - {\left (2 \, A a b - {\left (B - C\right )} b^{2}\right )} x \cosh \left (x\right ) - {\left (2 \, A a b - {\left (B - C\right )} b^{2}\right )} x \sinh \left (x\right ) - {\left ({\left ({\left (B + C\right )} a^{2} - 2 \, A a b + {\left (B - C\right )} b^{2}\right )} \cosh \left (x\right ) + {\left ({\left (B + C\right )} a^{2} - 2 \, A a b + {\left (B - C\right )} b^{2}\right )} \sinh \left (x\right )\right )} \log \left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}{2 \, {\left (a^{2} b \cosh \left (x\right ) + a^{2} b \sinh \left (x\right )\right )}} \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. 1321 vs.
\(2 (70) = 140\).
time = 2.93, size = 1321, normalized size = 15.36 \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.41, size = 79, normalized size = 0.92 \begin {gather*} \frac {{\left (2 \, A a - B b + C b\right )} x}{2 \, a^{2}} - \frac {{\left (B a - C a\right )} e^{\left (-x\right )}}{2 \, a^{2}} + \frac {{\left (B a^{2} + C a^{2} - 2 \, A a b + B b^{2} - C b^{2}\right )} \log \left ({\left | b e^{x} + a \right |}\right )}{2 \, a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.72, size = 75, normalized size = 0.87 \begin {gather*} \frac {x\,\left (2\,A\,a-B\,b+C\,b\right )}{2\,a^2}-\frac {{\mathrm {e}}^{-x}\,\left (B-C\right )}{2\,a}+\frac {\ln \left (a+b\,{\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]
________________________________________________________________________________________