3.1.84 \(\int \sec ^4(x) \, dx\) [84]

Optimal. Leaf size=11 \[ \tan (x)+\frac {\tan ^3(x)}{3} \]

[Out]

tan(x)+1/3*tan(x)^3

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3852} \begin {gather*} \frac {\tan ^3(x)}{3}+\tan (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[x]^4,x]

[Out]

Tan[x] + Tan[x]^3/3

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 17, normalized size = 1.55 \begin {gather*} \frac {2 \tan (x)}{3}+\frac {1}{3} \sec ^2(x) \tan (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^4,x]

[Out]

(2*Tan[x])/3 + (Sec[x]^2*Tan[x])/3

________________________________________________________________________________________

Mathics [A]
time = 1.83, size = 13, normalized size = 1.18 \begin {gather*} \frac {\text {Sin}\left [x\right ]}{3 \text {Cos}\left [x\right ]^3}+\frac {2 \text {Tan}\left [x\right ]}{3} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[Sec[x]^4,x]')

[Out]

Sin[x] / (3 Cos[x] ^ 3) + 2 Tan[x] / 3

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 13, normalized size = 1.18

method result size
default \(-\left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (x \right )\right )}{3}\right ) \tan \left (x \right )\) \(13\)
risch \(\frac {4 i \left (3 \,{\mathrm e}^{2 i x}+1\right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3}}\) \(22\)
norman \(\frac {\frac {4 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-2 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )-2 \tan \left (\frac {x}{2}\right )}{\left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )^{3}}\) \(35\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^4,x,method=_RETURNVERBOSE)

[Out]

-(-2/3-1/3*sec(x)^2)*tan(x)

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 9, normalized size = 0.82 \begin {gather*} \frac {1}{3} \, \tan \left (x\right )^{3} + \tan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4,x, algorithm="maxima")

[Out]

1/3*tan(x)^3 + tan(x)

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 16, normalized size = 1.45 \begin {gather*} \frac {{\left (2 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{3 \, \cos \left (x\right )^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (8) = 16\)
time = 0.03, size = 19, normalized size = 1.73 \begin {gather*} \frac {2 \sin {\left (x \right )}}{3 \cos {\left (x \right )}} + \frac {\sin {\left (x \right )}}{3 \cos ^{3}{\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**4,x)

[Out]

2*sin(x)/(3*cos(x)) + sin(x)/(3*cos(x)**3)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 15, normalized size = 1.36 \begin {gather*} \frac {2}{2} \left (\frac {1}{3} \tan ^{3}x+\tan x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^4,x)

[Out]

1/3*tan(x)^3 + tan(x)

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 17, normalized size = 1.55 \begin {gather*} \frac {2\,\sin \left (x\right )\,{\cos \left (x\right )}^2+\sin \left (x\right )}{3\,{\cos \left (x\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/cos(x)^4,x)

[Out]

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

________________________________________________________________________________________