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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.781512, antiderivative size = 193, normalized size of antiderivative = 1.45, number of steps used = 8, number of rules used = 4, integrand size = 16, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.25, Rules used = {6742, 638, 618, 204} $-\frac{2 b^3 \left (a+b \tanh \left (\frac{x}{2}\right )\right )}{a \left (a^2-b^2\right )^2 \left (a \tanh ^2\left (\frac{x}{2}\right )+a+2 b \tanh \left (\frac{x}{2}\right )\right )}-\frac{2 b^4 \tan ^{-1}\left (\frac{a \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2}}-\frac{2 b^2 \left (3 a^2-b^2\right ) \tan ^{-1}\left (\frac{a \tanh \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2}}+\frac{1}{(a+b)^2 \left (1-\tanh \left (\frac{x}{2}\right )\right )}-\frac{1}{(a-b)^2 \left (\tanh \left (\frac{x}{2}\right )+1\right )}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(-2*b^4*ArcTan[(b + a*Tanh[x/2])/Sqrt[a^2 - b^2]])/(a*(a^2 - b^2)^(5/2)) - (2*b^2*(3*a^2 - b^2)*ArcTan[(b + a*
Tanh[x/2])/Sqrt[a^2 - b^2]])/(a*(a^2 - b^2)^(5/2)) + 1/((a + b)^2*(1 - Tanh[x/2])) - 1/((a - b)^2*(1 + Tanh[x/
2])) - (2*b^3*(a + b*Tanh[x/2]))/(a*(a^2 - b^2)^2*(a + 2*b*Tanh[x/2] + a*Tanh[x/2]^2))

Rule 6742

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

Rule 638

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b*d - 2*a*e + (2*c*d -
b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[((2*p + 3)*(2*c*d - b*e))/((p + 1)*(b^2
- 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^
2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2]

Rule 618

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

Rule 204

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

Rubi steps

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

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.0218, size = 3667, normalized size = 27.57 \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)^3/(a*cosh(x)+b*sinh(x))^2,x, algorithm="fricas")

[Out]

[-1/2*(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)^4 - 4*(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)*sinh(x)^3 - (a^5 - a^4*b - 2*a^3*b^
2 + 2*a^2*b^3 + a*b^4 - b^5)*sinh(x)^4 + 6*(a^4*b - b^5)*cosh(x)^2 + 6*(a^4*b - 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)*sinh(x)^2 + 6*((a^2*b^2 + a*b^3)*cosh(x)^3 + 3*(a^2*b^2 + a*b^3)*cosh(x
)*sinh(x)^2 + (a^2*b^2 + a*b^3)*sinh(x)^3 + (a^2*b^2 - a*b^3)*cosh(x) + (a^2*b^2 - a*b^3 + 3*(a^2*b^2 + a*b^3)
*cosh(x)^2)*sinh(x))*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)) - 4*((a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^3 - 3*(a^4*b - b^5)*cosh(x))*
sinh(x))/((a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)^3 + 3*(a^7 + a^6
*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)*sinh(x)^2 + (a^7 + a^6*b - 3*a^5*b^2
- 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*sinh(x)^3 + (a^7 - a^6*b - 3*a^5*b^2 + 3*a^4*b^3 + 3*a^3*b
^4 - 3*a^2*b^5 - a*b^6 + b^7)*cosh(x) + (a^7 - a^6*b - 3*a^5*b^2 + 3*a^4*b^3 + 3*a^3*b^4 - 3*a^2*b^5 - a*b^6 +
b^7 + 3*(a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)^2)*sinh(x)), -1/2
*(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)^4 - 4*(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)*sinh(x)^3 - (a^5 - a^4*b - 2*a^3*b^2 + 2
*a^2*b^3 + a*b^4 - b^5)*sinh(x)^4 + 6*(a^4*b - b^5)*cosh(x)^2 + 6*(a^4*b - 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)*sinh(x)^2 - 12*((a^2*b^2 + a*b^3)*cosh(x)^3 + 3*(a^2*b^2 + a*b^3)*cosh(x)*si
nh(x)^2 + (a^2*b^2 + a*b^3)*sinh(x)^3 + (a^2*b^2 - a*b^3)*cosh(x) + (a^2*b^2 - a*b^3 + 3*(a^2*b^2 + a*b^3)*cos
h(x)^2)*sinh(x))*sqrt(a^2 - b^2)*arctan(sqrt(a^2 - b^2)/((a + b)*cosh(x) + (a + b)*sinh(x))) - 4*((a^5 - a^4*b
- 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^3 - 3*(a^4*b - b^5)*cosh(x))*sinh(x))/((a^7 + a^6*b - 3*a^5*b^
2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)^3 + 3*(a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^
3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)*sinh(x)^2 + (a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*
b^5 - a*b^6 - b^7)*sinh(x)^3 + (a^7 - a^6*b - 3*a^5*b^2 + 3*a^4*b^3 + 3*a^3*b^4 - 3*a^2*b^5 - a*b^6 + b^7)*cos
h(x) + (a^7 - a^6*b - 3*a^5*b^2 + 3*a^4*b^3 + 3*a^3*b^4 - 3*a^2*b^5 - a*b^6 + b^7 + 3*(a^7 + a^6*b - 3*a^5*b^2
- 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*cosh(x)^2)*sinh(x))]

________________________________________________________________________________________

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.14985, size = 235, normalized size = 1.77 \begin{align*} -\frac{6 \, a b^{2} \arctan \left (\frac{a e^{x} + b e^{x}}{\sqrt{a^{2} - b^{2}}}\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt{a^{2} - b^{2}}} + \frac{e^{x}}{2 \,{\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac{a^{3} e^{\left (2 \, x\right )} + 3 \, a^{2} b e^{\left (2 \, x\right )} + 3 \, a b^{2} e^{\left (2 \, x\right )} + 5 \, b^{3} e^{\left (2 \, x\right )} + a^{3} + a^{2} b - a b^{2} - b^{3}}{2 \,{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )}{\left (a e^{\left (3 \, x\right )} + b e^{\left (3 \, x\right )} + a e^{x} - b e^{x}\right )}} \end{align*}

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

[In]

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

[Out]

-6*a*b^2*arctan((a*e^x + b*e^x)/sqrt(a^2 - b^2))/((a^4 - 2*a^2*b^2 + b^4)*sqrt(a^2 - b^2)) + 1/2*e^x/(a^2 + 2*
a*b + b^2) - 1/2*(a^3*e^(2*x) + 3*a^2*b*e^(2*x) + 3*a*b^2*e^(2*x) + 5*b^3*e^(2*x) + a^3 + a^2*b - a*b^2 - b^3)
/((a^4 - 2*a^2*b^2 + b^4)*(a*e^(3*x) + b*e^(3*x) + a*e^x - b*e^x))