3.8.33 \(\int \frac {B \cosh (x)+C \sinh (x)}{b \cosh (x)+c \sinh (x)} \, dx\) [733]

Optimal. Leaf size=53 \[ \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} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 53, normalized size of antiderivative = 1.00, 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 = {3212} \begin {gather*} \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} \end {gather*}

Antiderivative was successfully verified.

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

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.08, size = 43, normalized size = 0.81 \begin {gather*} \frac {(b B-c C) x+(-B c+b C) \log (b \cosh (x)+c \sinh (x))}{(b-c) (b+c)} \end {gather*}

Antiderivative was successfully verified.

[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 [A]
time = 1.15, size = 91, normalized size = 1.72

method result size
default \(\frac {2 \left (-B -C \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2 b +2 c}+\frac {2 \left (-\frac {B c}{2}+\frac {b C}{2}\right ) \ln \left (b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 c \tanh \left (\frac {x}{2}\right )+b \right )}{\left (b -c \right ) \left (b +c \right )}+\frac {2 \left (B -C \right ) \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2 b -2 c}\) \(91\)
risch \(\frac {B x}{b +c}+\frac {C x}{b +c}+\frac {2 x B c}{b^{2}-c^{2}}-\frac {2 x b C}{b^{2}-c^{2}}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {b -c}{b +c}\right ) B c}{b^{2}-c^{2}}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {b -c}{b +c}\right ) b C}{b^{2}-c^{2}}\) \(113\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 87, normalized size = 1.64 \begin {gather*} 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 {gather*}

Verification 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 = 0.37, size = 60, normalized size = 1.13 \begin {gather*} \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 {gather*}

Verification 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 [B] Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (39) = 78\).
time = 0.35, size = 326, normalized size = 6.15 \begin {gather*} \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 \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 \log {\left (\sinh {\left (x \right )} \right )} + C x}{c} & \text {for}\: b = 0 \\\frac {B b x}{b^{2} - c^{2}} - \frac {B c \log {\left (\cosh {\left (x \right )} + \frac {c \sinh {\left (x \right )}}{b} \right )}}{b^{2} - c^{2}} + \frac {C b \log {\left (\cosh {\left (x \right )} + \frac {c \sinh {\left (x \right )}}{b} \right )}}{b^{2} - c^{2}} - \frac {C c x}{b^{2} - c^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification 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*sinh(x)/(-2*c*sinh(x) + 2*c*cosh(x)) - B*x*c
osh(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*sinh(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*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
*sinh(x) + 2*c*cosh(x)), Eq(b, c)), ((B*log(sinh(x)) + C*x)/c, Eq(b, 0)), (B*b*x/(b**2 - c**2) - B*c*log(cosh(
x) + c*sinh(x)/b)/(b**2 - c**2) + C*b*log(cosh(x) + c*sinh(x)/b)/(b**2 - c**2) - C*c*x/(b**2 - c**2), True))

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 54, normalized size = 1.02 \begin {gather*} \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 {gather*}

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

________________________________________________________________________________________

Mupad [B]
time = 1.56, size = 53, normalized size = 1.00 \begin {gather*} \frac {x\,\left (B\,b-C\,c\right )}{b^2-c^2}-\frac {\ln \left (b\,\mathrm {cosh}\left (x\right )+c\,\mathrm {sinh}\left (x\right )\right )\,\left (B\,c-C\,b\right )}{b^2-c^2} \end {gather*}

Verification 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]

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

________________________________________________________________________________________