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

Optimal. Leaf size=102 $-\frac{a x}{2 \left (a^2-b^2\right )}-\frac{a b^2 x}{\left (a^2-b^2\right )^2}-\frac{b \sinh ^2(x)}{2 \left (a^2-b^2\right )}+\frac{a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac{a^2 b \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)) + (a^2*b*Log[a*Cosh[x] + b*Sinh[x]])/(a^2 - b^2)^2 + (a*Cos
h[x]*Sinh[x])/(2*(a^2 - b^2)) - (b*Sinh[x]^2)/(2*(a^2 - b^2))

________________________________________________________________________________________

Rubi [A]  time = 0.16024, 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, 2564, 30, 2635, 8, 3097, 3133} $-\frac{a x}{2 \left (a^2-b^2\right )}-\frac{a b^2 x}{\left (a^2-b^2\right )^2}-\frac{b \sinh ^2(x)}{2 \left (a^2-b^2\right )}+\frac{a \sinh (x) \cosh (x)}{2 \left (a^2-b^2\right )}+\frac{a^2 b \log (a \cosh (x)+b \sinh (x))}{\left (a^2-b^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-((a*b^2*x)/(a^2 - b^2)^2) - (a*x)/(2*(a^2 - b^2)) + (a^2*b*Log[a*Cosh[x] + b*Sinh[x]])/(a^2 - b^2)^2 + (a*Cos
h[x]*Sinh[x])/(2*(a^2 - b^2)) - (b*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 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 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 3097

Int[sin[(c_.) + (d_.)*(x_)]/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp
[(b*x)/(a^2 + b^2), x] - Dist[a/(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 (x) \sinh ^2(x)}{a \cosh (x)+b \sinh (x)} \, dx &=\frac{a \int \sinh ^2(x) \, dx}{a^2-b^2}-\frac{b \int \cosh (x) \sinh (x) \, dx}{a^2-b^2}+\frac{(a b) \int \frac{\sinh (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{a \cosh (x) \sinh (x)}{2 \left (a^2-b^2\right )}+\frac{\left (i a^2 b\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{b \operatorname{Subst}(\int x \, dx,x,i \sinh (x))}{a^2-b^2}\\ &=-\frac{a b^2 x}{\left (a^2-b^2\right )^2}-\frac{a x}{2 \left (a^2-b^2\right )}+\frac{a^2 b \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 )}-\frac{b \sinh ^2(x)}{2 \left (a^2-b^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.229039, size = 73, normalized size = 0.72 $\frac{\left (b^3-a^2 b\right ) \cosh (2 x)+a \left (-2 x \left (a^2+b^2\right )+\left (a^2-b^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]*Sinh[x]^2)/(a*Cosh[x] + b*Sinh[x]),x]

[Out]

((-(a^2*b) + b^3)*Cosh[2*x] + a*(-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.044, size = 145, normalized size = 1.4 \begin{align*} -4\,{\frac{1}{ \left ( 8\,a-8\,b \right ) \left ( \tanh \left ( x/2 \right ) +1 \right ) ^{2}}}+8\,{\frac{1}{ \left ( 16\,a-16\,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{{a}^{2}b}{ \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 ) }+4\,{\frac{1}{ \left ( 8\,a+8\,b \right ) \left ( \tanh \left ( x/2 \right ) -1 \right ) ^{2}}}+8\,{\frac{1}{ \left ( 16\,a+16\,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 ) } \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

[Out]

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

[Out]

Timed out

________________________________________________________________________________________

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

[Out]

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