3.130 \(\int x \tan ^2(x) \, dx\)

Optimal. Leaf size=15 \[ -\frac{x^2}{2}+x \tan (x)+\log (\cos (x)) \]

[Out]

-x^2/2 + Log[Cos[x]] + x*Tan[x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0228647, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5 \[ -\frac{x^2}{2}+x \tan (x)+\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]  Int[x*Tan[x]^2,x]

[Out]

-x^2/2 + Log[Cos[x]] + x*Tan[x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ x \tan{\left (x \right )} + \log{\left (\cos{\left (x \right )} \right )} - \int x\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x*tan(x)**2,x)

[Out]

x*tan(x) + log(cos(x)) - Integral(x, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.00776663, size = 15, normalized size = 1. \[ -\frac{x^2}{2}+x \tan (x)+\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]  Integrate[x*Tan[x]^2,x]

[Out]

-x^2/2 + Log[Cos[x]] + x*Tan[x]

_______________________________________________________________________________________

Maple [A]  time = 0.005, size = 20, normalized size = 1.3 \[ x\tan \left ( x \right ) -{\frac{{x}^{2}}{2}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( x \right ) \right ) ^{2} \right ) }{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x*tan(x)^2,x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.56143, size = 144, normalized size = 9.6 \[ -\frac{x^{2} \cos \left (2 \, x\right )^{2} + x^{2} \sin \left (2 \, x\right )^{2} + 2 \, x^{2} \cos \left (2 \, x\right ) + x^{2} -{\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) - 4 \, x \sin \left (2 \, x\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*tan(x)^2,x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.254882, size = 28, normalized size = 1.87 \[ -\frac{1}{2} \, x^{2} + x \tan \left (x\right ) + \frac{1}{2} \, \log \left (\frac{1}{\tan \left (x\right )^{2} + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*tan(x)^2,x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.187614, size = 19, normalized size = 1.27 \[ - \frac{x^{2}}{2} + x \tan{\left (x \right )} - \frac{\log{\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*tan(x)**2,x)

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.208255, size = 31, normalized size = 2.07 \[ -\frac{1}{2} \, x^{2} + x \tan \left (x\right ) + \frac{1}{2} \,{\rm ln}\left (\frac{4}{\tan \left (x\right )^{2} + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*tan(x)^2,x, algorithm="giac")

[Out]

-1/2*x^2 + x*tan(x) + 1/2*ln(4/(tan(x)^2 + 1))