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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.162841, antiderivative size = 102, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 18, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.389, Rules used = {3109, 2635, 8, 2564, 30, 3098, 3133} $\frac{a^2 b x}{\left (a^2-b^2\right )^2}-\frac{b x}{2 \left (a^2-b^2\right )}+\frac{a \sinh ^2(x)}{2 \left (a^2-b^2\right )}-\frac{b \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}-\frac{a b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3109

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

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 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
!(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

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 ^2(x) \sinh (x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac{a \int \cosh (x) \sinh (x) \, dx}{a^2-b^2}-\frac{b \int \cosh ^2(x) \, dx}{a^2-b^2}+\frac{(a b) \int \frac{\cosh (x)}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=\frac{a^2 b x}{\left (a^2-b^2\right )^2}-\frac{b \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )}-\frac{\left (i a b^2\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 \operatorname{Subst}(\int x \, dx,x,i \sinh (x))}{a^2-b^2}-\frac{b \int 1 \, dx}{2 \left (a^2-b^2\right )}\\ &=\frac{a^2 b x}{\left (a^2-b^2\right )^2}-\frac{b x}{2 \left (a^2-b^2\right )}-\frac{a b^2 \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}-\frac{b \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )}+\frac{a \sinh ^2(x)}{2 \left (a^2-b^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.223209, size = 73, normalized size = 0.72 $\frac{a \left (a^2-b^2\right ) \cosh (2 x)+b \left (2 x \left (a^2+b^2\right )+\left (b^2-a^2\right ) \sinh (2 x)-4 a b \log (a \cosh (x)+b \sinh (x))\right )}{4 (a-b)^2 (a+b)^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 146, normalized size = 1.4 \begin{align*} -4\,{\frac{1}{ \left ( 8\,a-8\,b \right ) \left ( \tanh \left ( x/2 \right ) +1 \right ) }}+2\,{\frac{1}{ \left ( 4\,a-4\,b \right ) \left ( \tanh \left ( x/2 \right ) +1 \right ) ^{2}}}+{\frac{b}{2\, \left ( a-b \right ) ^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }-{\frac{a{b}^{2}}{ \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 ) }+2\,{\frac{1}{ \left ( 4\,a+4\,b \right ) \left ( \tanh \left ( x/2 \right ) -1 \right ) ^{2}}}+4\,{\frac{1}{ \left ( 8\,a+8\,b \right ) \left ( \tanh \left ( x/2 \right ) -1 \right ) }}-{\frac{b}{2\, \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)^2*sinh(x)/(a*cosh(x)+b*sinh(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.17835, size = 113, normalized size = 1.11 \begin{align*} -\frac{a b^{2} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac{b 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)^2*sinh(x)/(a*cosh(x)+b*sinh(x)),x, algorithm="maxima")

[Out]

-a*b^2*log(-(a - b)*e^(-2*x) - a - b)/(a^4 - 2*a^2*b^2 + b^4) + 1/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.83732, size = 826, 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^{2} b + 2 \, a b^{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^{2} b + 2 \, a b^{2} + b^{3}\right )} x\right )} \sinh \left (x\right )^{2} - 8 \,{\left (a b^{2} \cosh \left (x\right )^{2} + 2 \, a b^{2} \cosh \left (x\right ) \sinh \left (x\right ) + a b^{2} \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^{2} b + 2 \, a b^{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)^2*sinh(x)/(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^2*b + 2*a*b^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^2*b + 2*a*b^2 + b^3)*x)*sinh(x)^2 - 8*(a*b^2*cosh(x)^2 + 2*a*b^2*cosh(x)*sinh
(x) + a*b^2*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)*cos
h(x)^3 + 2*(a^2*b + 2*a*b^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)**2*sinh(x)/(a*cosh(x)+b*sinh(x)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.14789, size = 138, normalized size = 1.35 \begin{align*} -\frac{a b^{2} \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{b x}{2 \,{\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac{{\left (2 \, 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)^2*sinh(x)/(a*cosh(x)+b*sinh(x)),x, algorithm="giac")

[Out]

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