3.1.70 \(\int \frac {\cosh ^2(x)}{a+a \text {sech}(x)} \, dx\) [70]

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

[Out]

3/2*x/a-2*sinh(x)/a+3/2*cosh(x)*sinh(x)/a-cosh(x)*sinh(x)/(a+a*sech(x))

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 41, 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 = {3904, 3872, 2715, 8, 2717} \begin {gather*} \frac {3 x}{2 a}-\frac {2 \sinh (x)}{a}+\frac {3 \sinh (x) \cosh (x)}{2 a}-\frac {\sinh (x) \cosh (x)}{a \text {sech}(x)+a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3904

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[Cot[e + f*x
]*((d*Csc[e + f*x])^n/(f*(a + b*Csc[e + f*x]))), x] - Dist[1/a^2, Int[(d*Csc[e + f*x])^n*(a*(n - 1) - b*n*Csc[
e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && LtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 45, normalized size = 1.10 \begin {gather*} \frac {\text {sech}\left (\frac {x}{2}\right ) \left (12 x \cosh \left (\frac {x}{2}\right )-12 \sinh \left (\frac {x}{2}\right )-3 \sinh \left (\frac {3 x}{2}\right )+\sinh \left (\frac {5 x}{2}\right )\right )}{8 a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(Sech[x/2]*(12*x*Cosh[x/2] - 12*Sinh[x/2] - 3*Sinh[(3*x)/2] + Sinh[(5*x)/2]))/(8*a)

________________________________________________________________________________________

Maple [A]
time = 0.77, size = 70, normalized size = 1.71

method result size
risch \(\frac {3 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}+\frac {2}{\left ({\mathrm e}^{x}+1\right ) a}\) \(53\)
default \(\frac {-\tanh \left (\frac {x}{2}\right )-\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 {3 \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 {3 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{2}}{a}\) \(70\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/a*(-tanh(1/2*x)-1/2/(tanh(1/2*x)+1)^2+3/2/(tanh(1/2*x)+1)+3/2*ln(tanh(1/2*x)+1)+1/2/(tanh(1/2*x)-1)^2+3/2/(t
anh(1/2*x)-1)-3/2*ln(tanh(1/2*x)-1))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 56, normalized size = 1.37 \begin {gather*} \frac {3 \, x}{2 \, a} + \frac {4 \, e^{\left (-x\right )} - e^{\left (-2 \, x\right )}}{8 \, a} - \frac {3 \, e^{\left (-x\right )} + 20 \, e^{\left (-2 \, x\right )} - 1}{8 \, {\left (a e^{\left (-2 \, x\right )} + a e^{\left (-3 \, x\right )}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 70, normalized size = 1.71 \begin {gather*} \frac {\cosh \left (x\right )^{3} + {\left (3 \, \cosh \left (x\right ) - 4\right )} \sinh \left (x\right )^{2} + \sinh \left (x\right )^{3} + {\left (12 \, x - 1\right )} \cosh \left (x\right ) - 4 \, \cosh \left (x\right )^{2} + {\left (3 \, \cosh \left (x\right )^{2} + 12 \, x - 4 \, \cosh \left (x\right ) - 7\right )} \sinh \left (x\right ) + 12 \, x + 20}{8 \, {\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*(cosh(x)^3 + (3*cosh(x) - 4)*sinh(x)^2 + sinh(x)^3 + (12*x - 1)*cosh(x) - 4*cosh(x)^2 + (3*cosh(x)^2 + 12*
x - 4*cosh(x) - 7)*sinh(x) + 12*x + 20)/(a*cosh(x) + a*sinh(x) + a)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cosh ^{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(cosh(x)**2/(a+a*sech(x)),x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.36, size = 52, normalized size = 1.27 \begin {gather*} \frac {{\mathrm {e}}^{-x}}{2\,a}-\frac {{\mathrm {e}}^{-2\,x}}{8\,a}+\frac {{\mathrm {e}}^{2\,x}}{8\,a}+\frac {3\,x}{2\,a}+\frac {2}{a\,\left ({\mathrm {e}}^x+1\right )}-\frac {{\mathrm {e}}^x}{2\,a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________