\(\int x \sec (5-x^2) \, dx\) [825]

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

Optimal result

Integrand size = 10, antiderivative size = 13 \[ \int x \sec \left (5-x^2\right ) \, dx=-\frac {1}{2} \text {arctanh}\left (\sin \left (5-x^2\right )\right ) \]

[Out]

1/2*arctanh(sin(x^2-5))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 13, 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.200, Rules used = {4289, 3855} \[ \int x \sec \left (5-x^2\right ) \, dx=-\frac {1}{2} \text {arctanh}\left (\sin \left (5-x^2\right )\right ) \]

[In]

Int[x*Sec[5 - x^2],x]

[Out]

-1/2*ArcTanh[Sin[5 - x^2]]

Rule 3855

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

Rule 4289

Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sec[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 \sec (5-x) \, dx,x,x^2\right ) \\ & = -\frac {1}{2} \text {arctanh}\left (\sin \left (5-x^2\right )\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int x \sec \left (5-x^2\right ) \, dx=-\frac {1}{2} \text {arctanh}\left (\sin \left (5-x^2\right )\right ) \]

[In]

Integrate[x*Sec[5 - x^2],x]

[Out]

-1/2*ArcTanh[Sin[5 - x^2]]

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.31

method result size
derivativedivides \(\frac {\ln \left (\sec \left (x^{2}-5\right )+\tan \left (x^{2}-5\right )\right )}{2}\) \(17\)
default \(\frac {\ln \left (\sec \left (x^{2}-5\right )+\tan \left (x^{2}-5\right )\right )}{2}\) \(17\)
norman \(-\frac {\ln \left (\tan \left (-\frac {5}{2}+\frac {x^{2}}{2}\right )-1\right )}{2}+\frac {\ln \left (\tan \left (-\frac {5}{2}+\frac {x^{2}}{2}\right )+1\right )}{2}\) \(28\)
parallelrisch \(\ln \left (\frac {1}{\sqrt {\tan \left (-\frac {5}{2}+\frac {x^{2}}{2}\right )-1}}\right )+\ln \left (\sqrt {\tan \left (-\frac {5}{2}+\frac {x^{2}}{2}\right )+1}\right )\) \(28\)
risch \(-\frac {\ln \left ({\mathrm e}^{i \left (x^{2}-5\right )}-i\right )}{2}+\frac {\ln \left (i+{\mathrm e}^{i \left (x^{2}-5\right )}\right )}{2}\) \(32\)

[In]

int(x*sec(x^2-5),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 25 vs. \(2 (9) = 18\).

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

[In]

integrate(x*sec(x^2-5),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

integrate(x*sec(x**2-5),x)

[Out]

log(tan(x**2 - 5) + sec(x**2 - 5))/2

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.23 \[ \int x \sec \left (5-x^2\right ) \, dx=\frac {1}{2} \, \log \left (\sec \left (x^{2} - 5\right ) + \tan \left (x^{2} - 5\right )\right ) \]

[In]

integrate(x*sec(x^2-5),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (9) = 18\).

Time = 0.29 (sec) , antiderivative size = 41, normalized size of antiderivative = 3.15 \[ \int x \sec \left (5-x^2\right ) \, dx=\frac {1}{8} \, \log \left ({\left | \frac {1}{\sin \left (x^{2} - 5\right )} + \sin \left (x^{2} - 5\right ) + 2 \right |}\right ) - \frac {1}{8} \, \log \left ({\left | \frac {1}{\sin \left (x^{2} - 5\right )} + \sin \left (x^{2} - 5\right ) - 2 \right |}\right ) \]

[In]

integrate(x*sec(x^2-5),x, algorithm="giac")

[Out]

1/8*log(abs(1/sin(x^2 - 5) + sin(x^2 - 5) + 2)) - 1/8*log(abs(1/sin(x^2 - 5) + sin(x^2 - 5) - 2))

Mupad [B] (verification not implemented)

Time = 26.88 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.15 \[ \int x \sec \left (5-x^2\right ) \, dx=-\mathrm {atan}\left ({\mathrm {e}}^{-5{}\mathrm {i}}\,{\mathrm {e}}^{x^2\,1{}\mathrm {i}}\right )\,1{}\mathrm {i} \]

[In]

int(x/cos(x^2 - 5),x)

[Out]

-atan(exp(-5i)*exp(x^2*1i))*1i