Integrand size = 14, antiderivative size = 46 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\frac {x}{a}-\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b} d} \] Output:
x/a-b^(1/2)*arctanh(b^(1/2)*tanh(d*x+c)/(a+b)^(1/2))/a/(a+b)^(1/2)/d
Leaf count is larger than twice the leaf count of optimal. \(172\) vs. \(2(46)=92\).
Time = 1.27 (sec) , antiderivative size = 172, normalized size of antiderivative = 3.74 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\frac {(a+2 b+a \cosh (2 (c+d x))) \text {sech}^2(c+d x) \left (\sqrt {a+b} d x \sqrt {b (\cosh (c)-\sinh (c))^4}+b \text {arctanh}\left (\frac {\text {sech}(d x) (\cosh (2 c)-\sinh (2 c)) ((a+2 b) \sinh (d x)-a \sinh (2 c+d x))}{2 \sqrt {a+b} \sqrt {b (\cosh (c)-\sinh (c))^4}}\right ) (-\cosh (2 c)+\sinh (2 c))\right )}{2 a \sqrt {a+b} d \left (a+b \text {sech}^2(c+d x)\right ) \sqrt {b (\cosh (c)-\sinh (c))^4}} \] Input:
Integrate[(a + b*Sech[c + d*x]^2)^(-1),x]
Output:
((a + 2*b + a*Cosh[2*(c + d*x)])*Sech[c + d*x]^2*(Sqrt[a + b]*d*x*Sqrt[b*( Cosh[c] - Sinh[c])^4] + b*ArcTanh[(Sech[d*x]*(Cosh[2*c] - Sinh[2*c])*((a + 2*b)*Sinh[d*x] - a*Sinh[2*c + d*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cosh[c] - Sin h[c])^4])]*(-Cosh[2*c] + Sinh[2*c])))/(2*a*Sqrt[a + b]*d*(a + b*Sech[c + d *x]^2)*Sqrt[b*(Cosh[c] - Sinh[c])^4])
Time = 0.28 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 4615, 3042, 3660, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{a+b \sec (i c+i d x)^2}dx\) |
\(\Big \downarrow \) 4615 |
\(\displaystyle \frac {x}{a}-\frac {b \int \frac {1}{a \cosh ^2(c+d x)+b}dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{a}-\frac {b \int \frac {1}{a \sin \left (i c+i d x+\frac {\pi }{2}\right )^2+b}dx}{a}\) |
\(\Big \downarrow \) 3660 |
\(\displaystyle \frac {x}{a}-\frac {b \int \frac {1}{b-(a+b) \coth ^2(c+d x)}d\coth (c+d x)}{a d}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {x}{a}-\frac {\sqrt {b} \text {arctanh}\left (\frac {\sqrt {a+b} \coth (c+d x)}{\sqrt {b}}\right )}{a d \sqrt {a+b}}\) |
Input:
Int[(a + b*Sech[c + d*x]^2)^(-1),x]
Output:
x/a - (Sqrt[b]*ArcTanh[(Sqrt[a + b]*Coth[c + d*x])/Sqrt[b]])/(a*Sqrt[a + b ]*d)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Subst[Int[1/(a + (a + b)*ff^2*x^ 2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> Simp[x/a, x ] - Simp[b/a Int[1/(b + a*Cos[e + f*x]^2), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a + b, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(107\) vs. \(2(38)=76\).
Time = 0.29 (sec) , antiderivative size = 108, normalized size of antiderivative = 2.35
method | result | size |
risch | \(\frac {x}{a}+\frac {\sqrt {b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a +2 \sqrt {b \left (a +b \right )}+2 b}{a}\right )}{2 \left (a +b \right ) d a}-\frac {\sqrt {b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {-a +2 \sqrt {b \left (a +b \right )}-2 b}{a}\right )}{2 \left (a +b \right ) d a}\) | \(108\) |
derivativedivides | \(\frac {\frac {2 b \left (-\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{a}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a}}{d}\) | \(142\) |
default | \(\frac {\frac {2 b \left (-\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{a}-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a}}{d}\) | \(142\) |
Input:
int(1/(a+b*sech(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
x/a+1/2*(b*(a+b))^(1/2)/(a+b)/d/a*ln(exp(2*d*x+2*c)+(a+2*(b*(a+b))^(1/2)+2 *b)/a)-1/2*(b*(a+b))^(1/2)/(a+b)/d/a*ln(exp(2*d*x+2*c)-(-a+2*(b*(a+b))^(1/ 2)-2*b)/a)
Leaf count of result is larger than twice the leaf count of optimal. 79 vs. \(2 (38) = 76\).
Time = 0.36 (sec) , antiderivative size = 436, normalized size of antiderivative = 9.48 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\left [\frac {2 \, d x + \sqrt {\frac {b}{a + b}} \log \left (\frac {a^{2} \cosh \left (d x + c\right )^{4} + 4 \, a^{2} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a^{2} \sinh \left (d x + c\right )^{4} + 2 \, {\left (a^{2} + 2 \, a b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, a^{2} \cosh \left (d x + c\right )^{2} + a^{2} + 2 \, a b\right )} \sinh \left (d x + c\right )^{2} + a^{2} + 8 \, a b + 8 \, b^{2} + 4 \, {\left (a^{2} \cosh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left ({\left (a^{2} + a b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{2} + a b\right )} \sinh \left (d x + c\right )^{2} + a^{2} + 3 \, a b + 2 \, b^{2}\right )} \sqrt {\frac {b}{a + b}}}{a \cosh \left (d x + c\right )^{4} + 4 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a \sinh \left (d x + c\right )^{4} + 2 \, {\left (a + 2 \, b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, a \cosh \left (d x + c\right )^{2} + a + 2 \, b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (a \cosh \left (d x + c\right )^{3} + {\left (a + 2 \, b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a}\right )}{2 \, a d}, \frac {d x - \sqrt {-\frac {b}{a + b}} \arctan \left (\frac {{\left (a \cosh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a \sinh \left (d x + c\right )^{2} + a + 2 \, b\right )} \sqrt {-\frac {b}{a + b}}}{2 \, b}\right )}{a d}\right ] \] Input:
integrate(1/(a+b*sech(d*x+c)^2),x, algorithm="fricas")
Output:
[1/2*(2*d*x + sqrt(b/(a + b))*log((a^2*cosh(d*x + c)^4 + 4*a^2*cosh(d*x + c)*sinh(d*x + c)^3 + a^2*sinh(d*x + c)^4 + 2*(a^2 + 2*a*b)*cosh(d*x + c)^2 + 2*(3*a^2*cosh(d*x + c)^2 + a^2 + 2*a*b)*sinh(d*x + c)^2 + a^2 + 8*a*b + 8*b^2 + 4*(a^2*cosh(d*x + c)^3 + (a^2 + 2*a*b)*cosh(d*x + c))*sinh(d*x + c) + 4*((a^2 + a*b)*cosh(d*x + c)^2 + 2*(a^2 + a*b)*cosh(d*x + c)*sinh(d*x + c) + (a^2 + a*b)*sinh(d*x + c)^2 + a^2 + 3*a*b + 2*b^2)*sqrt(b/(a + b)) )/(a*cosh(d*x + c)^4 + 4*a*cosh(d*x + c)*sinh(d*x + c)^3 + a*sinh(d*x + c) ^4 + 2*(a + 2*b)*cosh(d*x + c)^2 + 2*(3*a*cosh(d*x + c)^2 + a + 2*b)*sinh( d*x + c)^2 + 4*(a*cosh(d*x + c)^3 + (a + 2*b)*cosh(d*x + c))*sinh(d*x + c) + a)))/(a*d), (d*x - sqrt(-b/(a + b))*arctan(1/2*(a*cosh(d*x + c)^2 + 2*a *cosh(d*x + c)*sinh(d*x + c) + a*sinh(d*x + c)^2 + a + 2*b)*sqrt(-b/(a + b ))/b))/(a*d)]
\[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\int \frac {1}{a + b \operatorname {sech}^{2}{\left (c + d x \right )}}\, dx \] Input:
integrate(1/(a+b*sech(d*x+c)**2),x)
Output:
Integral(1/(a + b*sech(c + d*x)**2), x)
Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (38) = 76\).
Time = 0.12 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.80 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\frac {b \log \left (\frac {a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b - 2 \, \sqrt {{\left (a + b\right )} b}}{a e^{\left (-2 \, d x - 2 \, c\right )} + a + 2 \, b + 2 \, \sqrt {{\left (a + b\right )} b}}\right )}{2 \, \sqrt {{\left (a + b\right )} b} a d} + \frac {d x + c}{a d} \] Input:
integrate(1/(a+b*sech(d*x+c)^2),x, algorithm="maxima")
Output:
1/2*b*log((a*e^(-2*d*x - 2*c) + a + 2*b - 2*sqrt((a + b)*b))/(a*e^(-2*d*x - 2*c) + a + 2*b + 2*sqrt((a + b)*b)))/(sqrt((a + b)*b)*a*d) + (d*x + c)/( a*d)
Time = 0.15 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.39 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=-\frac {\frac {b \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + a + 2 \, b}{2 \, \sqrt {-a b - b^{2}}}\right )}{\sqrt {-a b - b^{2}} a} - \frac {d x + c}{a}}{d} \] Input:
integrate(1/(a+b*sech(d*x+c)^2),x, algorithm="giac")
Output:
-(b*arctan(1/2*(a*e^(2*d*x + 2*c) + a + 2*b)/sqrt(-a*b - b^2))/(sqrt(-a*b - b^2)*a) - (d*x + c)/a)/d
Time = 2.98 (sec) , antiderivative size = 470, normalized size of antiderivative = 10.22 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\frac {x}{a}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\left (a^5\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}+a^4\,b\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\right )\,\left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}\,\left (\frac {2\,\left (a^2+8\,a\,b+8\,b^2\right )\,\left (8\,b^{5/2}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}+8\,a\,b^{3/2}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}+a^2\,\sqrt {b}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\right )}{a^8\,d\,{\left (a+b\right )}^2\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}}+\frac {4\,\sqrt {b}\,\left (2\,a+4\,b\right )\,\left (4\,d\,a^3\,b+12\,d\,a^2\,b^2+8\,d\,a\,b^3\right )}{a^7\,\left (a+b\right )\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}\right )+\frac {2\,\left (2\,a\,b^{3/2}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}+a^2\,\sqrt {b}\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\right )\,\left (a^2+8\,a\,b+8\,b^2\right )}{a^8\,d\,{\left (a+b\right )}^2\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}}+\frac {4\,\sqrt {b}\,\left (2\,d\,a^3\,b+2\,d\,a^2\,b^2\right )\,\left (2\,a+4\,b\right )}{a^7\,\left (a+b\right )\,\sqrt {-a^3\,d^2-b\,a^2\,d^2}\,\sqrt {-a^2\,d^2\,\left (a+b\right )}}\right )}{4\,b}\right )}{\sqrt {-a^3\,d^2-b\,a^2\,d^2}} \] Input:
int(1/(a + b/cosh(c + d*x)^2),x)
Output:
x/a + (b^(1/2)*atan(((a^5*(- a^3*d^2 - a^2*b*d^2)^(1/2) + a^4*b*(- a^3*d^2 - a^2*b*d^2)^(1/2))*(exp(2*c)*exp(2*d*x)*((2*(8*a*b + a^2 + 8*b^2)*(8*b^( 5/2)*(- a^3*d^2 - a^2*b*d^2)^(1/2) + 8*a*b^(3/2)*(- a^3*d^2 - a^2*b*d^2)^( 1/2) + a^2*b^(1/2)*(- a^3*d^2 - a^2*b*d^2)^(1/2)))/(a^8*d*(a + b)^2*(- a^3 *d^2 - a^2*b*d^2)^(1/2)) + (4*b^(1/2)*(2*a + 4*b)*(12*a^2*b^2*d + 8*a*b^3* d + 4*a^3*b*d))/(a^7*(a + b)*(- a^3*d^2 - a^2*b*d^2)^(1/2)*(-a^2*d^2*(a + b))^(1/2))) + (2*(2*a*b^(3/2)*(- a^3*d^2 - a^2*b*d^2)^(1/2) + a^2*b^(1/2)* (- a^3*d^2 - a^2*b*d^2)^(1/2))*(8*a*b + a^2 + 8*b^2))/(a^8*d*(a + b)^2*(- a^3*d^2 - a^2*b*d^2)^(1/2)) + (4*b^(1/2)*(2*a^2*b^2*d + 2*a^3*b*d)*(2*a + 4*b))/(a^7*(a + b)*(- a^3*d^2 - a^2*b*d^2)^(1/2)*(-a^2*d^2*(a + b))^(1/2)) ))/(4*b)))/(- a^3*d^2 - a^2*b*d^2)^(1/2)
Time = 0.21 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.85 \[ \int \frac {1}{a+b \text {sech}^2(c+d x)} \, dx=\frac {-\sqrt {b}\, \sqrt {a +b}\, \mathrm {log}\left (-\sqrt {2 \sqrt {b}\, \sqrt {a +b}-a -2 b}+e^{d x +c} \sqrt {a}\right )-\sqrt {b}\, \sqrt {a +b}\, \mathrm {log}\left (\sqrt {2 \sqrt {b}\, \sqrt {a +b}-a -2 b}+e^{d x +c} \sqrt {a}\right )+\sqrt {b}\, \sqrt {a +b}\, \mathrm {log}\left (2 \sqrt {b}\, \sqrt {a +b}+e^{2 d x +2 c} a +a +2 b \right )+2 a d x +2 b d x}{2 a d \left (a +b \right )} \] Input:
int(1/(a+b*sech(d*x+c)^2),x)
Output:
( - sqrt(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e** (c + d*x)*sqrt(a)) - sqrt(b)*sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqrt(a)) + sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt( a + b) + e**(2*c + 2*d*x)*a + a + 2*b) + 2*a*d*x + 2*b*d*x)/(2*a*d*(a + b) )