\(\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx\) [372]
Optimal result
Integrand size = 16, antiderivative size = 91 \[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\frac {x \arctan \left (e^{a+b x}\right )}{b}-\frac {i \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{2 b^2}+\frac {i \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}
\]
[Out]
x*arctan(exp(b*x+a))/b-1/2*I*polylog(2,-I*exp(b*x+a))/b^2+1/2*I*polylog(2,I*exp(b*x+a))/b^2-1/2*sech(b*x+a)/b^
2-1/2*x*sech(b*x+a)*tanh(b*x+a)/b
Rubi [A] (verified)
Time = 0.08 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of
steps used = 12, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {5563, 4265, 2317, 2438, 4270}
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\frac {x \arctan \left (e^{a+b x}\right )}{b}-\frac {i \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{2 b^2}+\frac {i \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \tanh (a+b x) \text {sech}(a+b x)}{2 b}
\]
[In]
Int[x*Sech[a + b*x]*Tanh[a + b*x]^2,x]
[Out]
(x*ArcTan[E^(a + b*x)])/b - ((I/2)*PolyLog[2, (-I)*E^(a + b*x)])/b^2 + ((I/2)*PolyLog[2, I*E^(a + b*x)])/b^2 -
Sech[a + b*x]/(2*b^2) - (x*Sech[a + b*x]*Tanh[a + b*x])/(2*b)
Rule 2317
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Rule 2438
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
e, n}, x] && EqQ[c*d, 1]
Rule 4265
Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
+ f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]
Rule 4270
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]
*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)*(b*Csc[e + f*x])^(n -
2), x], x] - Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; FreeQ[{b, c, d, e, f}, x] &&
GtQ[n, 1] && NeQ[n, 2]
Rule 5563
Int[((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + (b_.)*(x_)]*Tanh[(a_.) + (b_.)*(x_)]^(p_), x_Symbol] :> Int[(c + d
*x)^m*Sech[a + b*x]*Tanh[a + b*x]^(p - 2), x] - Int[(c + d*x)^m*Sech[a + b*x]^3*Tanh[a + b*x]^(p - 2), x] /; F
reeQ[{a, b, c, d, m}, x] && IGtQ[p/2, 0]
Rubi steps \begin{align*}
\text {integral}& = \int x \text {sech}(a+b x) \, dx-\int x \text {sech}^3(a+b x) \, dx \\ & = \frac {2 x \arctan \left (e^{a+b x}\right )}{b}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}-\frac {1}{2} \int x \text {sech}(a+b x) \, dx-\frac {i \int \log \left (1-i e^{a+b x}\right ) \, dx}{b}+\frac {i \int \log \left (1+i e^{a+b x}\right ) \, dx}{b} \\ & = \frac {x \arctan \left (e^{a+b x}\right )}{b}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}-\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}+\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{a+b x}\right )}{b^2}+\frac {i \int \log \left (1-i e^{a+b x}\right ) \, dx}{2 b}-\frac {i \int \log \left (1+i e^{a+b x}\right ) \, dx}{2 b} \\ & = \frac {x \arctan \left (e^{a+b x}\right )}{b}-\frac {i \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{b^2}+\frac {i \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b}+\frac {i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{a+b x}\right )}{2 b^2}-\frac {i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{a+b x}\right )}{2 b^2} \\ & = \frac {x \arctan \left (e^{a+b x}\right )}{b}-\frac {i \operatorname {PolyLog}\left (2,-i e^{a+b x}\right )}{2 b^2}+\frac {i \operatorname {PolyLog}\left (2,i e^{a+b x}\right )}{2 b^2}-\frac {\text {sech}(a+b x)}{2 b^2}-\frac {x \text {sech}(a+b x) \tanh (a+b x)}{2 b} \\
\end{align*}
Mathematica [A] (verified)
Time = 0.64 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.27
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=-\frac {-i \left (2 i a \arctan \left (e^{a+b x}\right )+(a+b x) \log \left (1-i e^{a+b x}\right )-(a+b x) \log \left (1+i e^{a+b x}\right )-\operatorname {PolyLog}\left (2,-i e^{a+b x}\right )+\operatorname {PolyLog}\left (2,i e^{a+b x}\right )\right )+\text {sech}(a+b x)+b x \text {sech}(a+b x) \tanh (a+b x)}{2 b^2}
\]
[In]
Integrate[x*Sech[a + b*x]*Tanh[a + b*x]^2,x]
[Out]
-1/2*((-I)*((2*I)*a*ArcTan[E^(a + b*x)] + (a + b*x)*Log[1 - I*E^(a + b*x)] - (a + b*x)*Log[1 + I*E^(a + b*x)]
- PolyLog[2, (-I)*E^(a + b*x)] + PolyLog[2, I*E^(a + b*x)]) + Sech[a + b*x] + b*x*Sech[a + b*x]*Tanh[a + b*x])
/b^2
Maple [B] (verified)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf
count of optimal. 177 vs. \(2 (76 ) = 152\).
Time = 1.40 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.96
| | |
method | result | size |
| | |
risch |
\(-\frac {{\mathrm e}^{b x +a} \left ({\mathrm e}^{2 b x +2 a} b x -b x +{\mathrm e}^{2 b x +2 a}+1\right )}{b^{2} \left (1+{\mathrm e}^{2 b x +2 a}\right )^{2}}-\frac {i \ln \left (1+i {\mathrm e}^{b x +a}\right ) x}{2 b}-\frac {i \ln \left (1+i {\mathrm e}^{b x +a}\right ) a}{2 b^{2}}+\frac {i \ln \left (1-i {\mathrm e}^{b x +a}\right ) x}{2 b}+\frac {i \ln \left (1-i {\mathrm e}^{b x +a}\right ) a}{2 b^{2}}-\frac {i \operatorname {dilog}\left (1+i {\mathrm e}^{b x +a}\right )}{2 b^{2}}+\frac {i \operatorname {dilog}\left (1-i {\mathrm e}^{b x +a}\right )}{2 b^{2}}-\frac {a \arctan \left ({\mathrm e}^{b x +a}\right )}{b^{2}}\) |
\(178\) |
| | |
|
|
|
[In]
int(x*sech(b*x+a)^3*sinh(b*x+a)^2,x,method=_RETURNVERBOSE)
[Out]
-exp(b*x+a)*(exp(2*b*x+2*a)*b*x-b*x+exp(2*b*x+2*a)+1)/b^2/(1+exp(2*b*x+2*a))^2-1/2*I/b*ln(1+I*exp(b*x+a))*x-1/
2*I/b^2*ln(1+I*exp(b*x+a))*a+1/2*I/b*ln(1-I*exp(b*x+a))*x+1/2*I/b^2*ln(1-I*exp(b*x+a))*a-1/2*I/b^2*dilog(1+I*e
xp(b*x+a))+1/2*I/b^2*dilog(1-I*exp(b*x+a))-1/b^2*a*arctan(exp(b*x+a))
Fricas [B] (verification not implemented)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf
count of optimal. 1064 vs. \(2 (70) = 140\).
Time = 0.29 (sec) , antiderivative size = 1064, normalized size of antiderivative = 11.69
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\text {Too large to display}
\]
[In]
integrate(x*sech(b*x+a)^3*sinh(b*x+a)^2,x, algorithm="fricas")
[Out]
-1/2*(2*(b*x + 1)*cosh(b*x + a)^3 + 6*(b*x + 1)*cosh(b*x + a)*sinh(b*x + a)^2 + 2*(b*x + 1)*sinh(b*x + a)^3 -
2*(b*x - 1)*cosh(b*x + a) - (I*cosh(b*x + a)^4 + 4*I*cosh(b*x + a)*sinh(b*x + a)^3 + I*sinh(b*x + a)^4 - 2*(-3
*I*cosh(b*x + a)^2 - I)*sinh(b*x + a)^2 + 2*I*cosh(b*x + a)^2 - 4*(-I*cosh(b*x + a)^3 - I*cosh(b*x + a))*sinh(
b*x + a) + I)*dilog(I*cosh(b*x + a) + I*sinh(b*x + a)) - (-I*cosh(b*x + a)^4 - 4*I*cosh(b*x + a)*sinh(b*x + a)
^3 - I*sinh(b*x + a)^4 - 2*(3*I*cosh(b*x + a)^2 + I)*sinh(b*x + a)^2 - 2*I*cosh(b*x + a)^2 - 4*(I*cosh(b*x + a
)^3 + I*cosh(b*x + a))*sinh(b*x + a) - I)*dilog(-I*cosh(b*x + a) - I*sinh(b*x + a)) - (-I*a*cosh(b*x + a)^4 -
4*I*a*cosh(b*x + a)*sinh(b*x + a)^3 - I*a*sinh(b*x + a)^4 - 2*I*a*cosh(b*x + a)^2 - 2*(3*I*a*cosh(b*x + a)^2 +
I*a)*sinh(b*x + a)^2 - 4*(I*a*cosh(b*x + a)^3 + I*a*cosh(b*x + a))*sinh(b*x + a) - I*a)*log(cosh(b*x + a) + s
inh(b*x + a) + I) - (I*a*cosh(b*x + a)^4 + 4*I*a*cosh(b*x + a)*sinh(b*x + a)^3 + I*a*sinh(b*x + a)^4 + 2*I*a*c
osh(b*x + a)^2 - 2*(-3*I*a*cosh(b*x + a)^2 - I*a)*sinh(b*x + a)^2 - 4*(-I*a*cosh(b*x + a)^3 - I*a*cosh(b*x + a
))*sinh(b*x + a) + I*a)*log(cosh(b*x + a) + sinh(b*x + a) - I) - ((-I*b*x - I*a)*cosh(b*x + a)^4 - 4*(I*b*x +
I*a)*cosh(b*x + a)*sinh(b*x + a)^3 + (-I*b*x - I*a)*sinh(b*x + a)^4 - 2*(I*b*x + I*a)*cosh(b*x + a)^2 - 2*(3*(
I*b*x + I*a)*cosh(b*x + a)^2 + I*b*x + I*a)*sinh(b*x + a)^2 - I*b*x - 4*((I*b*x + I*a)*cosh(b*x + a)^3 + (I*b*
x + I*a)*cosh(b*x + a))*sinh(b*x + a) - I*a)*log(I*cosh(b*x + a) + I*sinh(b*x + a) + 1) - ((I*b*x + I*a)*cosh(
b*x + a)^4 - 4*(-I*b*x - I*a)*cosh(b*x + a)*sinh(b*x + a)^3 + (I*b*x + I*a)*sinh(b*x + a)^4 - 2*(-I*b*x - I*a)
*cosh(b*x + a)^2 - 2*(3*(-I*b*x - I*a)*cosh(b*x + a)^2 - I*b*x - I*a)*sinh(b*x + a)^2 + I*b*x - 4*((-I*b*x - I
*a)*cosh(b*x + a)^3 + (-I*b*x - I*a)*cosh(b*x + a))*sinh(b*x + a) + I*a)*log(-I*cosh(b*x + a) - I*sinh(b*x + a
) + 1) + 2*(3*(b*x + 1)*cosh(b*x + a)^2 - b*x + 1)*sinh(b*x + a))/(b^2*cosh(b*x + a)^4 + 4*b^2*cosh(b*x + a)*s
inh(b*x + a)^3 + b^2*sinh(b*x + a)^4 + 2*b^2*cosh(b*x + a)^2 + 2*(3*b^2*cosh(b*x + a)^2 + b^2)*sinh(b*x + a)^2
+ b^2 + 4*(b^2*cosh(b*x + a)^3 + b^2*cosh(b*x + a))*sinh(b*x + a))
Sympy [F]
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\int x \sinh ^{2}{\left (a + b x \right )} \operatorname {sech}^{3}{\left (a + b x \right )}\, dx
\]
[In]
integrate(x*sech(b*x+a)**3*sinh(b*x+a)**2,x)
[Out]
Integral(x*sinh(a + b*x)**2*sech(a + b*x)**3, x)
Maxima [F]
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\int { x \operatorname {sech}\left (b x + a\right )^{3} \sinh \left (b x + a\right )^{2} \,d x }
\]
[In]
integrate(x*sech(b*x+a)^3*sinh(b*x+a)^2,x, algorithm="maxima")
[Out]
-((b*x*e^(3*a) + e^(3*a))*e^(3*b*x) - (b*x*e^a - e^a)*e^(b*x))/(b^2*e^(4*b*x + 4*a) + 2*b^2*e^(2*b*x + 2*a) +
b^2) + 2*integrate(1/2*x*e^(b*x + a)/(e^(2*b*x + 2*a) + 1), x)
Giac [F]
\[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\int { x \operatorname {sech}\left (b x + a\right )^{3} \sinh \left (b x + a\right )^{2} \,d x }
\]
[In]
integrate(x*sech(b*x+a)^3*sinh(b*x+a)^2,x, algorithm="giac")
[Out]
integrate(x*sech(b*x + a)^3*sinh(b*x + a)^2, x)
Mupad [F(-1)]
Timed out. \[
\int x \text {sech}(a+b x) \tanh ^2(a+b x) \, dx=\int \frac {x\,{\mathrm {sinh}\left (a+b\,x\right )}^2}{{\mathrm {cosh}\left (a+b\,x\right )}^3} \,d x
\]
[In]
int((x*sinh(a + b*x)^2)/cosh(a + b*x)^3,x)
[Out]
int((x*sinh(a + b*x)^2)/cosh(a + b*x)^3, x)