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

Optimal. Leaf size=39 $\frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0617367, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 14, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.143, Rules used = {3098, 3133} $\frac{a x}{a^2-b^2}-\frac{b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3098

Int[cos[(c_.) + (d_.)*(x_)]/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp
[(a*x)/(a^2 + b^2), x] + Dist[b/(a^2 + b^2), Int[(b*Cos[c + d*x] - a*Sin[c + d*x])/(a*Cos[c + d*x] + b*Sin[c +
d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3133

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

Rubi steps

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

Mathematica [A]  time = 0.0416025, size = 29, normalized size = 0.74 $\frac{a x-b \log (a \cosh (x)+b \sinh (x))}{a^2-b^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.038, size = 71, normalized size = 1.8 \begin{align*} 2\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) }{2\,a-2\,b}}-{\frac{b}{ \left ( a+b \right ) \left ( a-b \right ) }\ln \left ( a+2\,\tanh \left ( x/2 \right ) b+a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) }-2\,{\frac{\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) }{2\,b+2\,a}} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.15067, size = 55, normalized size = 1.41 \begin{align*} -\frac{b \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{2} - b^{2}} + \frac{x}{a + b} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.83174, size = 108, normalized size = 2.77 \begin{align*} \frac{{\left (a + b\right )} x - b \log \left (\frac{2 \,{\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} - b^{2}} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.716007, size = 146, normalized size = 3.74 \begin{align*} \begin{cases} \tilde{\infty } \log{\left (\sinh{\left (x \right )} \right )} & \text{for}\: a = 0 \wedge b = 0 \\\frac{x}{a} & \text{for}\: b = 0 \\\frac{x \sinh{\left (x \right )}}{- 2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} - \frac{x \cosh{\left (x \right )}}{- 2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} - \frac{\cosh{\left (x \right )}}{- 2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} & \text{for}\: a = - b \\\frac{x \sinh{\left (x \right )}}{2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} + \frac{x \cosh{\left (x \right )}}{2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} - \frac{\cosh{\left (x \right )}}{2 b \sinh{\left (x \right )} + 2 b \cosh{\left (x \right )}} & \text{for}\: a = b \\\frac{a x}{a^{2} - b^{2}} - \frac{b \log{\left (\frac{a \cosh{\left (x \right )}}{b} + \sinh{\left (x \right )} \right )}}{a^{2} - b^{2}} & \text{otherwise} \end{cases} \end{align*}

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

[In]

integrate(cosh(x)/(a*cosh(x)+b*sinh(x)),x)

[Out]

Piecewise((zoo*log(sinh(x)), Eq(a, 0) & Eq(b, 0)), (x/a, Eq(b, 0)), (x*sinh(x)/(-2*b*sinh(x) + 2*b*cosh(x)) -
x*cosh(x)/(-2*b*sinh(x) + 2*b*cosh(x)) - cosh(x)/(-2*b*sinh(x) + 2*b*cosh(x)), Eq(a, -b)), (x*sinh(x)/(2*b*sin
h(x) + 2*b*cosh(x)) + x*cosh(x)/(2*b*sinh(x) + 2*b*cosh(x)) - cosh(x)/(2*b*sinh(x) + 2*b*cosh(x)), Eq(a, b)),
(a*x/(a**2 - b**2) - b*log(a*cosh(x)/b + sinh(x))/(a**2 - b**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.14327, size = 58, normalized size = 1.49 \begin{align*} -\frac{b \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{2} - b^{2}} + \frac{x}{a - b} \end{align*}

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

[In]

integrate(cosh(x)/(a*cosh(x)+b*sinh(x)),x, algorithm="giac")

[Out]

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