Integrand size = 13, antiderivative size = 60 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=\frac {2 a b \text {arctanh}\left (\frac {a-b \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac {\text {sech}(x) (b-a \sinh (x))}{a^2+b^2} \]
2*a*b*arctanh((a-b*tanh(1/2*x))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)-sech(x)*( b-a*sinh(x))/(a^2+b^2)
Time = 0.18 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.12 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=\frac {-b \text {sech}(x)+a \left (-\frac {2 b \arctan \left (\frac {a-b \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2-b^2}}\right )}{\sqrt {-a^2-b^2}}+\tanh (x)\right )}{a^2+b^2} \]
(-(b*Sech[x]) + a*((-2*b*ArcTan[(a - b*Tanh[x/2])/Sqrt[-a^2 - b^2]])/Sqrt[ -a^2 - b^2] + Tanh[x]))/(a^2 + b^2)
Result contains complex when optimal does not.
Time = 0.42 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.22, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {3042, 4360, 26, 26, 3042, 26, 3345, 26, 27, 3042, 3139, 1083, 219}
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 {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cos (i x)^2 (a+i b \csc (i x))}dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \frac {i \tanh (x) \text {sech}(x)}{i a \sinh (x)+i b}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \int -\frac {i \text {sech}(x) \tanh (x)}{b+a \sinh (x)}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \int \frac {\tanh (x) \text {sech}(x)}{a \sinh (x)+b}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {i \sin (i x)}{\cos (i x)^2 (b-i a \sin (i x))}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i \int \frac {\sin (i x)}{\cos (i x)^2 (b-i a \sin (i x))}dx\) |
\(\Big \downarrow \) 3345 |
\(\displaystyle -i \left (-\frac {\int \frac {i a b}{b+a \sinh (x)}dx}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i \left (-\frac {i \int \frac {a b}{b+a \sinh (x)}dx}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle -i \left (-\frac {i a b \int \frac {1}{b+a \sinh (x)}dx}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -i \left (-\frac {i a b \int \frac {1}{b-i a \sin (i x)}dx}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle -i \left (-\frac {2 i a b \int \frac {1}{-b \tanh ^2\left (\frac {x}{2}\right )+2 a \tanh \left (\frac {x}{2}\right )+b}d\tanh \left (\frac {x}{2}\right )}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -i \left (\frac {4 i a b \int \frac {1}{4 \left (a^2+b^2\right )-\left (2 a-2 b \tanh \left (\frac {x}{2}\right )\right )^2}d\left (2 a-2 b \tanh \left (\frac {x}{2}\right )\right )}{a^2+b^2}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -i \left (\frac {2 i a b \text {arctanh}\left (\frac {2 a-2 b \tanh \left (\frac {x}{2}\right )}{2 \sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac {i \text {sech}(x) (b-a \sinh (x))}{a^2+b^2}\right )\) |
(-I)*(((2*I)*a*b*ArcTanh[(2*a - 2*b*Tanh[x/2])/(2*Sqrt[a^2 + b^2])])/(a^2 + b^2)^(3/2) - (I*Sech[x]*(b - a*Sinh[x]))/(a^2 + b^2))
3.1.98.3.1 Defintions of rubi rules used
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *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[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(g*Co s[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m + 1)*((b*c - a*d - (a*c - b*d)* Sin[e + f*x])/(f*g*(a^2 - b^2)*(p + 1))), x] + Simp[1/(g^2*(a^2 - b^2)*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^m*Simp[c*(a^2*(p + 2) - b^2*(m + p + 2)) + a*b*d*m + b*(a*c - b*d)*(m + p + 3)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && Lt Q[p, -1] && IntegerQ[2*m]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
Time = 0.49 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.35
method | result | size |
default | \(\frac {4 a b \,\operatorname {arctanh}\left (\frac {-2 b \tanh \left (\frac {x}{2}\right )+2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (2 a^{2}+2 b^{2}\right ) \sqrt {a^{2}+b^{2}}}-\frac {2 \left (-a \tanh \left (\frac {x}{2}\right )+b \right )}{\left (a^{2}+b^{2}\right ) \left (1+\tanh \left (\frac {x}{2}\right )^{2}\right )}\) | \(81\) |
risch | \(-\frac {2 \left ({\mathrm e}^{x} b +a \right )}{\left (1+{\mathrm e}^{2 x}\right ) \left (a^{2}+b^{2}\right )}+\frac {b a \ln \left ({\mathrm e}^{x}+\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} b +a^{4}+2 a^{2} b^{2}+b^{4}}{a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}-\frac {b a \ln \left ({\mathrm e}^{x}+\frac {\left (a^{2}+b^{2}\right )^{\frac {3}{2}} b -a^{4}-2 a^{2} b^{2}-b^{4}}{a \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\) | \(142\) |
4*a*b/(2*a^2+2*b^2)/(a^2+b^2)^(1/2)*arctanh(1/2*(-2*b*tanh(1/2*x)+2*a)/(a^ 2+b^2)^(1/2))-2/(a^2+b^2)*(-a*tanh(1/2*x)+b)/(1+tanh(1/2*x)^2)
Leaf count of result is larger than twice the leaf count of optimal. 256 vs. \(2 (56) = 112\).
Time = 0.24 (sec) , antiderivative size = 256, normalized size of antiderivative = 4.27 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=-\frac {2 \, a^{3} + 2 \, a b^{2} - {\left (a b \cosh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) \sinh \left (x\right ) + a b \sinh \left (x\right )^{2} + a b\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 ) + 2 \, {\left (a^{2} b + b^{3}\right )} \cosh \left (x\right ) + 2 \, {\left (a^{2} b + b^{3}\right )} \sinh \left (x\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )^{2}} \]
-(2*a^3 + 2*a*b^2 - (a*b*cosh(x)^2 + 2*a*b*cosh(x)*sinh(x) + a*b*sinh(x)^2 + a*b)*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)*sinh(x) + 2*sqrt(a^2 + b^2)*(a*cosh (x) + a*sinh(x) + b))/(a*cosh(x)^2 + a*sinh(x)^2 + 2*b*cosh(x) + 2*(a*cosh (x) + b)*sinh(x) - a)) + 2*(a^2*b + b^3)*cosh(x) + 2*(a^2*b + b^3)*sinh(x) )/(a^4 + 2*a^2*b^2 + b^4 + (a^4 + 2*a^2*b^2 + b^4)*cosh(x)^2 + 2*(a^4 + 2* a^2*b^2 + b^4)*cosh(x)*sinh(x) + (a^4 + 2*a^2*b^2 + b^4)*sinh(x)^2)
\[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=\int \frac {\operatorname {sech}^{2}{\left (x \right )}}{a + b \operatorname {csch}{\left (x \right )}}\, dx \]
Time = 0.27 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.52 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=-\frac {a b \log \left (\frac {a e^{\left (-x\right )} - b - \sqrt {a^{2} + b^{2}}}{a e^{\left (-x\right )} - b + \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b e^{\left (-x\right )} - a\right )}}{a^{2} + b^{2} + {\left (a^{2} + b^{2}\right )} e^{\left (-2 \, x\right )}} \]
-a*b*log((a*e^(-x) - b - sqrt(a^2 + b^2))/(a*e^(-x) - b + sqrt(a^2 + b^2)) )/(a^2 + b^2)^(3/2) - 2*(b*e^(-x) - a)/(a^2 + b^2 + (a^2 + b^2)*e^(-2*x))
Time = 0.30 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.42 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=-\frac {a b \log \left (\frac {{\left | 2 \, a e^{x} + 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a e^{x} + 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b e^{x} + a\right )}}{{\left (a^{2} + b^{2}\right )} {\left (e^{\left (2 \, x\right )} + 1\right )}} \]
-a*b*log(abs(2*a*e^x + 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*e^x + 2*b + 2*sqrt (a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2*(b*e^x + a)/((a^2 + b^2)*(e^(2*x) + 1) )
Time = 2.37 (sec) , antiderivative size = 133, normalized size of antiderivative = 2.22 \[ \int \frac {\text {sech}^2(x)}{a+b \text {csch}(x)} \, dx=\frac {a\,b\,\ln \left (\frac {2\,b\,\left (a-b\,{\mathrm {e}}^x\right )}{{\left (a^2+b^2\right )}^{3/2}}+\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}\right )}{{\left (a^2+b^2\right )}^{3/2}}-\frac {a\,b\,\ln \left (\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}-\frac {2\,b\,\left (a-b\,{\mathrm {e}}^x\right )}{{\left (a^2+b^2\right )}^{3/2}}\right )}{{\left (a^2+b^2\right )}^{3/2}}-\frac {\frac {2\,a}{a^2+b^2}+\frac {2\,b\,{\mathrm {e}}^x}{a^2+b^2}}{{\mathrm {e}}^{2\,x}+1} \]