Integrand size = 13, antiderivative size = 40 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=-\frac {\left (a^2-b^2\right ) \log (a+b \tanh (x))}{b^3}+\frac {a \tanh (x)}{b^2}-\frac {\tanh ^2(x)}{2 b} \] Output:
-(a^2-b^2)*ln(a+b*tanh(x))/b^3+a*tanh(x)/b^2-1/2*tanh(x)^2/b
Time = 0.09 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.02 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=\frac {2 \left (-a^2+b^2\right ) \log (a+b \tanh (x))+2 a b \tanh (x)-b^2 \tanh ^2(x)}{2 b^3} \] Input:
Integrate[Sech[x]^4/(a + b*Tanh[x]),x]
Output:
(2*(-a^2 + b^2)*Log[a + b*Tanh[x]] + 2*a*b*Tanh[x] - b^2*Tanh[x]^2)/(2*b^3 )
Time = 0.27 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.98, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3042, 3987, 27, 476, 2009}
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}^4(x)}{a+b \tanh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (i x)^4}{a-i b \tan (i x)}dx\) |
\(\Big \downarrow \) 3987 |
\(\displaystyle \frac {\int \frac {b^2-b^2 \tanh ^2(x)}{b^2 (a+b \tanh (x))}d(b \tanh (x))}{b}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {b^2-b^2 \tanh ^2(x)}{a+b \tanh (x)}d(b \tanh (x))}{b^3}\) |
\(\Big \downarrow \) 476 |
\(\displaystyle \frac {\int \left (a-b \tanh (x)+\frac {b^2-a^2}{a+b \tanh (x)}\right )d(b \tanh (x))}{b^3}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\left (a^2-b^2\right ) \log (a+b \tanh (x))+a b \tanh (x)-\frac {1}{2} b^2 \tanh ^2(x)}{b^3}\) |
Input:
Int[Sech[x]^4/(a + b*Tanh[x]),x]
Output:
(-((a^2 - b^2)*Log[a + b*Tanh[x]]) + a*b*Tanh[x] - (b^2*Tanh[x]^2)/2)/b^3
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ ExpandIntegrand[(c + d*x)^n*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, n}, x] && IGtQ[p, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[1/(b*f) Subst[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[m/2]
Leaf count of result is larger than twice the leaf count of optimal. \(98\) vs. \(2(38)=76\).
Time = 21.30 (sec) , antiderivative size = 99, normalized size of antiderivative = 2.48
method | result | size |
default | \(-\frac {\left (a^{2}-b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a +2 b \tanh \left (\frac {x}{2}\right )+a \right )}{b^{3}}+\frac {\frac {2 \left (\tanh \left (\frac {x}{2}\right )^{3} a b -b^{2} \tanh \left (\frac {x}{2}\right )^{2}+\tanh \left (\frac {x}{2}\right ) a b \right )}{\left (\tanh \left (\frac {x}{2}\right )^{2}+1\right )^{2}}+\left (a^{2}-b^{2}\right ) \ln \left (\tanh \left (\frac {x}{2}\right )^{2}+1\right )}{b^{3}}\) | \(99\) |
risch | \(-\frac {2 \left ({\mathrm e}^{2 x} a -{\mathrm e}^{2 x} b +a \right )}{\left ({\mathrm e}^{2 x}+1\right )^{2} b^{2}}+\frac {\ln \left ({\mathrm e}^{2 x}+1\right ) a^{2}}{b^{3}}-\frac {\ln \left ({\mathrm e}^{2 x}+1\right )}{b}-\frac {\ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right ) a^{2}}{b^{3}}+\frac {\ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{b}\) | \(102\) |
Input:
int(sech(x)^4/(a+b*tanh(x)),x,method=_RETURNVERBOSE)
Output:
-(a^2-b^2)/b^3*ln(tanh(1/2*x)^2*a+2*b*tanh(1/2*x)+a)+2/b^3*((tanh(1/2*x)^3 *a*b-b^2*tanh(1/2*x)^2+tanh(1/2*x)*a*b)/(tanh(1/2*x)^2+1)^2+1/2*(a^2-b^2)* ln(tanh(1/2*x)^2+1))
Leaf count of result is larger than twice the leaf count of optimal. 430 vs. \(2 (38) = 76\).
Time = 0.11 (sec) , antiderivative size = 430, normalized size of antiderivative = 10.75 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=-\frac {2 \, {\left (a b - b^{2}\right )} \cosh \left (x\right )^{2} + 4 \, {\left (a b - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + 2 \, {\left (a b - b^{2}\right )} \sinh \left (x\right )^{2} + 2 \, a b + {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - b^{2} + 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - b^{2} + 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\frac {2 \, \cosh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{b^{3} \cosh \left (x\right )^{4} + 4 \, b^{3} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{3} \sinh \left (x\right )^{4} + 2 \, b^{3} \cosh \left (x\right )^{2} + b^{3} + 2 \, {\left (3 \, b^{3} \cosh \left (x\right )^{2} + b^{3}\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b^{3} \cosh \left (x\right )^{3} + b^{3} \cosh \left (x\right )\right )} \sinh \left (x\right )} \] Input:
integrate(sech(x)^4/(a+b*tanh(x)),x, algorithm="fricas")
Output:
-(2*(a*b - b^2)*cosh(x)^2 + 4*(a*b - b^2)*cosh(x)*sinh(x) + 2*(a*b - b^2)* sinh(x)^2 + 2*a*b + ((a^2 - b^2)*cosh(x)^4 + 4*(a^2 - b^2)*cosh(x)*sinh(x) ^3 + (a^2 - b^2)*sinh(x)^4 + 2*(a^2 - b^2)*cosh(x)^2 + 2*(3*(a^2 - b^2)*co sh(x)^2 + a^2 - b^2)*sinh(x)^2 + a^2 - b^2 + 4*((a^2 - b^2)*cosh(x)^3 + (a ^2 - b^2)*cosh(x))*sinh(x))*log(2*(a*cosh(x) + b*sinh(x))/(cosh(x) - sinh( x))) - ((a^2 - b^2)*cosh(x)^4 + 4*(a^2 - b^2)*cosh(x)*sinh(x)^3 + (a^2 - b ^2)*sinh(x)^4 + 2*(a^2 - b^2)*cosh(x)^2 + 2*(3*(a^2 - b^2)*cosh(x)^2 + a^2 - b^2)*sinh(x)^2 + a^2 - b^2 + 4*((a^2 - b^2)*cosh(x)^3 + (a^2 - b^2)*cos h(x))*sinh(x))*log(2*cosh(x)/(cosh(x) - sinh(x))))/(b^3*cosh(x)^4 + 4*b^3* cosh(x)*sinh(x)^3 + b^3*sinh(x)^4 + 2*b^3*cosh(x)^2 + b^3 + 2*(3*b^3*cosh( x)^2 + b^3)*sinh(x)^2 + 4*(b^3*cosh(x)^3 + b^3*cosh(x))*sinh(x))
\[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=\int \frac {\operatorname {sech}^{4}{\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \] Input:
integrate(sech(x)**4/(a+b*tanh(x)),x)
Output:
Integral(sech(x)**4/(a + b*tanh(x)), x)
Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (38) = 76\).
Time = 0.12 (sec) , antiderivative size = 89, normalized size of antiderivative = 2.22 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=\frac {2 \, {\left ({\left (a + b\right )} e^{\left (-2 \, x\right )} + a\right )}}{2 \, b^{2} e^{\left (-2 \, x\right )} + b^{2} e^{\left (-4 \, x\right )} + b^{2}} - \frac {{\left (a^{2} - b^{2}\right )} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{b^{3}} + \frac {{\left (a^{2} - b^{2}\right )} \log \left (e^{\left (-2 \, x\right )} + 1\right )}{b^{3}} \] Input:
integrate(sech(x)^4/(a+b*tanh(x)),x, algorithm="maxima")
Output:
2*((a + b)*e^(-2*x) + a)/(2*b^2*e^(-2*x) + b^2*e^(-4*x) + b^2) - (a^2 - b^ 2)*log(-(a - b)*e^(-2*x) - a - b)/b^3 + (a^2 - b^2)*log(e^(-2*x) + 1)/b^3
Leaf count of result is larger than twice the leaf count of optimal. 104 vs. \(2 (38) = 76\).
Time = 0.13 (sec) , antiderivative size = 104, normalized size of antiderivative = 2.60 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=-\frac {{\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a b^{3} + b^{4}} + \frac {{\left (a^{2} - b^{2}\right )} \log \left (e^{\left (2 \, x\right )} + 1\right )}{b^{3}} - \frac {2 \, {\left (a b + {\left (a b - b^{2}\right )} e^{\left (2 \, x\right )}\right )}}{b^{3} {\left (e^{\left (2 \, x\right )} + 1\right )}^{2}} \] Input:
integrate(sech(x)^4/(a+b*tanh(x)),x, algorithm="giac")
Output:
-(a^3 + a^2*b - a*b^2 - b^3)*log(abs(a*e^(2*x) + b*e^(2*x) + a - b))/(a*b^ 3 + b^4) + (a^2 - b^2)*log(e^(2*x) + 1)/b^3 - 2*(a*b + (a*b - b^2)*e^(2*x) )/(b^3*(e^(2*x) + 1)^2)
Time = 2.36 (sec) , antiderivative size = 88, normalized size of antiderivative = 2.20 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=\frac {\ln \left ({\mathrm {e}}^{2\,x}+1\right )\,\left (a+b\right )\,\left (a-b\right )}{b^3}-\frac {2\,\left (a-b\right )}{b^2\,\left ({\mathrm {e}}^{2\,x}+1\right )}-\frac {\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )\,\left (a+b\right )\,\left (a-b\right )}{b^3}-\frac {2}{b\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )} \] Input:
int(1/(cosh(x)^4*(a + b*tanh(x))),x)
Output:
(log(exp(2*x) + 1)*(a + b)*(a - b))/b^3 - (2*(a - b))/(b^2*(exp(2*x) + 1)) - (log(a - b + a*exp(2*x) + b*exp(2*x))*(a + b)*(a - b))/b^3 - 2/(b*(2*ex p(2*x) + exp(4*x) + 1))
Time = 0.23 (sec) , antiderivative size = 312, normalized size of antiderivative = 7.80 \[ \int \frac {\text {sech}^4(x)}{a+b \tanh (x)} \, dx=\frac {e^{4 x} \mathrm {log}\left (e^{2 x}+1\right ) a^{2}-e^{4 x} \mathrm {log}\left (e^{2 x}+1\right ) b^{2}-e^{4 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2}+e^{4 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{2}+e^{4 x} a b -e^{4 x} b^{2}+2 e^{2 x} \mathrm {log}\left (e^{2 x}+1\right ) a^{2}-2 e^{2 x} \mathrm {log}\left (e^{2 x}+1\right ) b^{2}-2 e^{2 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2}+2 e^{2 x} \mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{2}+\mathrm {log}\left (e^{2 x}+1\right ) a^{2}-\mathrm {log}\left (e^{2 x}+1\right ) b^{2}-\mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) a^{2}+\mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{2}-a b -b^{2}}{b^{3} \left (e^{4 x}+2 e^{2 x}+1\right )} \] Input:
int(sech(x)^4/(a+b*tanh(x)),x)
Output:
(e**(4*x)*log(e**(2*x) + 1)*a**2 - e**(4*x)*log(e**(2*x) + 1)*b**2 - e**(4 *x)*log(e**(2*x)*a + e**(2*x)*b + a - b)*a**2 + e**(4*x)*log(e**(2*x)*a + e**(2*x)*b + a - b)*b**2 + e**(4*x)*a*b - e**(4*x)*b**2 + 2*e**(2*x)*log(e **(2*x) + 1)*a**2 - 2*e**(2*x)*log(e**(2*x) + 1)*b**2 - 2*e**(2*x)*log(e** (2*x)*a + e**(2*x)*b + a - b)*a**2 + 2*e**(2*x)*log(e**(2*x)*a + e**(2*x)* b + a - b)*b**2 + log(e**(2*x) + 1)*a**2 - log(e**(2*x) + 1)*b**2 - log(e* *(2*x)*a + e**(2*x)*b + a - b)*a**2 + log(e**(2*x)*a + e**(2*x)*b + a - b) *b**2 - a*b - b**2)/(b**3*(e**(4*x) + 2*e**(2*x) + 1))