3.1.54 \(\int \frac {\sinh ^2(x)}{a+a \text {sech}(x)} \, dx\) [54]

Optimal. Leaf size=27 \[ \frac {x}{2 a}-\frac {\sinh (x)}{a}+\frac {\cosh (x) \sinh (x)}{2 a} \]

[Out]

1/2*x/a-sinh(x)/a+1/2*cosh(x)*sinh(x)/a

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2918, 2717, 2715, 8} \begin {gather*} \frac {x}{2 a}-\frac {\sinh (x)}{a}+\frac {\sinh (x) \cosh (x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 8

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

Rule 2715

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] && Integ
erQ[2*n]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2918

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\sinh ^2(x)}{a+a \text {sech}(x)} \, dx &=-\int \frac {\cosh (x) \sinh ^2(x)}{-a-a \cosh (x)} \, dx\\ &=-\frac {\int \cosh (x) \, dx}{a}+\frac {\int \cosh ^2(x) \, dx}{a}\\ &=-\frac {\sinh (x)}{a}+\frac {\cosh (x) \sinh (x)}{2 a}+\frac {\int 1 \, dx}{2 a}\\ &=\frac {x}{2 a}-\frac {\sinh (x)}{a}+\frac {\cosh (x) \sinh (x)}{2 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 16, normalized size = 0.59 \begin {gather*} \frac {x+(-2+\cosh (x)) \sinh (x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(64\) vs. \(2(23)=46\).
time = 0.58, size = 65, normalized size = 2.41

method result size
risch \(\frac {x}{2 a}+\frac {{\mathrm e}^{2 x}}{8 a}-\frac {{\mathrm e}^{x}}{2 a}+\frac {{\mathrm e}^{-x}}{2 a}-\frac {{\mathrm e}^{-2 x}}{8 a}\) \(42\)
default \(\frac {\frac {1}{2 \left (\tanh \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {3}{2 \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2}-\frac {1}{2 \left (\tanh \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {3}{2 \left (\tanh \left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{2}}{a}\) \(65\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sinh(x)^2/(a+a*sech(x)),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 42, normalized size = 1.56 \begin {gather*} -\frac {{\left (4 \, e^{\left (-x\right )} - 1\right )} e^{\left (2 \, x\right )}}{8 \, a} + \frac {x}{2 \, a} + \frac {4 \, e^{\left (-x\right )} - e^{\left (-2 \, x\right )}}{8 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(x)^2/(a+a*sech(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 14, normalized size = 0.52 \begin {gather*} \frac {{\left (\cosh \left (x\right ) - 2\right )} \sinh \left (x\right ) + x}{2 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*((cosh(x) - 2)*sinh(x) + x)/a

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sinh ^{2}{\left (x \right )}}{\operatorname {sech}{\left (x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(x)**2/(a+a*sech(x)),x)

[Out]

Integral(sinh(x)**2/(sech(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.39, size = 28, normalized size = 1.04 \begin {gather*} \frac {{\left (4 \, e^{x} - 1\right )} e^{\left (-2 \, x\right )} + 4 \, x + e^{\left (2 \, x\right )} - 4 \, e^{x}}{8 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.34, size = 41, normalized size = 1.52 \begin {gather*} \frac {{\mathrm {e}}^{-x}}{2\,a}-\frac {{\mathrm {e}}^{-2\,x}}{8\,a}+\frac {{\mathrm {e}}^{2\,x}}{8\,a}+\frac {x}{2\,a}-\frac {{\mathrm {e}}^x}{2\,a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

exp(-x)/(2*a) - exp(-2*x)/(8*a) + exp(2*x)/(8*a) + x/(2*a) - exp(x)/(2*a)

________________________________________________________________________________________