3.111 \(\int \frac{A+B \cosh (x)}{(a+b \cosh (x))^2} \, dx\)

Optimal. Leaf size=82 \[ \frac{2 (a A-b B) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2}}-\frac{\sinh (x) (A b-a B)}{\left (a^2-b^2\right ) (a+b \cosh (x))} \]

[Out]

(2*(a*A - b*B)*ArcTanh[(Sqrt[a - b]*Tanh[x/2])/Sqrt[a + b]])/((a - b)^(3/2)*(a + b)^(3/2)) - ((A*b - a*B)*Sinh
[x])/((a^2 - b^2)*(a + b*Cosh[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0782561, antiderivative size = 82, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {2754, 12, 2659, 208} \[ \frac{2 (a A-b B) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2}}-\frac{\sinh (x) (A b-a B)}{\left (a^2-b^2\right ) (a+b \cosh (x))} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Cosh[x])/(a + b*Cosh[x])^2,x]

[Out]

(2*(a*A - b*B)*ArcTanh[(Sqrt[a - b]*Tanh[x/2])/Sqrt[a + b]])/((a - b)^(3/2)*(a + b)^(3/2)) - ((A*b - a*B)*Sinh
[x])/((a^2 - b^2)*(a + b*Cosh[x]))

Rule 2754

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 - b^2)), x] + Dist[1/((m + 1)*(a^2 - b^2
)), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[(a*c - b*d)*(m + 1) - (b*c - a*d)*(m + 2)*Sin[e + f*x], x], x], x] /
; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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]

Rubi steps

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

Mathematica [A]  time = 0.167068, size = 81, normalized size = 0.99 \[ \frac{2 (a A-b B) \tan ^{-1}\left (\frac{(a-b) \tanh \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\left (b^2-a^2\right )^{3/2}}+\frac{\sinh (x) (a B-A b)}{(a-b) (a+b) (a+b \cosh (x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Cosh[x])/(a + b*Cosh[x])^2,x]

[Out]

(2*(a*A - b*B)*ArcTan[((a - b)*Tanh[x/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(3/2) + ((-(A*b) + a*B)*Sinh[x])/((a
 - b)*(a + b)*(a + b*Cosh[x]))

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 108, normalized size = 1.3 \begin{align*} 2\,{\frac{ \left ( Ab-aB \right ) \tanh \left ( x/2 \right ) }{ \left ({a}^{2}-{b}^{2} \right ) \left ( a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}- \left ( \tanh \left ( x/2 \right ) \right ) ^{2}b-a-b \right ) }}+2\,{\frac{Aa-Bb}{ \left ( a+b \right ) \left ( a-b \right ) \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*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*cosh(x))/(a+b*cosh(x))^2,x)

[Out]

2*(A*b-B*a)/(a^2-b^2)*tanh(1/2*x)/(a*tanh(1/2*x)^2-tanh(1/2*x)^2*b-a-b)+2*(A*a-B*b)/(a+b)/(a-b)/((a+b)*(a-b))^
(1/2)*arctanh((a-b)*tanh(1/2*x)/((a+b)*(a-b))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.30036, size = 1914, normalized size = 23.34 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x))^2,x, algorithm="fricas")

[Out]

[-(2*B*a^3*b - 2*A*a^2*b^2 - 2*B*a*b^3 + 2*A*b^4 - (A*a*b^2 - B*b^3 + (A*a*b^2 - B*b^3)*cosh(x)^2 + (A*a*b^2 -
 B*b^3)*sinh(x)^2 + 2*(A*a^2*b - B*a*b^2)*cosh(x) + 2*(A*a^2*b - B*a*b^2 + (A*a*b^2 - B*b^3)*cosh(x))*sinh(x))
*sqrt(a^2 - b^2)*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)) + 2*(B*a^4 - A*a^3*b - B*a^2*b^2 + A*a*b^3)*cosh(x) + 2*(B*a^4 - A*a^3*b - B*a^2*b^2 + A*a*b
^3)*sinh(x))/(a^4*b^2 - 2*a^2*b^4 + b^6 + (a^4*b^2 - 2*a^2*b^4 + b^6)*cosh(x)^2 + (a^4*b^2 - 2*a^2*b^4 + b^6)*
sinh(x)^2 + 2*(a^5*b - 2*a^3*b^3 + a*b^5)*cosh(x) + 2*(a^5*b - 2*a^3*b^3 + a*b^5 + (a^4*b^2 - 2*a^2*b^4 + b^6)
*cosh(x))*sinh(x)), -2*(B*a^3*b - A*a^2*b^2 - B*a*b^3 + A*b^4 + (A*a*b^2 - B*b^3 + (A*a*b^2 - B*b^3)*cosh(x)^2
 + (A*a*b^2 - B*b^3)*sinh(x)^2 + 2*(A*a^2*b - B*a*b^2)*cosh(x) + 2*(A*a^2*b - B*a*b^2 + (A*a*b^2 - B*b^3)*cosh
(x))*sinh(x))*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a)/(a^2 - b^2)) + (B*a^4 - A*
a^3*b - B*a^2*b^2 + A*a*b^3)*cosh(x) + (B*a^4 - A*a^3*b - B*a^2*b^2 + A*a*b^3)*sinh(x))/(a^4*b^2 - 2*a^2*b^4 +
 b^6 + (a^4*b^2 - 2*a^2*b^4 + b^6)*cosh(x)^2 + (a^4*b^2 - 2*a^2*b^4 + b^6)*sinh(x)^2 + 2*(a^5*b - 2*a^3*b^3 +
a*b^5)*cosh(x) + 2*(a^5*b - 2*a^3*b^3 + a*b^5 + (a^4*b^2 - 2*a^2*b^4 + b^6)*cosh(x))*sinh(x))]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.1565, size = 144, normalized size = 1.76 \begin{align*} \frac{2 \,{\left (A a - B b\right )} \arctan \left (\frac{b e^{x} + a}{\sqrt{-a^{2} + b^{2}}}\right )}{{\left (a^{2} - b^{2}\right )} \sqrt{-a^{2} + b^{2}}} - \frac{2 \,{\left (B a^{2} e^{x} - A a b e^{x} + B a b - A b^{2}\right )}}{{\left (a^{2} b - b^{3}\right )}{\left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} + b\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*cosh(x))/(a+b*cosh(x))^2,x, algorithm="giac")

[Out]

2*(A*a - B*b)*arctan((b*e^x + a)/sqrt(-a^2 + b^2))/((a^2 - b^2)*sqrt(-a^2 + b^2)) - 2*(B*a^2*e^x - A*a*b*e^x +
 B*a*b - A*b^2)/((a^2*b - b^3)*(b*e^(2*x) + 2*a*e^x + b))