3.328 \(\int x \sec (x) \tan (x) \, dx\)

Optimal. Leaf size=10 \[ x \sec (x)-\tanh ^{-1}(\sin (x)) \]

[Out]

-arctanh(sin(x))+x*sec(x)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3757, 3770} \[ x \sec (x)-\tanh ^{-1}(\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[x*Sec[x]*Tan[x],x]

[Out]

-ArcTanh[Sin[x]] + x*Sec[x]

Rule 3757

Int[(x_)^(m_.)*Sec[(a_.) + (b_.)*(x_)^(n_.)]^(p_.)*Tan[(a_.) + (b_.)*(x_)^(n_.)]^(q_.), x_Symbol] :> Simp[(x^(
m - n + 1)*Sec[a + b*x^n]^p)/(b*n*p), x] - Dist[(m - n + 1)/(b*n*p), Int[x^(m - n)*Sec[a + b*x^n]^p, x], x] /;
 FreeQ[{a, b, p}, x] && IntegerQ[n] && GeQ[m, n] && EqQ[q, 1]

Rule 3770

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

Rubi steps

\begin {align*} \int x \sec (x) \tan (x) \, dx &=x \sec (x)-\int \sec (x) \, dx\\ &=-\tanh ^{-1}(\sin (x))+x \sec (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.01, size = 37, normalized size = 3.70 \[ x \sec (x)+\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sec[x]*Tan[x],x]

[Out]

Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]] + x*Sec[x]

________________________________________________________________________________________

fricas [B]  time = 0.45, size = 29, normalized size = 2.90 \[ -\frac {\cos \relax (x) \log \left (\sin \relax (x) + 1\right ) - \cos \relax (x) \log \left (-\sin \relax (x) + 1\right ) - 2 \, x}{2 \, \cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sec(x)*tan(x),x, algorithm="fricas")

[Out]

-1/2*(cos(x)*log(sin(x) + 1) - cos(x)*log(-sin(x) + 1) - 2*x)/cos(x)

________________________________________________________________________________________

giac [B]  time = 1.03, size = 150, normalized size = 15.00 \[ -\frac {2 \, x \tan \left (\frac {1}{2} \, x\right )^{2} + \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} - \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, x - \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) + \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right )}{2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sec(x)*tan(x),x, algorithm="giac")

[Out]

-1/2*(2*x*tan(1/2*x)^2 + log(2*(tan(1/2*x)^2 + 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^2 - log(2*(tan
(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 2*x - log(2*(tan(1/2*x)^2 + 2*tan(1/2*x) + 1)
/(tan(1/2*x)^2 + 1)) + log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1)))/(tan(1/2*x)^2 - 1)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 16, normalized size = 1.60 \[ -\ln \left (\sec \relax (x )+\tan \relax (x )\right )+\frac {x}{\cos \relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sec(x)*tan(x),x)

[Out]

x/cos(x)-ln(sec(x)+tan(x))

________________________________________________________________________________________

maxima [B]  time = 1.28, size = 121, normalized size = 12.10 \[ \frac {4 \, x \cos \left (2 \, x\right ) \cos \relax (x) + 4 \, x \sin \left (2 \, x\right ) \sin \relax (x) + 4 \, x \cos \relax (x) - {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} + 2 \, \sin \relax (x) + 1\right ) + {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} - 2 \, \sin \relax (x) + 1\right )}{2 \, {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sec(x)*tan(x),x, algorithm="maxima")

[Out]

1/2*(4*x*cos(2*x)*cos(x) + 4*x*sin(2*x)*sin(x) + 4*x*cos(x) - (cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1)*log(c
os(x)^2 + sin(x)^2 + 2*sin(x) + 1) + (cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^2 - 2*si
n(x) + 1))/(cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1)

________________________________________________________________________________________

mupad [B]  time = 0.11, size = 19, normalized size = 1.90 \[ \frac {x}{\cos \relax (x)}+\mathrm {atan}\left (\cos \relax (x)+\sin \relax (x)\,1{}\mathrm {i}\right )\,2{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*tan(x))/cos(x),x)

[Out]

atan(cos(x) + sin(x)*1i)*2i + x/cos(x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x \tan {\relax (x )} \sec {\relax (x )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sec(x)*tan(x),x)

[Out]

Integral(x*tan(x)*sec(x), x)

________________________________________________________________________________________