3.365 \(\int x \tanh ^2(a+b x) \, dx\)

Optimal. Leaf size=31 \[ \frac {\log (\cosh (a+b x))}{b^2}-\frac {x \tanh (a+b x)}{b}+\frac {x^2}{2} \]

[Out]

1/2*x^2+ln(cosh(b*x+a))/b^2-x*tanh(b*x+a)/b

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {3720, 3475, 30} \[ \frac {\log (\cosh (a+b x))}{b^2}-\frac {x \tanh (a+b x)}{b}+\frac {x^2}{2} \]

Antiderivative was successfully verified.

[In]

Int[x*Tanh[a + b*x]^2,x]

[Out]

x^2/2 + Log[Cosh[a + b*x]]/b^2 - (x*Tanh[a + b*x])/b

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rubi steps

\begin {align*} \int x \tanh ^2(a+b x) \, dx &=-\frac {x \tanh (a+b x)}{b}+\frac {\int \tanh (a+b x) \, dx}{b}+\int x \, dx\\ &=\frac {x^2}{2}+\frac {\log (\cosh (a+b x))}{b^2}-\frac {x \tanh (a+b x)}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.15, size = 46, normalized size = 1.48 \[ \frac {-2 b x \tanh (a)+2 \log (\cosh (a+b x))-2 b x \text {sech}(a) \sinh (b x) \text {sech}(a+b x)+b^2 x^2}{2 b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[x*Tanh[a + b*x]^2,x]

[Out]

(b^2*x^2 + 2*Log[Cosh[a + b*x]] - 2*b*x*Sech[a]*Sech[a + b*x]*Sinh[b*x] - 2*b*x*Tanh[a])/(2*b^2)

________________________________________________________________________________________

fricas [B]  time = 1.51, size = 185, normalized size = 5.97 \[ \frac {b^{2} x^{2} + {\left (b^{2} x^{2} - 4 \, b x\right )} \cosh \left (b x + a\right )^{2} + 2 \, {\left (b^{2} x^{2} - 4 \, b x\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + {\left (b^{2} x^{2} - 4 \, b x\right )} \sinh \left (b x + a\right )^{2} + 2 \, {\left (\cosh \left (b x + a\right )^{2} + 2 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + \sinh \left (b x + a\right )^{2} + 1\right )} \log \left (\frac {2 \, \cosh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{2 \, {\left (b^{2} \cosh \left (b x + a\right )^{2} + 2 \, b^{2} \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + b^{2} \sinh \left (b x + a\right )^{2} + b^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sech(b*x+a)^2*sinh(b*x+a)^2,x, algorithm="fricas")

[Out]

1/2*(b^2*x^2 + (b^2*x^2 - 4*b*x)*cosh(b*x + a)^2 + 2*(b^2*x^2 - 4*b*x)*cosh(b*x + a)*sinh(b*x + a) + (b^2*x^2
- 4*b*x)*sinh(b*x + a)^2 + 2*(cosh(b*x + a)^2 + 2*cosh(b*x + a)*sinh(b*x + a) + sinh(b*x + a)^2 + 1)*log(2*cos
h(b*x + a)/(cosh(b*x + a) - sinh(b*x + a))))/(b^2*cosh(b*x + a)^2 + 2*b^2*cosh(b*x + a)*sinh(b*x + a) + b^2*si
nh(b*x + a)^2 + b^2)

________________________________________________________________________________________

giac [B]  time = 0.14, size = 95, normalized size = 3.06 \[ \frac {b^{2} x^{2} e^{\left (2 \, b x + 2 \, a\right )} + b^{2} x^{2} - 4 \, b x e^{\left (2 \, b x + 2 \, a\right )} + 2 \, e^{\left (2 \, b x + 2 \, a\right )} \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) + 2 \, \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )}{2 \, {\left (b^{2} e^{\left (2 \, b x + 2 \, a\right )} + b^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sech(b*x+a)^2*sinh(b*x+a)^2,x, algorithm="giac")

[Out]

1/2*(b^2*x^2*e^(2*b*x + 2*a) + b^2*x^2 - 4*b*x*e^(2*b*x + 2*a) + 2*e^(2*b*x + 2*a)*log(e^(2*b*x + 2*a) + 1) +
2*log(e^(2*b*x + 2*a) + 1))/(b^2*e^(2*b*x + 2*a) + b^2)

________________________________________________________________________________________

maple [A]  time = 0.50, size = 54, normalized size = 1.74 \[ \frac {x^{2}}{2}-\frac {2 x}{b}-\frac {2 a}{b^{2}}+\frac {2 x}{b \left (1+{\mathrm e}^{2 b x +2 a}\right )}+\frac {\ln \left (1+{\mathrm e}^{2 b x +2 a}\right )}{b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sech(b*x+a)^2*sinh(b*x+a)^2,x)

[Out]

1/2*x^2-2*x/b-2*a/b^2+2*x/b/(1+exp(2*b*x+2*a))+1/b^2*ln(1+exp(2*b*x+2*a))

________________________________________________________________________________________

maxima [B]  time = 0.37, size = 95, normalized size = 3.06 \[ -\frac {x e^{\left (2 \, b x + 2 \, a\right )}}{b e^{\left (2 \, b x + 2 \, a\right )} + b} + \frac {b x^{2} + {\left (b x^{2} e^{\left (2 \, a\right )} - 2 \, x e^{\left (2 \, a\right )}\right )} e^{\left (2 \, b x\right )}}{2 \, {\left (b e^{\left (2 \, b x + 2 \, a\right )} + b\right )}} + \frac {\log \left ({\left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )} e^{\left (-2 \, a\right )}\right )}{b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sech(b*x+a)^2*sinh(b*x+a)^2,x, algorithm="maxima")

[Out]

-x*e^(2*b*x + 2*a)/(b*e^(2*b*x + 2*a) + b) + 1/2*(b*x^2 + (b*x^2*e^(2*a) - 2*x*e^(2*a))*e^(2*b*x))/(b*e^(2*b*x
 + 2*a) + b) + log((e^(2*b*x + 2*a) + 1)*e^(-2*a))/b^2

________________________________________________________________________________________

mupad [B]  time = 0.10, size = 45, normalized size = 1.45 \[ \frac {\frac {x^2\,\mathrm {cosh}\left (a+b\,x\right )}{2}-\frac {x\,\mathrm {sinh}\left (a+b\,x\right )}{b}}{\mathrm {cosh}\left (a+b\,x\right )}+\frac {\ln \left (\mathrm {cosh}\left (a+b\,x\right )\right )}{b^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*sinh(a + b*x)^2)/cosh(a + b*x)^2,x)

[Out]

((x^2*cosh(a + b*x))/2 - (x*sinh(a + b*x))/b)/cosh(a + b*x) + log(cosh(a + b*x))/b^2

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x \sinh ^{2}{\left (a + b x \right )} \operatorname {sech}^{2}{\left (a + b x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sech(b*x+a)**2*sinh(b*x+a)**2,x)

[Out]

Integral(x*sinh(a + b*x)**2*sech(a + b*x)**2, x)

________________________________________________________________________________________