\(\int x \tan (1+x^2) \, dx\) [772]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 11 \[ \int x \tan \left (1+x^2\right ) \, dx=-\frac {1}{2} \log \left (\cos \left (1+x^2\right )\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3832, 3556} \[ \int x \tan \left (1+x^2\right ) \, dx=-\frac {1}{2} \log \left (\cos \left (x^2+1\right )\right ) \]

[In]

Int[x*Tan[1 + x^2],x]

[Out]

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

Rule 3556

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

Rule 3832

Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int \tan (1+x) \, dx,x,x^2\right ) \\ & = -\frac {1}{2} \log \left (\cos \left (1+x^2\right )\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int x \tan \left (1+x^2\right ) \, dx=-\frac {1}{2} \log \left (\cos \left (1+x^2\right )\right ) \]

[In]

Integrate[x*Tan[1 + x^2],x]

[Out]

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

Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.91

method result size
derivativedivides \(-\frac {\ln \left (\cos \left (x^{2}+1\right )\right )}{2}\) \(10\)
default \(-\frac {\ln \left (\cos \left (x^{2}+1\right )\right )}{2}\) \(10\)
norman \(\frac {\ln \left (1+\tan \left (x^{2}+1\right )^{2}\right )}{4}\) \(14\)
parallelrisch \(\frac {\ln \left (1+\tan \left (x^{2}+1\right )^{2}\right )}{4}\) \(14\)
risch \(\frac {i x^{2}}{2}+i-\frac {\ln \left ({\mathrm e}^{2 i \left (x^{2}+1\right )}+1\right )}{2}\) \(24\)

[In]

int(x*tan(x^2+1),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.36 \[ \int x \tan \left (1+x^2\right ) \, dx=-\frac {1}{4} \, \log \left (\frac {1}{\tan \left (x^{2} + 1\right )^{2} + 1}\right ) \]

[In]

integrate(x*tan(x^2+1),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09 \[ \int x \tan \left (1+x^2\right ) \, dx=\frac {\log {\left (\tan ^{2}{\left (x^{2} + 1 \right )} + 1 \right )}}{4} \]

[In]

integrate(x*tan(x**2+1),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.82 \[ \int x \tan \left (1+x^2\right ) \, dx=\frac {1}{2} \, \log \left (\sec \left (x^{2} + 1\right )\right ) \]

[In]

integrate(x*tan(x^2+1),x, algorithm="maxima")

[Out]

1/2*log(sec(x^2 + 1))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.91 \[ \int x \tan \left (1+x^2\right ) \, dx=-\frac {1}{2} \, \log \left ({\left | \cos \left (x^{2} + 1\right ) \right |}\right ) \]

[In]

integrate(x*tan(x^2+1),x, algorithm="giac")

[Out]

-1/2*log(abs(cos(x^2 + 1)))

Mupad [B] (verification not implemented)

Time = 0.36 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.18 \[ \int x \tan \left (1+x^2\right ) \, dx=\frac {\ln \left ({\mathrm {tan}\left (x^2+1\right )}^2+1\right )}{4} \]

[In]

int(x*tan(x^2 + 1),x)

[Out]

log(tan(x^2 + 1)^2 + 1)/4