### 3.733 $$\int \frac{B \cosh (x)+C \sinh (x)}{b \cosh (x)+c \sinh (x)} \, dx$$

Optimal. Leaf size=53 $\frac{x (b B-c C)}{b^2-c^2}-\frac{(B c-b C) \log (b \cosh (x)+c \sinh (x))}{b^2-c^2}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0464645, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 21, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.048, Rules used = {3133} $\frac{x (b B-c C)}{b^2-c^2}-\frac{(B c-b C) \log (b \cosh (x)+c \sinh (x))}{b^2-c^2}$

Antiderivative was successfully veriﬁed.

[In]

Int[(B*Cosh[x] + C*Sinh[x])/(b*Cosh[x] + c*Sinh[x]),x]

[Out]

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

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{B \cosh (x)+C \sinh (x)}{b \cosh (x)+c \sinh (x)} \, dx &=\frac{(b B-c C) x}{b^2-c^2}-\frac{(B c-b C) \log (b \cosh (x)+c \sinh (x))}{b^2-c^2}\\ \end{align*}

Mathematica [A]  time = 0.114514, size = 43, normalized size = 0.81 $\frac{x (b B-c C)+(b C-B c) \log (b \cosh (x)+c \sinh (x))}{(b-c) (b+c)}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(B*Cosh[x] + C*Sinh[x])/(b*Cosh[x] + c*Sinh[x]),x]

[Out]

((b*B - c*C)*x + (-(B*c) + b*C)*Log[b*Cosh[x] + c*Sinh[x]])/((b - c)*(b + c))

________________________________________________________________________________________

Maple [B]  time = 0.057, size = 145, normalized size = 2.7 \begin{align*} 2\,{\frac{B\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) }{2\,b-2\,c}}-2\,{\frac{C\ln \left ( \tanh \left ( x/2 \right ) +1 \right ) }{2\,b-2\,c}}-{\frac{Bc}{ \left ( b-c \right ) \left ( b+c \right ) }\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b+2\,c\tanh \left ( x/2 \right ) +b \right ) }+{\frac{bC}{ \left ( b-c \right ) \left ( b+c \right ) }\ln \left ( \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b+2\,c\tanh \left ( x/2 \right ) +b \right ) }-2\,{\frac{B\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) }{2\,b+2\,c}}-2\,{\frac{C\ln \left ( \tanh \left ( x/2 \right ) -1 \right ) }{2\,b+2\,c}} \end{align*}

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

[In]

int((B*cosh(x)+C*sinh(x))/(b*cosh(x)+c*sinh(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.11514, size = 117, normalized size = 2.21 \begin{align*} C{\left (\frac{b \log \left (-{\left (b - c\right )} e^{\left (-2 \, x\right )} - b - c\right )}{b^{2} - c^{2}} + \frac{x}{b + c}\right )} - B{\left (\frac{c \log \left (-{\left (b - c\right )} e^{\left (-2 \, x\right )} - b - c\right )}{b^{2} - c^{2}} - \frac{x}{b + c}\right )} \end{align*}

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

[In]

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

[Out]

C*(b*log(-(b - c)*e^(-2*x) - b - c)/(b^2 - c^2) + x/(b + c)) - B*(c*log(-(b - c)*e^(-2*x) - b - c)/(b^2 - c^2)
- x/(b + c))

________________________________________________________________________________________

Fricas [A]  time = 2.24471, size = 143, normalized size = 2.7 \begin{align*} \frac{{\left ({\left (B - C\right )} b +{\left (B - C\right )} c\right )} x +{\left (C b - B c\right )} \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) + c \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{b^{2} - c^{2}} \end{align*}

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

[In]

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

[Out]

(((B - C)*b + (B - C)*c)*x + (C*b - B*c)*log(2*(b*cosh(x) + c*sinh(x))/(cosh(x) - sinh(x))))/(b^2 - c^2)

________________________________________________________________________________________

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

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

[In]

integrate((B*cosh(x)+C*sinh(x))/(b*cosh(x)+c*sinh(x)),x)

[Out]

Piecewise((zoo*(B*log(sinh(x)) + C*x), Eq(b, 0) & Eq(c, 0)), ((B*x + C*log(cosh(x)))/b, Eq(c, 0)), (B*x*sinh(x
)/(-2*c*sinh(x) + 2*c*cosh(x)) - B*x*cosh(x)/(-2*c*sinh(x) + 2*c*cosh(x)) - B*cosh(x)/(-2*c*sinh(x) + 2*c*cosh
(x)) - C*x*sinh(x)/(-2*c*sinh(x) + 2*c*cosh(x)) + C*x*cosh(x)/(-2*c*sinh(x) + 2*c*cosh(x)) - C*cosh(x)/(-2*c*s
inh(x) + 2*c*cosh(x)), Eq(b, -c)), (B*x*sinh(x)/(2*c*sinh(x) + 2*c*cosh(x)) + B*x*cosh(x)/(2*c*sinh(x) + 2*c*c
osh(x)) - B*cosh(x)/(2*c*sinh(x) + 2*c*cosh(x)) + C*x*sinh(x)/(2*c*sinh(x) + 2*c*cosh(x)) + C*x*cosh(x)/(2*c*s
inh(x) + 2*c*cosh(x)) + C*cosh(x)/(2*c*sinh(x) + 2*c*cosh(x)), Eq(b, c)), (B*b*x/(b**2 - c**2) - B*c*log(b*cos
h(x)/c + sinh(x))/(b**2 - c**2) + C*b*log(b*cosh(x)/c + sinh(x))/(b**2 - c**2) - C*c*x/(b**2 - c**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.13779, size = 73, normalized size = 1.38 \begin{align*} \frac{{\left (B - C\right )} x}{b - c} + \frac{{\left (C b - B c\right )} \log \left ({\left | b e^{\left (2 \, x\right )} + c e^{\left (2 \, x\right )} + b - c \right |}\right )}{b^{2} - c^{2}} \end{align*}

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

[In]

integrate((B*cosh(x)+C*sinh(x))/(b*cosh(x)+c*sinh(x)),x, algorithm="giac")

[Out]

(B - C)*x/(b - c) + (C*b - B*c)*log(abs(b*e^(2*x) + c*e^(2*x) + b - c))/(b^2 - c^2)