### 3.699 $$\int \frac{\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx$$

Optimal. Leaf size=64 $\frac{b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac{a \tan ^{-1}\left (\frac{a \sinh (x)+b \cosh (x)}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0550593, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 14, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.214, Rules used = {3155, 3074, 206} $\frac{b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac{a \tan ^{-1}\left (\frac{a \sinh (x)+b \cosh (x)}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3155

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.))/((a_.) + cos[(d_.) + (e_.)*(x_)]*(b_.) + (c_.)*sin[(d_.) + (e_.)*(
x_)])^2, x_Symbol] :> Simp[(c*B + c*A*Cos[d + e*x] + (a*B - b*A)*Sin[d + e*x])/(e*(a^2 - b^2 - c^2)*(a + b*Cos
[d + e*x] + c*Sin[d + e*x])), x] + Dist[(a*A - b*B)/(a^2 - b^2 - c^2), Int[1/(a + b*Cos[d + e*x] + c*Sin[d + e
*x]), x], x] /; FreeQ[{a, b, c, d, e, A, B}, x] && NeQ[a^2 - b^2 - c^2, 0] && NeQ[a*A - b*B, 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{\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx &=\frac{b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac{a \int \frac{1}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=\frac{b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac{(i a) \operatorname{Subst}\left (\int \frac{1}{a^2-b^2-x^2} \, dx,x,-i b \cosh (x)-i a \sinh (x)\right )}{a^2-b^2}\\ &=\frac{a \tan ^{-1}\left (\frac{b \cosh (x)+a \sinh (x)}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac{b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}\\ \end{align*}

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 98, normalized size = 1.5 \begin{align*} 2\,{\frac{1}{a+2\,\tanh \left ( x/2 \right ) b+a \left ( \tanh \left ( x/2 \right ) \right ) ^{2}} \left ({\frac{{b}^{2}\tanh \left ( x/2 \right ) }{a \left ({a}^{2}-{b}^{2} \right ) }}+{\frac{b}{{a}^{2}-{b}^{2}}} \right ) }+2\,{\frac{a}{ \left ({a}^{2}-{b}^{2} \right ) ^{3/2}}\arctan \left ( 1/2\,{\frac{2\,a\tanh \left ( x/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) } \end{align*}

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

[In]

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

[Out]

2*(b^2/a/(a^2-b^2)*tanh(1/2*x)+b/(a^2-b^2))/(a+2*tanh(1/2*x)*b+a*tanh(1/2*x)^2)+2*a/(a^2-b^2)^(3/2)*arctan(1/2
*(2*a*tanh(1/2*x)+2*b)/(a^2-b^2)^(1/2))

________________________________________________________________________________________

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.92698, size = 1474, normalized size = 23.03 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

[(((a^2 + a*b)*cosh(x)^2 + 2*(a^2 + a*b)*cosh(x)*sinh(x) + (a^2 + a*b)*sinh(x)^2 + a^2 - a*b)*sqrt(-a^2 + b^2)
*log(((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x)^2 + 2*sqrt(-a^2 + b^2)*(cosh(x) + sinh(x
)) - a + b)/((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x)^2 + a - b)) + 2*(a^2*b - b^3)*cos
h(x) + 2*(a^2*b - b^3)*sinh(x))/(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5 + (a^5 + a^4*b - 2*a^3*b^2
- 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)^2 + 2*(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)*sinh(x) +
(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*sinh(x)^2), -2*(((a^2 + a*b)*cosh(x)^2 + 2*(a^2 + a*b)*co
sh(x)*sinh(x) + (a^2 + a*b)*sinh(x)^2 + a^2 - a*b)*sqrt(a^2 - b^2)*arctan(sqrt(a^2 - b^2)/((a + b)*cosh(x) + (
a + b)*sinh(x))) - (a^2*b - b^3)*cosh(x) - (a^2*b - b^3)*sinh(x))/(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4
- b^5 + (a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)^2 + 2*(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^
3 + a*b^4 + b^5)*cosh(x)*sinh(x) + (a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*sinh(x)^2)]

________________________________________________________________________________________

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

[Out]

Timed out

________________________________________________________________________________________

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

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

[In]

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

[Out]

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