3.842 \(\int x \sec (x) (2+x \tan (x)) \, dx\)

Optimal. Leaf size=6 \[ x^2 \sec (x) \]

[Out]

x^2*sec(x)

________________________________________________________________________________________

Rubi [A]  time = 0.18, antiderivative size = 6, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {6742, 4181, 2279, 2391, 3757} \[ x^2 \sec (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Sec[x]*(2 + x*Tan[x]),x]

[Out]

x^2*Sec[x]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

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 4181

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-2*(c + d*x)^m*ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))])/f, x] + (-Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {align*} \int x \sec (x) (2+x \tan (x)) \, dx &=\int \left (2 x \sec (x)+x^2 \sec (x) \tan (x)\right ) \, dx\\ &=2 \int x \sec (x) \, dx+\int x^2 \sec (x) \tan (x) \, dx\\ &=-4 i x \tan ^{-1}\left (e^{i x}\right )+x^2 \sec (x)-2 \int \log \left (1-i e^{i x}\right ) \, dx+2 \int \log \left (1+i e^{i x}\right ) \, dx-2 \int x \sec (x) \, dx\\ &=x^2 \sec (x)+2 i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )-2 i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )+2 \int \log \left (1-i e^{i x}\right ) \, dx-2 \int \log \left (1+i e^{i x}\right ) \, dx\\ &=2 i \text {Li}_2\left (-i e^{i x}\right )-2 i \text {Li}_2\left (i e^{i x}\right )+x^2 \sec (x)-2 i \operatorname {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )+2 i \operatorname {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=x^2 \sec (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 6, normalized size = 1.00 \[ x^2 \sec (x) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sec[x]*(2 + x*Tan[x]),x]

[Out]

x^2*Sec[x]

________________________________________________________________________________________

fricas [A]  time = 2.14, size = 8, normalized size = 1.33 \[ \frac {x^{2}}{\cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2/cos(x)

________________________________________________________________________________________

giac [B]  time = 0.15, size = 26, normalized size = 4.33 \[ -\frac {x^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + x^{2}}{\tan \left (\frac {1}{2} \, x\right )^{2} - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 9, normalized size = 1.50 \[ \frac {x^{2}}{\cos \relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2/cos(x)

________________________________________________________________________________________

maxima [B]  time = 0.48, size = 51, normalized size = 8.50 \[ \frac {2 \, {\left (x^{2} \cos \left (2 \, x\right ) \cos \relax (x) + x^{2} \sin \left (2 \, x\right ) \sin \relax (x) + x^{2} \cos \relax (x)\right )}}{\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(x^2*cos(2*x)*cos(x) + x^2*sin(2*x)*sin(x) + x^2*cos(x))/(cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1)

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 8, normalized size = 1.33 \[ \frac {x^2}{\cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2/cos(x)

________________________________________________________________________________________

sympy [A]  time = 0.48, size = 5, normalized size = 0.83 \[ x^{2} \sec {\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**2*sec(x)

________________________________________________________________________________________