Integrand size = 13, antiderivative size = 62 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a}-\frac {\arctan (\sinh (x))}{b}+\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a b} \] Output:
x/a-arctan(sinh(x))/b+2*(a-b)^(1/2)*(a+b)^(1/2)*arctan((a-b)^(1/2)*tanh(1/ 2*x)/(a+b)^(1/2))/a/b
Time = 0.09 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {b x-2 a \arctan \left (\tanh \left (\frac {x}{2}\right )\right )-2 \sqrt {a^2-b^2} \arctan \left (\frac {(-a+b) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{a b} \] Input:
Integrate[Tanh[x]^2/(a + b*Sech[x]),x]
Output:
(b*x - 2*a*ArcTan[Tanh[x/2]] - 2*Sqrt[a^2 - b^2]*ArcTan[((-a + b)*Tanh[x/2 ])/Sqrt[a^2 - b^2]])/(a*b)
Time = 1.12 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.19, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.077, Rules used = {3042, 25, 4382, 3042, 4539, 25, 3042, 4257, 4407, 3042, 4318, 3042, 3138, 218}
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 {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {\cot \left (\frac {\pi }{2}+i x\right )^2}{a+b \csc \left (\frac {\pi }{2}+i x\right )}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\cot \left (i x+\frac {\pi }{2}\right )^2}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4382 |
\(\displaystyle -\int \frac {\text {sech}^2(x)-1}{a+b \text {sech}(x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\int \frac {\csc \left (i x+\frac {\pi }{2}\right )^2-1}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4539 |
\(\displaystyle -\frac {\int -\frac {b+a \text {sech}(x)}{a+b \text {sech}(x)}dx}{b}-\frac {\int \text {sech}(x)dx}{b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {b+a \text {sech}(x)}{a+b \text {sech}(x)}dx}{b}-\frac {\int \text {sech}(x)dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {b+a \csc \left (i x+\frac {\pi }{2}\right )}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx}{b}-\frac {\int \csc \left (i x+\frac {\pi }{2}\right )dx}{b}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {\arctan (\sinh (x))}{b}+\frac {\int \frac {b+a \csc \left (i x+\frac {\pi }{2}\right )}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx}{b}\) |
\(\Big \downarrow \) 4407 |
\(\displaystyle \frac {\frac {\left (a^2-b^2\right ) \int \frac {\text {sech}(x)}{a+b \text {sech}(x)}dx}{a}+\frac {b x}{a}}{b}-\frac {\arctan (\sinh (x))}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\arctan (\sinh (x))}{b}+\frac {\frac {b x}{a}+\frac {\left (a^2-b^2\right ) \int \frac {\csc \left (i x+\frac {\pi }{2}\right )}{a+b \csc \left (i x+\frac {\pi }{2}\right )}dx}{a}}{b}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle \frac {\frac {\left (a^2-b^2\right ) \int \frac {1}{\frac {a \cosh (x)}{b}+1}dx}{a b}+\frac {b x}{a}}{b}-\frac {\arctan (\sinh (x))}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\arctan (\sinh (x))}{b}+\frac {\frac {b x}{a}+\frac {\left (a^2-b^2\right ) \int \frac {1}{\frac {a \sin \left (i x+\frac {\pi }{2}\right )}{b}+1}dx}{a b}}{b}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {\frac {2 \left (a^2-b^2\right ) \int \frac {1}{\frac {a+b}{b}-\left (1-\frac {a}{b}\right ) \tanh ^2\left (\frac {x}{2}\right )}d\tanh \left (\frac {x}{2}\right )}{a b}+\frac {b x}{a}}{b}-\frac {\arctan (\sinh (x))}{b}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {2 \left (a^2-b^2\right ) \arctan \left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{a \sqrt {a-b} \sqrt {a+b}}+\frac {b x}{a}}{b}-\frac {\arctan (\sinh (x))}{b}\) |
Input:
Int[Tanh[x]^2/(a + b*Sech[x]),x]
Output:
-(ArcTan[Sinh[x]]/b) + ((b*x)/a + (2*(a^2 - b^2)*ArcTan[(Sqrt[a - b]*Tanh[ x/2])/Sqrt[a + b]])/(a*Sqrt[a - b]*Sqrt[a + b]))/b
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[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]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[1/b Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Int[cot[(c_.) + (d_.)*(x_)]^2*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[(-1 + Csc[c + d*x]^2)*(a + b*Csc[c + d*x])^n, x] /; FreeQ[ {a, b, c, d, n}, x] && NeQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(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]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))/(csc[(e_.) + (f_.)*(x_)]*(b_. ) + (a_)), x_Symbol] :> Simp[C/b Int[Csc[e + f*x], x], x] + Simp[1/b In t[(A*b - a*C*Csc[e + f*x])/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f, A, C}, x]
Time = 0.30 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.35
method | result | size |
default | \(\frac {2 \left (a -b \right ) \left (a +b \right ) \arctan \left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a b \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{a}-\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{a}\) | \(84\) |
risch | \(\frac {x}{a}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}+\frac {b +\sqrt {-a^{2}+b^{2}}}{a}\right )}{b a}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{x}-\frac {\sqrt {-a^{2}+b^{2}}-b}{a}\right )}{b a}+\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{b}-\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{b}\) | \(113\) |
Input:
int(tanh(x)^2/(a+b*sech(x)),x,method=_RETURNVERBOSE)
Output:
2/a*(a-b)*(a+b)/b/((a-b)*(a+b))^(1/2)*arctan((a-b)*tanh(1/2*x)/((a-b)*(a+b ))^(1/2))-1/a*ln(tanh(1/2*x)-1)-2/b*arctan(tanh(1/2*x))+1/a*ln(tanh(1/2*x) +1)
Time = 0.11 (sec) , antiderivative size = 193, normalized size of antiderivative = 3.11 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\left [\frac {b x - 2 \, a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) + \sqrt {-a^{2} + b^{2}} \log \left (\frac {a^{2} \cosh \left (x\right )^{2} + a^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) - a^{2} + 2 \, b^{2} + 2 \, {\left (a^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cosh \left (x\right ) + a \sinh \left (x\right ) + b\right )}}{a \cosh \left (x\right )^{2} + a \sinh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) + 2 \, {\left (a \cosh \left (x\right ) + b\right )} \sinh \left (x\right ) + a}\right )}{a b}, \frac {b x - 2 \, a \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right ) - 2 \, \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cosh \left (x\right ) + a \sinh \left (x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )}{a b}\right ] \] Input:
integrate(tanh(x)^2/(a+b*sech(x)),x, algorithm="fricas")
Output:
[(b*x - 2*a*arctan(cosh(x) + sinh(x)) + sqrt(-a^2 + b^2)*log((a^2*cosh(x)^ 2 + a^2*sinh(x)^2 + 2*a*b*cosh(x) - a^2 + 2*b^2 + 2*(a^2*cosh(x) + a*b)*si nh(x) + 2*sqrt(-a^2 + b^2)*(a*cosh(x) + a*sinh(x) + b))/(a*cosh(x)^2 + a*s inh(x)^2 + 2*b*cosh(x) + 2*(a*cosh(x) + b)*sinh(x) + a)))/(a*b), (b*x - 2* a*arctan(cosh(x) + sinh(x)) - 2*sqrt(a^2 - b^2)*arctan(-(a*cosh(x) + a*sin h(x) + b)/sqrt(a^2 - b^2)))/(a*b)]
\[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\int \frac {\tanh ^{2}{\left (x \right )}}{a + b \operatorname {sech}{\left (x \right )}}\, dx \] Input:
integrate(tanh(x)**2/(a+b*sech(x)),x)
Output:
Integral(tanh(x)**2/(a + b*sech(x)), x)
Exception generated. \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(tanh(x)^2/(a+b*sech(x)),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.11 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.84 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {x}{a} - \frac {2 \, \arctan \left (e^{x}\right )}{b} + \frac {2 \, \sqrt {a^{2} - b^{2}} \arctan \left (\frac {a e^{x} + b}{\sqrt {a^{2} - b^{2}}}\right )}{a b} \] Input:
integrate(tanh(x)^2/(a+b*sech(x)),x, algorithm="giac")
Output:
x/a - 2*arctan(e^x)/b + 2*sqrt(a^2 - b^2)*arctan((a*e^x + b)/sqrt(a^2 - b^ 2))/(a*b)
Time = 4.50 (sec) , antiderivative size = 273, normalized size of antiderivative = 4.40 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}-\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{b}+\frac {\ln \left (2\,a\,b^3-2\,a^3\,b+a^3\,\sqrt {b^2-a^2}+a^4\,{\mathrm {e}}^x+4\,b^4\,{\mathrm {e}}^x-2\,a\,b^2\,\sqrt {b^2-a^2}-4\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-5\,a^2\,b^2\,{\mathrm {e}}^x+3\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )\,\sqrt {b^2-a^2}-\ln \left (2\,a\,b^3-2\,a^3\,b-a^3\,\sqrt {b^2-a^2}+a^4\,{\mathrm {e}}^x+4\,b^4\,{\mathrm {e}}^x+2\,a\,b^2\,\sqrt {b^2-a^2}+4\,b^3\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}-5\,a^2\,b^2\,{\mathrm {e}}^x-3\,a^2\,b\,{\mathrm {e}}^x\,\sqrt {b^2-a^2}\right )\,\sqrt {b^2-a^2}+b\,x}{a\,b} \] Input:
int(tanh(x)^2/(a + b/cosh(x)),x)
Output:
(log(exp(x) - 1i)*1i - log(exp(x) + 1i)*1i)/b + (log(2*a*b^3 - 2*a^3*b + a ^3*(b^2 - a^2)^(1/2) + a^4*exp(x) + 4*b^4*exp(x) - 2*a*b^2*(b^2 - a^2)^(1/ 2) - 4*b^3*exp(x)*(b^2 - a^2)^(1/2) - 5*a^2*b^2*exp(x) + 3*a^2*b*exp(x)*(b ^2 - a^2)^(1/2))*(b^2 - a^2)^(1/2) - log(2*a*b^3 - 2*a^3*b - a^3*(b^2 - a^ 2)^(1/2) + a^4*exp(x) + 4*b^4*exp(x) + 2*a*b^2*(b^2 - a^2)^(1/2) + 4*b^3*e xp(x)*(b^2 - a^2)^(1/2) - 5*a^2*b^2*exp(x) - 3*a^2*b*exp(x)*(b^2 - a^2)^(1 /2))*(b^2 - a^2)^(1/2) + b*x)/(a*b)
Time = 0.22 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.82 \[ \int \frac {\tanh ^2(x)}{a+b \text {sech}(x)} \, dx=\frac {-2 \mathit {atan} \left (e^{x}\right ) a +2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +b}{\sqrt {a^{2}-b^{2}}}\right )+b x}{a b} \] Input:
int(tanh(x)^2/(a+b*sech(x)),x)
Output:
( - 2*atan(e**x)*a + 2*sqrt(a**2 - b**2)*atan((e**x*a + b)/sqrt(a**2 - b** 2)) + b*x)/(a*b)