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

Optimal. Leaf size=77 $-\frac{\left (a^2 (-B)+2 a A b-b^2 B\right ) \log (a+b \sinh (x)+b \cosh (x))}{2 a^2 b}+\frac{x (2 a A-b B)}{2 a^2}+\frac{B \sinh (x)}{2 a}-\frac{B \cosh (x)}{2 a}$

[Out]

((2*a*A - b*B)*x)/(2*a^2) - (B*Cosh[x])/(2*a) - ((2*a*A*b - a^2*B - b^2*B)*Log[a + b*Cosh[x] + b*Sinh[x]])/(2*
a^2*b) + (B*Sinh[x])/(2*a)

________________________________________________________________________________________

Rubi [A]  time = 0.049617, antiderivative size = 77, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 19, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.053, Rules used = {3132} $-\frac{\left (a^2 (-B)+2 a A b-b^2 B\right ) \log (a+b \sinh (x)+b \cosh (x))}{2 a^2 b}+\frac{x (2 a A-b B)}{2 a^2}+\frac{B \sinh (x)}{2 a}-\frac{B \cosh (x)}{2 a}$

Antiderivative was successfully veriﬁed.

[In]

Int[(A + B*Cosh[x])/(a + b*Cosh[x] + b*Sinh[x]),x]

[Out]

((2*a*A - b*B)*x)/(2*a^2) - (B*Cosh[x])/(2*a) - ((2*a*A*b - a^2*B - b^2*B)*Log[a + b*Cosh[x] + b*Sinh[x]])/(2*
a^2*b) + (B*Sinh[x])/(2*a)

Rule 3132

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.))/(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x
_)]), x_Symbol] :> Simp[((2*a*A - b*B)*x)/(2*a^2), x] + (Simp[(B*Sin[d + e*x])/(2*a*e), x] - Simp[(b*B*Cos[d +
e*x])/(2*a*c*e), x] + Simp[((a^2*B - 2*a*b*A + b^2*B)*Log[RemoveContent[a + b*Cos[d + e*x] + c*Sin[d + e*x],
x]])/(2*a^2*c*e), x]) /; FreeQ[{a, b, c, d, e, A, B}, x] && EqQ[b^2 + c^2, 0]

Rubi steps

\begin{align*} \int \frac{A+B \cosh (x)}{a+b \cosh (x)+b \sinh (x)} \, dx &=\frac{(2 a A-b B) x}{2 a^2}-\frac{B \cosh (x)}{2 a}-\frac{\left (2 a A b-a^2 B-b^2 B\right ) \log (a+b \cosh (x)+b \sinh (x))}{2 a^2 b}+\frac{B \sinh (x)}{2 a}\\ \end{align*}

Mathematica [A]  time = 0.168832, size = 84, normalized size = 1.09 $\frac{\frac{2 \left (a^2 B-2 a A b+b^2 B\right ) \log \left ((b-a) \sinh \left (\frac{x}{2}\right )+(a+b) \cosh \left (\frac{x}{2}\right )\right )}{b}+x \left (\frac{a^2 B}{b}+2 a A-b B\right )+2 a B \sinh (x)-2 a B \cosh (x)}{4 a^2}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(A + B*Cosh[x])/(a + b*Cosh[x] + b*Sinh[x]),x]

[Out]

((2*a*A + (a^2*B)/b - b*B)*x - 2*a*B*Cosh[x] + (2*(-2*a*A*b + a^2*B + b^2*B)*Log[(a + b)*Cosh[x/2] + (-a + b)*
Sinh[x/2]])/b + 2*a*B*Sinh[x])/(4*a^2)

________________________________________________________________________________________

Maple [A]  time = 0.052, size = 137, normalized size = 1.8 \begin{align*} -{\frac{B}{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{B}{2\,b}\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 ) } \end{align*}

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

[In]

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

[Out]

-B/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*B/b*ln(tanh(1/2*x)-1)-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

________________________________________________________________________________________

Maxima [A]  time = 1.13735, size = 77, normalized size = 1. \begin{align*} \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{align*}

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

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x)+b*sinh(x)),x, algorithm="maxima")

[Out]

1/2*B*(x/b - e^(-x)/a + (a^2 + b^2)*log(a*e^(-x) + b)/(a^2*b)) - A*log(a*e^(-x) + b)/a

________________________________________________________________________________________

Fricas [A]  time = 2.25281, size = 285, normalized size = 3.7 \begin{align*} -\frac{B a b -{\left (2 \, A a b - B b^{2}\right )} x \cosh \left (x\right ) -{\left (2 \, A a b - B b^{2}\right )} x \sinh \left (x\right ) -{\left ({\left (B a^{2} - 2 \, A a b + B b^{2}\right )} \cosh \left (x\right ) +{\left (B a^{2} - 2 \, A a b + B 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{align*}

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

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x)+b*sinh(x)),x, algorithm="fricas")

[Out]

-1/2*(B*a*b - (2*A*a*b - B*b^2)*x*cosh(x) - (2*A*a*b - B*b^2)*x*sinh(x) - ((B*a^2 - 2*A*a*b + B*b^2)*cosh(x) +
(B*a^2 - 2*A*a*b + B*b^2)*sinh(x))*log(b*cosh(x) + b*sinh(x) + a))/(a^2*b*cosh(x) + a^2*b*sinh(x))

________________________________________________________________________________________

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))/(a+b*cosh(x)+b*sinh(x)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.13103, size = 78, normalized size = 1.01 \begin{align*} -\frac{B e^{\left (-x\right )}}{2 \, a} + \frac{{\left (2 \, A a - B b\right )} x}{2 \, a^{2}} + \frac{{\left (B a^{2} - 2 \, A a b + B b^{2}\right )} \log \left ({\left | b e^{x} + a \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))/(a+b*cosh(x)+b*sinh(x)),x, algorithm="giac")

[Out]

-1/2*B*e^(-x)/a + 1/2*(2*A*a - B*b)*x/a^2 + 1/2*(B*a^2 - 2*A*a*b + B*b^2)*log(abs(b*e^x + a))/(a^2*b)