\(\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx\) [807]
Optimal result
Integrand size = 24, antiderivative size = 81 \[
\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}
\]
[Out]
1/2*(2*A*a-b*(B+C))*x/a^2+1/2*(2*A*a*b-a^2*(B-C)-b^2*(B+C))*ln(a+b*cosh(x)-b*sinh(x))/a^2/b+1/2*(B+C)*(cosh(x)
+sinh(x))/a
Rubi [A] (verified)
Time = 0.05 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.00,
number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.042, Rules used = {3209}
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\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}
\]
[In]
Int[(A + B*Cosh[x] + C*Sinh[x])/(a + b*Cosh[x] - b*Sinh[x]),x]
[Out]
((2*a*A - b*(B + C))*x)/(2*a^2) + ((2*a*A*b - a^2*(B - C) - b^2*(B + C))*Log[a + b*Cosh[x] - b*Sinh[x]])/(2*a^
2*b) + ((B + C)*(Cosh[x] + Sinh[x]))/(2*a)
Rule 3209
Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/(cos[(d_.) + (e_.)*(x_)]*(b_.) + (
a_) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[(2*a*A - b*B - c*C)*(x/(2*a^2)), x] + (-Simp[(b*B + c*
C)*((b*Cos[d + e*x] - c*Sin[d + e*x])/(2*a*b*c*e)), x] + Simp[(a^2*(b*B - c*C) - 2*a*A*b^2 + b^2*(b*B + c*C))*
(Log[RemoveContent[a + b*Cos[d + e*x] + c*Sin[d + e*x], x]]/(2*a^2*b*c*e)), x]) /; FreeQ[{a, b, c, d, e, A, B,
C}, x] && EqQ[b^2 + c^2, 0]
Rubi steps \begin{align*}
\text {integral}& = \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] (verified)
Time = 0.37 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.26
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\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}
\]
[In]
Integrate[(A + B*Cosh[x] + C*Sinh[x])/(a + b*Cosh[x] - b*Sinh[x]),x]
[Out]
((2*a*A*b + a^2*(B - C) - b^2*(B + C))*x + 2*a*b*(B + C)*Cosh[x] - 2*(-2*a*A*b + a^2*(B - C) + b^2*(B + C))*Lo
g[(a + b)*Cosh[x/2] + (a - b)*Sinh[x/2]] + 2*a*b*(B + C)*Sinh[x])/(4*a^2*b)
Maple [A] (verified)
Time = 0.24 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.33
| | |
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 {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}+C \,a^{2}-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 (1+\tanh \left (\frac {x}{2}\right )\right )}{2 b}\) |
\(112\) |
| | |
|
|
|
[In]
int((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x,method=_RETURNVERBOSE)
[Out]
1/2*B/a*exp(x)+1/2*C/a*exp(x)+1/2*B*x/b-1/2*C*x/b+1/a*ln(exp(x)+1/a*b)*A-1/2/b*ln(exp(x)+1/a*b)*B-1/2/a^2*b*ln
(exp(x)+1/a*b)*B+1/2/b*ln(exp(x)+1/a*b)*C-1/2/a^2*b*ln(exp(x)+1/a*b)*C
Fricas [A] (verification not implemented)
none
Time = 0.26 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.86
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\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}
\]
[In]
integrate((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x, algorithm="fricas")
[Out]
1/2*((B - C)*a^2*x + (B + C)*a*b*cosh(x) + (B + C)*a*b*sinh(x) - ((B - C)*a^2 - 2*A*a*b + (B + C)*b^2)*log(a*c
osh(x) + a*sinh(x) + b))/(a^2*b)
Sympy [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 1420 vs. \(2 (70) = 140\).
Time = 2.72 (sec) , antiderivative size = 1420, normalized size of antiderivative = 17.53
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\text {Too large to display}
\]
[In]
integrate((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x)
[Out]
Piecewise((zoo*(A*x + B*sinh(x) + C*cosh(x)), Eq(a, 0) & Eq(b, 0)), (2*A*x*tanh(x/2)/(2*b*tanh(x/2) - 2*b) - 2
*A*x/(2*b*tanh(x/2) - 2*b) - 2*A*log(tanh(x/2) + 1)*tanh(x/2)/(2*b*tanh(x/2) - 2*b) + 2*A*log(tanh(x/2) + 1)/(
2*b*tanh(x/2) - 2*b) - B*x*tanh(x/2)/(2*b*tanh(x/2) - 2*b) + B*x/(2*b*tanh(x/2) - 2*b) + 2*B*log(tanh(x/2) + 1
)*tanh(x/2)/(2*b*tanh(x/2) - 2*b) - 2*B*log(tanh(x/2) + 1)/(2*b*tanh(x/2) - 2*b) - 2*B/(2*b*tanh(x/2) - 2*b) -
C*x*tanh(x/2)/(2*b*tanh(x/2) - 2*b) + C*x/(2*b*tanh(x/2) - 2*b) - 2*C/(2*b*tanh(x/2) - 2*b), Eq(a, b)), (2*A/
(-2*b*sinh(x) + 2*b*cosh(x)) - B*x*sinh(x)/(-2*b*sinh(x) + 2*b*cosh(x)) + B*x*cosh(x)/(-2*b*sinh(x) + 2*b*cosh
(x)) + B*cosh(x)/(-2*b*sinh(x) + 2*b*cosh(x)) + C*x*sinh(x)/(-2*b*sinh(x) + 2*b*cosh(x)) - C*x*cosh(x)/(-2*b*s
inh(x) + 2*b*cosh(x)) + C*cosh(x)/(-2*b*sinh(x) + 2*b*cosh(x)), Eq(a, 0)), ((A*x + B*sinh(x) + C*cosh(x))/a, E
q(b, 0)), (2*A*a*b*x*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - 2*A*a*b*x/(2*a**2*b*tanh(x/2) - 2*a**2*b) - 2
*A*a*b*log(tanh(x/2) + 1)*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + 2*A*a*b*log(tanh(x/2) + 1)/(2*a**2*b*tan
h(x/2) - 2*a**2*b) + 2*A*a*b*log(a/(a - b) + b/(a - b) + tanh(x/2))*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b)
- 2*A*a*b*log(a/(a - b) + b/(a - b) + tanh(x/2))/(2*a**2*b*tanh(x/2) - 2*a**2*b) + B*a**2*log(tanh(x/2) + 1)*t
anh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - B*a**2*log(tanh(x/2) + 1)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - B*a**2*
log(a/(a - b) + b/(a - b) + tanh(x/2))*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + B*a**2*log(a/(a - b) + b/(a
- b) + tanh(x/2))/(2*a**2*b*tanh(x/2) - 2*a**2*b) - 2*B*a*b/(2*a**2*b*tanh(x/2) - 2*a**2*b) - B*b**2*x*tanh(x
/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + B*b**2*x/(2*a**2*b*tanh(x/2) - 2*a**2*b) + B*b**2*log(tanh(x/2) + 1)*tan
h(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - B*b**2*log(tanh(x/2) + 1)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - B*b**2*lo
g(a/(a - b) + b/(a - b) + tanh(x/2))*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + B*b**2*log(a/(a - b) + b/(a -
b) + tanh(x/2))/(2*a**2*b*tanh(x/2) - 2*a**2*b) - C*a**2*log(tanh(x/2) + 1)*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2
*a**2*b) + C*a**2*log(tanh(x/2) + 1)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + C*a**2*log(a/(a - b) + b/(a - b) + tanh
(x/2))*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - C*a**2*log(a/(a - b) + b/(a - b) + tanh(x/2))/(2*a**2*b*tan
h(x/2) - 2*a**2*b) - 2*C*a*b/(2*a**2*b*tanh(x/2) - 2*a**2*b) - C*b**2*x*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2
*b) + C*b**2*x/(2*a**2*b*tanh(x/2) - 2*a**2*b) + C*b**2*log(tanh(x/2) + 1)*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a
**2*b) - C*b**2*log(tanh(x/2) + 1)/(2*a**2*b*tanh(x/2) - 2*a**2*b) - C*b**2*log(a/(a - b) + b/(a - b) + tanh(x
/2))*tanh(x/2)/(2*a**2*b*tanh(x/2) - 2*a**2*b) + C*b**2*log(a/(a - b) + b/(a - b) + tanh(x/2))/(2*a**2*b*tanh(
x/2) - 2*a**2*b), True))
Maxima [A] (verification not implemented)
none
Time = 0.21 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.30
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=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 )}
\]
[In]
integrate((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x, algorithm="maxima")
[Out]
A*(x/a + log(b*e^(-x) + a)/a) - 1/2*B*(b*x/a^2 - e^x/a + (a^2 + b^2)*log(b*e^(-x) + a)/(a^2*b)) - 1/2*C*(b*x/a
^2 - e^x/a - (a^2 - b^2)*log(b*e^(-x) + a)/(a^2*b))
Giac [A] (verification not implemented)
none
Time = 0.28 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.85
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\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}
\]
[In]
integrate((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x, algorithm="giac")
[Out]
1/2*(B - C)*x/b + 1/2*(B*e^x + C*e^x)/a - 1/2*(B*a^2 - C*a^2 - 2*A*a*b + B*b^2 + C*b^2)*log(abs(a*e^x + b))/(a
^2*b)
Mupad [B] (verification not implemented)
Time = 2.36 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.79
\[
\int \frac {A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx=\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}
\]
[In]
int((A + B*cosh(x) + C*sinh(x))/(a + b*cosh(x) - b*sinh(x)),x)
[Out]
(x*(B - C))/(2*b) + (exp(x)*(B + C))/(2*a) - (log(b + a*exp(x))*(B*a^2 + B*b^2 - C*a^2 + C*b^2 - 2*A*a*b))/(2*
a^2*b)