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

Optimal. Leaf size=92 $\frac{A \tan ^{-1}\left (\frac{b \sinh (x)+c \cosh (x)}{\sqrt{b^2-c^2}}\right )}{\sqrt{b^2-c^2}}+\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) + (A*ArcTan[(c*Cosh[x] + b*Sinh[x])/Sqrt[b^2 - c^2]])/Sqrt[b^2 - c^2] - ((B*c - b*
C)*Log[b*Cosh[x] + c*Sinh[x]])/(b^2 - c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0696699, antiderivative size = 92, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 22, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.136, Rules used = {3136, 3074, 206} $\frac{A \tan ^{-1}\left (\frac{b \sinh (x)+c \cosh (x)}{\sqrt{b^2-c^2}}\right )}{\sqrt{b^2-c^2}}+\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[(A + B*Cosh[x] + C*Sinh[x])/(b*Cosh[x] + c*Sinh[x]),x]

[Out]

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

Rule 3136

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] + (Dist[(A*(b^2 + c^2
) - a*(b*B + c*C))/(b^2 + c^2), Int[1/(a + b*Cos[d + e*x] + c*Sin[d + e*x]), x], x] + Simp[((c*B - b*C)*Log[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] && NeQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rule 3074

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

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{A+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}+A \int \frac{1}{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}+(i A) \operatorname{Subst}\left (\int \frac{1}{b^2-c^2-x^2} \, dx,x,-i c \cosh (x)-i b \sinh (x)\right )\\ &=\frac{(b B-c C) x}{b^2-c^2}+\frac{A \tan ^{-1}\left (\frac{c \cosh (x)+b \sinh (x)}{\sqrt{b^2-c^2}}\right )}{\sqrt{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.255864, size = 90, normalized size = 0.98 $\frac{2 A \sqrt{b-c} \sqrt{b+c} \tan ^{-1}\left (\frac{b \tanh \left (\frac{x}{2}\right )+c}{\sqrt{b-c} \sqrt{b+c}}\right )+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[(A + B*Cosh[x] + C*Sinh[x])/(b*Cosh[x] + c*Sinh[x]),x]

[Out]

((b*B - c*C)*x + 2*A*Sqrt[b - c]*Sqrt[b + c]*ArcTan[(c + b*Tanh[x/2])/(Sqrt[b - c]*Sqrt[b + c])] + (-(B*c) + b
*C)*Log[b*Cosh[x] + c*Sinh[x]])/((b - c)*(b + c))

________________________________________________________________________________________

Maple [B]  time = 0.058, size = 253, normalized size = 2.8 \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{A{b}^{2}}{ \left ( b-c \right ) \left ( b+c \right ) \sqrt{{b}^{2}-{c}^{2}}}\arctan \left ( 1/2\,{\frac{2\,\tanh \left ( x/2 \right ) b+2\,c}{\sqrt{{b}^{2}-{c}^{2}}}} \right ) }-2\,{\frac{A{c}^{2}}{ \left ( b-c \right ) \left ( b+c \right ) \sqrt{{b}^{2}-{c}^{2}}}\arctan \left ( 1/2\,{\frac{2\,\tanh \left ( x/2 \right ) b+2\,c}{\sqrt{{b}^{2}-{c}^{2}}}} \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((A+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-c)/(b+c)/(b^2-c^2)^(1/2)*arctan(1/2*(2*
tanh(1/2*x)*b+2*c)/(b^2-c^2)^(1/2))*A*b^2-2/(b-c)/(b+c)/(b^2-c^2)^(1/2)*arctan(1/2*(2*tanh(1/2*x)*b+2*c)/(b^2-
c^2)^(1/2))*A*c^2-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 [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

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

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.22185, size = 701, normalized size = 7.62 \begin{align*} \left [-\frac{\sqrt{-b^{2} + c^{2}} A \log \left (\frac{{\left (b + c\right )} \cosh \left (x\right )^{2} + 2 \,{\left (b + c\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (b + c\right )} \sinh \left (x\right )^{2} - 2 \, \sqrt{-b^{2} + c^{2}}{\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} - b + c}{{\left (b + c\right )} \cosh \left (x\right )^{2} + 2 \,{\left (b + c\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (b + c\right )} \sinh \left (x\right )^{2} + b - c}\right ) -{\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}}, -\frac{2 \, \sqrt{b^{2} - c^{2}} A \arctan \left (\frac{\sqrt{b^{2} - c^{2}}}{{\left (b + c\right )} \cosh \left (x\right ) +{\left (b + c\right )} \sinh \left (x\right )}\right ) -{\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}}\right ] \end{align*}

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

[In]

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

[Out]

[-(sqrt(-b^2 + c^2)*A*log(((b + c)*cosh(x)^2 + 2*(b + c)*cosh(x)*sinh(x) + (b + c)*sinh(x)^2 - 2*sqrt(-b^2 + c
^2)*(cosh(x) + sinh(x)) - b + c)/((b + c)*cosh(x)^2 + 2*(b + c)*cosh(x)*sinh(x) + (b + c)*sinh(x)^2 + b - c))
- ((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), -(2
*sqrt(b^2 - c^2)*A*arctan(sqrt(b^2 - c^2)/((b + c)*cosh(x) + (b + c)*sinh(x))) - ((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 = 80.0006, size = 643, normalized size = 6.99 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

Piecewise((zoo*(A*log(tanh(x/2)) + B*x - 2*B*log(tanh(x/2) + 1) + B*log(tanh(x/2)) + C*x), Eq(b, 0) & Eq(c, 0)
), ((A*log(tanh(x/2)) + B*x - 2*B*log(tanh(x/2) + 1) + B*log(tanh(x/2)) + C*x)/c, Eq(b, 0)), (-2*A/(-2*c*sinh(
x) + 2*c*cosh(x)) + 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*co
sh(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)), (-2*A/(2*c*sinh(x) + 2*c*cosh(x)) + 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)), (-A*sqrt(-b**2 + c**2)*log(tanh(x/2) + c/b - sqrt(-b**2 + c**2)/b)/(b**2 - c**2)
+ A*sqrt(-b**2 + c**2)*log(tanh(x/2) + c/b + sqrt(-b**2 + c**2)/b)/(b**2 - c**2) + B*b*x/(b**2 - c**2) - B*c*x
/(b**2 - c**2) + 2*B*c*log(tanh(x/2) + 1)/(b**2 - c**2) - B*c*log(tanh(x/2) + c/b - sqrt(-b**2 + c**2)/b)/(b**
2 - c**2) - B*c*log(tanh(x/2) + c/b + sqrt(-b**2 + c**2)/b)/(b**2 - c**2) + C*b*x/(b**2 - c**2) - 2*C*b*log(ta
nh(x/2) + 1)/(b**2 - c**2) + C*b*log(tanh(x/2) + c/b - sqrt(-b**2 + c**2)/b)/(b**2 - c**2) + C*b*log(tanh(x/2)
+ c/b + sqrt(-b**2 + c**2)/b)/(b**2 - c**2) - C*c*x/(b**2 - c**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.13483, size = 120, normalized size = 1.3 \begin{align*} \frac{2 \, A \arctan \left (\frac{b e^{x} + c e^{x}}{\sqrt{b^{2} - c^{2}}}\right )}{\sqrt{b^{2} - c^{2}}} + \frac{{\left (B - C\right )} x}{b - c} + \frac{{\left (C b - B c\right )} \log \left (b e^{\left (2 \, x\right )} + c e^{\left (2 \, x\right )} + b - c\right )}{b^{2} - c^{2}} \end{align*}

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

[In]

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

[Out]

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