### 3.807 $$\int \frac{A+B \cosh (x)+C \sinh (x)}{a+b \cosh (x)-b \sinh (x)} \, dx$$

Optimal. Leaf size=81 $\frac{\left (a^2 (-(B-C))+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}$

[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)

________________________________________________________________________________________

Rubi [A]  time = 0.0802853, antiderivative size = 81, normalized size of antiderivative = 1., 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 = {3130} $\frac{\left (a^2 (-(B-C))+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}$

Antiderivative was successfully veriﬁed.

[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 3130

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*} \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.281354, size = 102, normalized size = 1.26 $\frac{x \left (a^2 (B-C)+2 a A b-b^2 (B+C)\right )-2 \left (a^2 (B-C)-2 a A b+b^2 (B+C)\right ) \log \left ((a-b) \sinh \left (\frac{x}{2}\right )+(a+b) \cosh \left (\frac{x}{2}\right )\right )+2 a b (B+C) \sinh (x)+2 a b (B+C) \cosh (x)}{4 a^2 b}$

Antiderivative was successfully veriﬁed.

[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 [B]  time = 0.05, size = 213, normalized size = 2.6 \begin{align*}{\frac{B}{2\,b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{C}{2\,b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{B}{a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}-{\frac{C}{a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}-{\frac{A}{a}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+{\frac{Bb}{2\,{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+{\frac{bC}{2\,{a}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }+{\frac{A}{a}\ln \left ( a\tanh \left ({\frac{x}{2}} \right ) -\tanh \left ({\frac{x}{2}} \right ) b+a+b \right ) }-{\frac{B}{2\,b}\ln \left ( a\tanh \left ({\frac{x}{2}} \right ) -\tanh \left ({\frac{x}{2}} \right ) b+a+b \right ) }-{\frac{Bb}{2\,{a}^{2}}\ln \left ( a\tanh \left ({\frac{x}{2}} \right ) -\tanh \left ({\frac{x}{2}} \right ) b+a+b \right ) }+{\frac{C}{2\,b}\ln \left ( a\tanh \left ({\frac{x}{2}} \right ) -\tanh \left ({\frac{x}{2}} \right ) b+a+b \right ) }-{\frac{bC}{2\,{a}^{2}}\ln \left ( a\tanh \left ({\frac{x}{2}} \right ) -\tanh \left ({\frac{x}{2}} \right ) b+a+b \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x)

[Out]

1/2*B/b*ln(tanh(1/2*x)+1)-1/2*C/b*ln(tanh(1/2*x)+1)-B/a/(tanh(1/2*x)-1)-C/a/(tanh(1/2*x)-1)-1/a*ln(tanh(1/2*x)
-1)*A+1/2/a^2*ln(tanh(1/2*x)-1)*B*b+1/2/a^2*ln(tanh(1/2*x)-1)*b*C+1/a*ln(a*tanh(1/2*x)-tanh(1/2*x)*b+a+b)*A-1/
2/b*ln(a*tanh(1/2*x)-tanh(1/2*x)*b+a+b)*B-1/2/a^2*b*ln(a*tanh(1/2*x)-tanh(1/2*x)*b+a+b)*B+1/2/b*ln(a*tanh(1/2*
x)-tanh(1/2*x)*b+a+b)*C-1/2/a^2*b*ln(a*tanh(1/2*x)-tanh(1/2*x)*b+a+b)*C

________________________________________________________________________________________

Maxima [A]  time = 1.18393, size = 142, normalized size = 1.75 \begin{align*} 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{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[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))

________________________________________________________________________________________

Fricas [A]  time = 2.45155, size = 194, normalized size = 2.4 \begin{align*} \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{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[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 [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cosh(x)+C*sinh(x))/(a+b*cosh(x)-b*sinh(x)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.18218, size = 93, normalized size = 1.15 \begin{align*} \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{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[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)