3.92 \(\int \frac{1}{(a+b \text{sech}(c+d x))^2} \, dx\)

Optimal. Leaf size=109 \[ -\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 d (a-b)^{3/2} (a+b)^{3/2}}+\frac{b^2 \tanh (c+d x)}{a d \left (a^2-b^2\right ) (a+b \text{sech}(c+d x))}+\frac{x}{a^2} \]

[Out]

x/a^2 - (2*b*(2*a^2 - b^2)*ArcTan[(Sqrt[a - b]*Tanh[(c + d*x)/2])/Sqrt[a + b]])/(a^2*(a - b)^(3/2)*(a + b)^(3/
2)*d) + (b^2*Tanh[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Sech[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.158986, antiderivative size = 109, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {3785, 3919, 3831, 2659, 208} \[ -\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 d (a-b)^{3/2} (a+b)^{3/2}}+\frac{b^2 \tanh (c+d x)}{a d \left (a^2-b^2\right ) (a+b \text{sech}(c+d x))}+\frac{x}{a^2} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sech[c + d*x])^(-2),x]

[Out]

x/a^2 - (2*b*(2*a^2 - b^2)*ArcTan[(Sqrt[a - b]*Tanh[(c + d*x)/2])/Sqrt[a + b]])/(a^2*(a - b)^(3/2)*(a + b)^(3/
2)*d) + (b^2*Tanh[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Sech[c + d*x]))

Rule 3785

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

Rule 3919

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(c*x)/a,
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{1}{(a+b \text{sech}(c+d x))^2} \, dx &=\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\int \frac{-a^2+b^2+a b \text{sech}(c+d x)}{a+b \text{sech}(c+d x)} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\left (b \left (2 a^2-b^2\right )\right ) \int \frac{\text{sech}(c+d x)}{a+b \text{sech}(c+d x)} \, dx}{a^2 \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}-\frac{\left (2 a^2-b^2\right ) \int \frac{1}{1+\frac{a \cosh (c+d x)}{b}} \, dx}{a^2 \left (a^2-b^2\right )}\\ &=\frac{x}{a^2}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}+\frac{\left (2 i \left (2 a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}+\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (i c+i d x)\right )\right )}{a^2 \left (a^2-b^2\right ) d}\\ &=\frac{x}{a^2}-\frac{2 b \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{\sqrt{a-b} \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{a^2 (a-b)^{3/2} (a+b)^{3/2} d}+\frac{b^2 \tanh (c+d x)}{a \left (a^2-b^2\right ) d (a+b \text{sech}(c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.402178, size = 203, normalized size = 1.86 \[ \frac{b \left (\left (a^2-b^2\right )^{3/2} (c+d x)+a b \sqrt{a^2-b^2} \sinh (c+d x)+\left (4 a^2 b-2 b^3\right ) \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )\right )+a \cosh (c+d x) \left (\left (a^2-b^2\right )^{3/2} (c+d x)+\left (4 a^2 b-2 b^3\right ) \tan ^{-1}\left (\frac{(b-a) \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )\right )}{a^2 d (a-b) (a+b) \sqrt{a^2-b^2} (a \cosh (c+d x)+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sech[c + d*x])^(-2),x]

[Out]

(a*((a^2 - b^2)^(3/2)*(c + d*x) + (4*a^2*b - 2*b^3)*ArcTan[((-a + b)*Tanh[(c + d*x)/2])/Sqrt[a^2 - b^2]])*Cosh
[c + d*x] + b*((a^2 - b^2)^(3/2)*(c + d*x) + (4*a^2*b - 2*b^3)*ArcTan[((-a + b)*Tanh[(c + d*x)/2])/Sqrt[a^2 -
b^2]] + a*b*Sqrt[a^2 - b^2]*Sinh[c + d*x]))/(a^2*(a - b)*(a + b)*Sqrt[a^2 - b^2]*d*(b + a*Cosh[c + d*x]))

________________________________________________________________________________________

Maple [B]  time = 0.046, size = 221, normalized size = 2. \begin{align*}{\frac{1}{d{a}^{2}}\ln \left ( \tanh \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) }-{\frac{1}{d{a}^{2}}\ln \left ( \tanh \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) }+2\,{\frac{{b}^{2}\tanh \left ( 1/2\,dx+c/2 \right ) }{da \left ({a}^{2}-{b}^{2} \right ) \left ( \left ( \tanh \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}a- \left ( \tanh \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}b+a+b \right ) }}-4\,{\frac{b}{d \left ( a+b \right ) \left ( a-b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( 1/2\,dx+c/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{{b}^{3}}{d{a}^{2} \left ( a+b \right ) \left ( a-b \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tanh \left ( 1/2\,dx+c/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*sech(d*x+c))^2,x)

[Out]

1/d/a^2*ln(tanh(1/2*d*x+1/2*c)+1)-1/d/a^2*ln(tanh(1/2*d*x+1/2*c)-1)+2/d/a*b^2/(a^2-b^2)*tanh(1/2*d*x+1/2*c)/(t
anh(1/2*d*x+1/2*c)^2*a-tanh(1/2*d*x+1/2*c)^2*b+a+b)-4/d*b/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tanh(1/
2*d*x+1/2*c)/((a+b)*(a-b))^(1/2))+2/d/a^2*b^3/(a+b)/(a-b)/((a+b)*(a-b))^(1/2)*arctan((a-b)*tanh(1/2*d*x+1/2*c)
/((a+b)*(a-b))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*sech(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.61205, size = 2708, normalized size = 24.84 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*sech(d*x+c))^2,x, algorithm="fricas")

[Out]

[-(2*a^3*b^2 - 2*a*b^4 - (a^5 - 2*a^3*b^2 + a*b^4)*d*x*cosh(d*x + c)^2 - (a^5 - 2*a^3*b^2 + a*b^4)*d*x*sinh(d*
x + c)^2 - (a^5 - 2*a^3*b^2 + a*b^4)*d*x + (2*a^3*b - a*b^3 + (2*a^3*b - a*b^3)*cosh(d*x + c)^2 + (2*a^3*b - a
*b^3)*sinh(d*x + c)^2 + 2*(2*a^2*b^2 - b^4)*cosh(d*x + c) + 2*(2*a^2*b^2 - b^4 + (2*a^3*b - a*b^3)*cosh(d*x +
c))*sinh(d*x + c))*sqrt(-a^2 + b^2)*log((a^2*cosh(d*x + c)^2 + a^2*sinh(d*x + c)^2 + 2*a*b*cosh(d*x + c) - a^2
 + 2*b^2 + 2*(a^2*cosh(d*x + c) + a*b)*sinh(d*x + c) + 2*sqrt(-a^2 + b^2)*(a*cosh(d*x + c) + a*sinh(d*x + c) +
 b))/(a*cosh(d*x + c)^2 + a*sinh(d*x + c)^2 + 2*b*cosh(d*x + c) + 2*(a*cosh(d*x + c) + b)*sinh(d*x + c) + a))
+ 2*(a^2*b^3 - b^5 - (a^4*b - 2*a^2*b^3 + b^5)*d*x)*cosh(d*x + c) + 2*(a^2*b^3 - b^5 - (a^5 - 2*a^3*b^2 + a*b^
4)*d*x*cosh(d*x + c) - (a^4*b - 2*a^2*b^3 + b^5)*d*x)*sinh(d*x + c))/((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cosh(d*x +
 c)^2 + (a^7 - 2*a^5*b^2 + a^3*b^4)*d*sinh(d*x + c)^2 + 2*(a^6*b - 2*a^4*b^3 + a^2*b^5)*d*cosh(d*x + c) + (a^7
 - 2*a^5*b^2 + a^3*b^4)*d + 2*((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cosh(d*x + c) + (a^6*b - 2*a^4*b^3 + a^2*b^5)*d)*
sinh(d*x + c)), -(2*a^3*b^2 - 2*a*b^4 - (a^5 - 2*a^3*b^2 + a*b^4)*d*x*cosh(d*x + c)^2 - (a^5 - 2*a^3*b^2 + a*b
^4)*d*x*sinh(d*x + c)^2 - (a^5 - 2*a^3*b^2 + a*b^4)*d*x - 2*(2*a^3*b - a*b^3 + (2*a^3*b - a*b^3)*cosh(d*x + c)
^2 + (2*a^3*b - a*b^3)*sinh(d*x + c)^2 + 2*(2*a^2*b^2 - b^4)*cosh(d*x + c) + 2*(2*a^2*b^2 - b^4 + (2*a^3*b - a
*b^3)*cosh(d*x + c))*sinh(d*x + c))*sqrt(a^2 - b^2)*arctan(-(a*cosh(d*x + c) + a*sinh(d*x + c) + b)/sqrt(a^2 -
 b^2)) + 2*(a^2*b^3 - b^5 - (a^4*b - 2*a^2*b^3 + b^5)*d*x)*cosh(d*x + c) + 2*(a^2*b^3 - b^5 - (a^5 - 2*a^3*b^2
 + a*b^4)*d*x*cosh(d*x + c) - (a^4*b - 2*a^2*b^3 + b^5)*d*x)*sinh(d*x + c))/((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cos
h(d*x + c)^2 + (a^7 - 2*a^5*b^2 + a^3*b^4)*d*sinh(d*x + c)^2 + 2*(a^6*b - 2*a^4*b^3 + a^2*b^5)*d*cosh(d*x + c)
 + (a^7 - 2*a^5*b^2 + a^3*b^4)*d + 2*((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cosh(d*x + c) + (a^6*b - 2*a^4*b^3 + a^2*b
^5)*d)*sinh(d*x + c))]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\left (a + b \operatorname{sech}{\left (c + d x \right )}\right )^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*sech(d*x+c))**2,x)

[Out]

Integral((a + b*sech(c + d*x))**(-2), x)

________________________________________________________________________________________

Giac [A]  time = 1.12446, size = 185, normalized size = 1.7 \begin{align*} -\frac{2 \,{\left (2 \, a^{2} b - b^{3}\right )} \arctan \left (\frac{a e^{\left (d x + c\right )} + b}{\sqrt{a^{2} - b^{2}}}\right )}{{\left (a^{4} d - a^{2} b^{2} d\right )} \sqrt{a^{2} - b^{2}}} - \frac{2 \,{\left (b^{3} e^{\left (d x + c\right )} + a b^{2}\right )}}{{\left (a^{4} d - a^{2} b^{2} d\right )}{\left (a e^{\left (2 \, d x + 2 \, c\right )} + 2 \, b e^{\left (d x + c\right )} + a\right )}} + \frac{d x + c}{a^{2} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*sech(d*x+c))^2,x, algorithm="giac")

[Out]

-2*(2*a^2*b - b^3)*arctan((a*e^(d*x + c) + b)/sqrt(a^2 - b^2))/((a^4*d - a^2*b^2*d)*sqrt(a^2 - b^2)) - 2*(b^3*
e^(d*x + c) + a*b^2)/((a^4*d - a^2*b^2*d)*(a*e^(2*d*x + 2*c) + 2*b*e^(d*x + c) + a)) + (d*x + c)/(a^2*d)