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

Optimal. Leaf size=59 $\frac{2 (b+c) \tanh ^{-1}\left (\frac{\sqrt{a+b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a-b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a-b \cosh (x))}{b}$

[Out]

(2*(b + c)*ArcTanh[(Sqrt[a + b]*Tanh[x/2])/Sqrt[a - b]])/(Sqrt[a - b]*Sqrt[a + b]) - Log[a - b*Cosh[x]]/b

________________________________________________________________________________________

Rubi [A]  time = 0.13998, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.333, Rules used = {4401, 2659, 208, 2668, 31} $\frac{2 (b+c) \tanh ^{-1}\left (\frac{\sqrt{a+b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a-b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a-b \cosh (x))}{b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*(b + c)*ArcTanh[(Sqrt[a + b]*Tanh[x/2])/Sqrt[a - b]])/(Sqrt[a - b]*Sqrt[a + b]) - Log[a - b*Cosh[x]]/b

Rule 4401

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rule 2659

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

Rule 208

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

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{b+c+\sinh (x)}{a-b \cosh (x)} \, dx &=\int \left (\frac{-b-c}{-a+b \cosh (x)}+\frac{\sinh (x)}{a-b \cosh (x)}\right ) \, dx\\ &=(-b-c) \int \frac{1}{-a+b \cosh (x)} \, dx+\int \frac{\sinh (x)}{a-b \cosh (x)} \, dx\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,-b \cosh (x)\right )}{b}-(2 (b+c)) \operatorname{Subst}\left (\int \frac{1}{-a+b-(-a-b) x^2} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )\\ &=\frac{2 (b+c) \tanh ^{-1}\left (\frac{\sqrt{a+b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a-b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a-b \cosh (x))}{b}\\ \end{align*}

Mathematica [A]  time = 0.0947193, size = 56, normalized size = 0.95 $-\frac{2 (b+c) \tan ^{-1}\left (\frac{(a+b) \tanh \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}-\frac{\log (a-b \cosh (x))}{b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(-2*(b + c)*ArcTan[((a + b)*Tanh[x/2])/Sqrt[-a^2 + b^2]])/Sqrt[-a^2 + b^2] - Log[a - b*Cosh[x]]/b

________________________________________________________________________________________

Maple [B]  time = 0.021, size = 154, normalized size = 2.6 \begin{align*}{\frac{1}{b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{a}{b \left ( a+b \right ) }\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+ \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b-a+b \right ) }-{\frac{1}{a+b}\ln \left ( a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+ \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}b-a+b \right ) }+2\,{\frac{b}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a+b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{c}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a+b \right ) \tanh \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}

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

[In]

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

[Out]

1/b*ln(tanh(1/2*x)+1)+1/b*ln(tanh(1/2*x)-1)-1/b/(a+b)*ln(a*tanh(1/2*x)^2+tanh(1/2*x)^2*b-a+b)*a-1/(a+b)*ln(a*t
anh(1/2*x)^2+tanh(1/2*x)^2*b-a+b)+2*b/((a+b)*(a-b))^(1/2)*arctanh((a+b)*tanh(1/2*x)/((a+b)*(a-b))^(1/2))+2/((a
+b)*(a-b))^(1/2)*arctanh((a+b)*tanh(1/2*x)/((a+b)*(a-b))^(1/2))*c

________________________________________________________________________________________

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((b+c+sinh(x))/(a-b*cosh(x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.49708, size = 716, normalized size = 12.14 \begin{align*} \left [\frac{\sqrt{a^{2} - b^{2}}{\left (b^{2} + b c\right )} \log \left (\frac{b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} - 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} - b^{2} + 2 \,{\left (b^{2} \cosh \left (x\right ) - a b\right )} \sinh \left (x\right ) + 2 \, \sqrt{a^{2} - b^{2}}{\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) - a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} - 2 \, a \cosh \left (x\right ) + 2 \,{\left (b \cosh \left (x\right ) - a\right )} \sinh \left (x\right ) + b}\right ) +{\left (a^{2} - b^{2}\right )} x -{\left (a^{2} - b^{2}\right )} \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) - a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} b - b^{3}}, \frac{2 \, \sqrt{-a^{2} + b^{2}}{\left (b^{2} + b c\right )} \arctan \left (-\frac{\sqrt{-a^{2} + b^{2}}{\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) - a\right )}}{a^{2} - b^{2}}\right ) +{\left (a^{2} - b^{2}\right )} x -{\left (a^{2} - b^{2}\right )} \log \left (\frac{2 \,{\left (b \cosh \left (x\right ) - a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{2} b - b^{3}}\right ] \end{align*}

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

[In]

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

[Out]

[(sqrt(a^2 - b^2)*(b^2 + b*c)*log((b^2*cosh(x)^2 + b^2*sinh(x)^2 - 2*a*b*cosh(x) + 2*a^2 - b^2 + 2*(b^2*cosh(x
) - a*b)*sinh(x) + 2*sqrt(a^2 - b^2)*(b*cosh(x) + b*sinh(x) - a))/(b*cosh(x)^2 + b*sinh(x)^2 - 2*a*cosh(x) + 2
*(b*cosh(x) - a)*sinh(x) + b)) + (a^2 - b^2)*x - (a^2 - b^2)*log(2*(b*cosh(x) - a)/(cosh(x) - sinh(x))))/(a^2*
b - b^3), (2*sqrt(-a^2 + b^2)*(b^2 + b*c)*arctan(-sqrt(-a^2 + b^2)*(b*cosh(x) + b*sinh(x) - a)/(a^2 - b^2)) +
(a^2 - b^2)*x - (a^2 - b^2)*log(2*(b*cosh(x) - a)/(cosh(x) - sinh(x))))/(a^2*b - b^3)]

________________________________________________________________________________________

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.15017, size = 84, normalized size = 1.42 \begin{align*} -\frac{2 \,{\left (b + c\right )} \arctan \left (\frac{b e^{x} - a}{\sqrt{-a^{2} + b^{2}}}\right )}{\sqrt{-a^{2} + b^{2}}} + \frac{x}{b} - \frac{\log \left (b e^{\left (2 \, x\right )} - 2 \, a e^{x} + b\right )}{b} \end{align*}

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

[In]

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

[Out]

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