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

Optimal. Leaf size=101 $-\frac{a b^2 x}{\left (a^2-b^2\right )^2}+\frac{a x}{2 \left (a^2-b^2\right )}-\frac{b \cosh ^2(x)}{2 \left (a^2-b^2\right )}+\frac{a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac{b^3 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}$

[Out]

-((a*b^2*x)/(a^2 - b^2)^2) + (a*x)/(2*(a^2 - b^2)) - (b*Cosh[x]^2)/(2*(a^2 - b^2)) + (b^3*Log[a*Cosh[x] + b*Si
nh[x]])/(a^2 - b^2)^2 + (a*Cosh[x]*Sinh[x])/(2*(a^2 - b^2))

________________________________________________________________________________________

Rubi [A]  time = 0.116145, antiderivative size = 101, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 16, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.312, Rules used = {3100, 2635, 8, 3098, 3133} $-\frac{a b^2 x}{\left (a^2-b^2\right )^2}+\frac{a x}{2 \left (a^2-b^2\right )}-\frac{b \cosh ^2(x)}{2 \left (a^2-b^2\right )}+\frac{a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac{b^3 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-((a*b^2*x)/(a^2 - b^2)^2) + (a*x)/(2*(a^2 - b^2)) - (b*Cosh[x]^2)/(2*(a^2 - b^2)) + (b^3*Log[a*Cosh[x] + b*Si
nh[x]])/(a^2 - b^2)^2 + (a*Cosh[x]*Sinh[x])/(2*(a^2 - b^2))

Rule 3100

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

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3098

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

Rule 3133

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] + Simp[((c*B - b*C)*L
og[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] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rubi steps

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

Mathematica [A]  time = 0.10287, size = 75, normalized size = 0.74 $\frac{a \left (a^2-b^2\right ) \sinh (2 x)+\left (b^3-a^2 b\right ) \cosh (2 x)+2 a^3 x-6 a b^2 x+4 b^3 \log (a \cosh (x)+b \sinh (x))}{4 (a-b)^2 (a+b)^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*a^3*x - 6*a*b^2*x + (-(a^2*b) + b^3)*Cosh[2*x] + 4*b^3*Log[a*Cosh[x] + b*Sinh[x]] + a*(a^2 - b^2)*Sinh[2*x]
)/(4*(a - b)^2*(a + b)^2)

________________________________________________________________________________________

Maple [A]  time = 0.049, size = 175, normalized size = 1.7 \begin{align*} -{\frac{1}{2\,a-2\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+2\,{\frac{1}{ \left ( 4\,a-4\,b \right ) \left ( \tanh \left ( x/2 \right ) +1 \right ) }}+{\frac{a}{2\, \left ( a-b \right ) ^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{b}{ \left ( a-b \right ) ^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{{b}^{3}}{ \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}}\ln \left ( a+2\,\tanh \left ( x/2 \right ) b+a \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) }+{\frac{1}{2\,b+2\,a} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+2\,{\frac{1}{ \left ( 4\,a+4\,b \right ) \left ( \tanh \left ( x/2 \right ) -1 \right ) }}-{\frac{a}{2\, \left ( a+b \right ) ^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{b}{ \left ( a+b \right ) ^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.20217, size = 116, normalized size = 1.15 \begin{align*} \frac{b^{3} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac{{\left (a + 2 \, b\right )} x}{2 \,{\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac{e^{\left (2 \, x\right )}}{8 \,{\left (a + b\right )}} - \frac{e^{\left (-2 \, x\right )}}{8 \,{\left (a - b\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)),x, algorithm="maxima")

[Out]

b^3*log(-(a - b)*e^(-2*x) - a - b)/(a^4 - 2*a^2*b^2 + b^4) + 1/2*(a + 2*b)*x/(a^2 + 2*a*b + b^2) + 1/8*e^(2*x)
/(a + b) - 1/8*e^(-2*x)/(a - b)

________________________________________________________________________________________

Fricas [B]  time = 1.88098, size = 818, normalized size = 8.1 \begin{align*} \frac{{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{4} + 4 \,{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} +{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \left (x\right )^{4} + 4 \,{\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x \cosh \left (x\right )^{2} - a^{3} - a^{2} b + a b^{2} + b^{3} + 2 \,{\left (3 \,{\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x\right )} \sinh \left (x\right )^{2} + 8 \,{\left (b^{3} \cosh \left (x\right )^{2} + 2 \, b^{3} \cosh \left (x\right ) \sinh \left (x\right ) + b^{3} \sinh \left (x\right )^{2}\right )} \log \left (\frac{2 \,{\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 4 \,{\left ({\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{3} + 2 \,{\left (a^{3} - 3 \, a b^{2} - 2 \, b^{3}\right )} x \cosh \left (x\right )\right )} \sinh \left (x\right )}{8 \,{\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} + 2 \,{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right ) +{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{2}\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)),x, algorithm="fricas")

[Out]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.12158, size = 150, normalized size = 1.49 \begin{align*} \frac{b^{3} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac{{\left (a - 2 \, b\right )} x}{2 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac{{\left (2 \, a e^{\left (2 \, x\right )} - 4 \, b e^{\left (2 \, x\right )} + a - b\right )} e^{\left (-2 \, x\right )}}{8 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}} + \frac{e^{\left (2 \, x\right )}}{8 \,{\left (a + b\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)),x, algorithm="giac")

[Out]

b^3*log(abs(a*e^(2*x) + b*e^(2*x) + a - b))/(a^4 - 2*a^2*b^2 + b^4) + 1/2*(a - 2*b)*x/(a^2 - 2*a*b + b^2) - 1/
8*(2*a*e^(2*x) - 4*b*e^(2*x) + a - b)*e^(-2*x)/(a^2 - 2*a*b + b^2) + 1/8*e^(2*x)/(a + b)