\(\int \cos (4 x) \sec ^5(x) \, dx\) [369]

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

Optimal result

Integrand size = 9, antiderivative size = 26 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {35}{8} \text {arctanh}(\sin (x))-\frac {29}{8} \sec (x) \tan (x)+\frac {1}{4} \sec ^3(x) \tan (x) \]

[Out]

35/8*arctanh(sin(x))-29/8*sec(x)*tan(x)+1/4*sec(x)^3*tan(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {4449, 1171, 393, 212} \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {35}{8} \text {arctanh}(\sin (x))+\frac {1}{4} \tan (x) \sec ^3(x)-\frac {29}{8} \tan (x) \sec (x) \]

[In]

Int[Cos[4*x]*Sec[x]^5,x]

[Out]

(35*ArcTanh[Sin[x]])/8 - (29*Sec[x]*Tan[x])/8 + (Sec[x]^3*Tan[x])/4

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 1171

Int[((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> With[{Qx = PolynomialQ
uotient[(a + b*x^2 + c*x^4)^p, d + e*x^2, x], R = Coeff[PolynomialRemainder[(a + b*x^2 + c*x^4)^p, d + e*x^2,
x], x, 0]}, Simp[(-R)*x*((d + e*x^2)^(q + 1)/(2*d*(q + 1))), x] + Dist[1/(2*d*(q + 1)), Int[(d + e*x^2)^(q + 1
)*ExpandToSum[2*d*(q + 1)*Qx + R*(2*q + 3), x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] &&
 NeQ[c*d^2 - b*d*e + a*e^2, 0] && IGtQ[p, 0] && LtQ[q, -1]

Rule 4449

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^(n_), x_Symbol] :> With[{d = FreeFactors[Sin[c*(a + b*x)], x]}, Dist
[d/(b*c), Subst[Int[SubstFor[(1 - d^2*x^2)^((n - 1)/2), Sin[c*(a + b*x)]/d, u, x], x], x, Sin[c*(a + b*x)]/d],
 x] /; FunctionOfQ[Sin[c*(a + b*x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && IntegerQ[(n - 1)/2] && NonsumQ[u] && (
EqQ[F, Cos] || EqQ[F, cos])

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1-8 x^2+8 x^4}{\left (1-x^2\right )^3} \, dx,x,\sin (x)\right ) \\ & = \frac {1}{4} \sec ^3(x) \tan (x)-\frac {1}{4} \text {Subst}\left (\int \frac {-3+32 x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (x)\right ) \\ & = -\frac {29}{8} \sec (x) \tan (x)+\frac {1}{4} \sec ^3(x) \tan (x)+\frac {35}{8} \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (x)\right ) \\ & = \frac {35}{8} \text {arctanh}(\sin (x))-\frac {29}{8} \sec (x) \tan (x)+\frac {1}{4} \sec ^3(x) \tan (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {1}{8} \left (35 \text {arctanh}(\sin (x))-27 \sec ^3(x) \tan (x)+29 \sec (x) \tan ^3(x)\right ) \]

[In]

Integrate[Cos[4*x]*Sec[x]^5,x]

[Out]

(35*ArcTanh[Sin[x]] - 27*Sec[x]^3*Tan[x] + 29*Sec[x]*Tan[x]^3)/8

Maple [A] (verified)

Time = 38.58 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.19

method result size
default \(-\left (-\frac {\left (\sec ^{3}\left (x \right )\right )}{4}-\frac {3 \sec \left (x \right )}{8}\right ) \tan \left (x \right )+\frac {35 \ln \left (\sec \left (x \right )+\tan \left (x \right )\right )}{8}-4 \sec \left (x \right ) \tan \left (x \right )\) \(31\)
risch \(\frac {i \left (29 \,{\mathrm e}^{7 i x}+21 \,{\mathrm e}^{5 i x}-21 \,{\mathrm e}^{3 i x}-29 \,{\mathrm e}^{i x}\right )}{4 \left ({\mathrm e}^{2 i x}+1\right )^{4}}+\frac {35 \ln \left (i+{\mathrm e}^{i x}\right )}{8}-\frac {35 \ln \left ({\mathrm e}^{i x}-i\right )}{8}\) \(65\)

[In]

int(cos(4*x)/cos(x)^5,x,method=_RETURNVERBOSE)

[Out]

-(-1/4*sec(x)^3-3/8*sec(x))*tan(x)+35/8*ln(sec(x)+tan(x))-4*sec(x)*tan(x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (20) = 40\).

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.65 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {35 \, \cos \left (x\right )^{4} \log \left (\sin \left (x\right ) + 1\right ) - 35 \, \cos \left (x\right )^{4} \log \left (-\sin \left (x\right ) + 1\right ) - 2 \, {\left (29 \, \cos \left (x\right )^{2} - 2\right )} \sin \left (x\right )}{16 \, \cos \left (x\right )^{4}} \]

[In]

integrate(cos(4*x)/cos(x)^5,x, algorithm="fricas")

[Out]

1/16*(35*cos(x)^4*log(sin(x) + 1) - 35*cos(x)^4*log(-sin(x) + 1) - 2*(29*cos(x)^2 - 2)*sin(x))/cos(x)^4

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 75 vs. \(2 (27) = 54\).

Time = 6.98 (sec) , antiderivative size = 75, normalized size of antiderivative = 2.88 \[ \int \cos (4 x) \sec ^5(x) \, dx=- \frac {35 \log {\left (\sin {\left (x \right )} - 1 \right )}}{16} + \frac {35 \log {\left (\sin {\left (x \right )} + 1 \right )}}{16} - \frac {3 \sin ^{3}{\left (x \right )}}{8 \sin ^{4}{\left (x \right )} - 16 \sin ^{2}{\left (x \right )} + 8} + \frac {5 \sin {\left (x \right )}}{8 \sin ^{4}{\left (x \right )} - 16 \sin ^{2}{\left (x \right )} + 8} + \frac {8 \sin {\left (x \right )}}{2 \sin ^{2}{\left (x \right )} - 2} \]

[In]

integrate(cos(4*x)/cos(x)**5,x)

[Out]

-35*log(sin(x) - 1)/16 + 35*log(sin(x) + 1)/16 - 3*sin(x)**3/(8*sin(x)**4 - 16*sin(x)**2 + 8) + 5*sin(x)/(8*si
n(x)**4 - 16*sin(x)**2 + 8) + 8*sin(x)/(2*sin(x)**2 - 2)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (20) = 40\).

Time = 0.19 (sec) , antiderivative size = 54, normalized size of antiderivative = 2.08 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {5 \, \sin \left (x\right )^{3} - 3 \, \sin \left (x\right )}{8 \, {\left (\sin \left (x\right )^{4} - 2 \, \sin \left (x\right )^{2} + 1\right )}} + \frac {3 \, \sin \left (x\right )}{\sin \left (x\right )^{2} - 1} + \frac {35}{16} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {35}{16} \, \log \left (\sin \left (x\right ) - 1\right ) \]

[In]

integrate(cos(4*x)/cos(x)^5,x, algorithm="maxima")

[Out]

1/8*(5*sin(x)^3 - 3*sin(x))/(sin(x)^4 - 2*sin(x)^2 + 1) + 3*sin(x)/(sin(x)^2 - 1) + 35/16*log(sin(x) + 1) - 35
/16*log(sin(x) - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.46 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {29 \, \sin \left (x\right )^{3} - 27 \, \sin \left (x\right )}{8 \, {\left (\sin \left (x\right )^{2} - 1\right )}^{2}} + \frac {35}{16} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {35}{16} \, \log \left (-\sin \left (x\right ) + 1\right ) \]

[In]

integrate(cos(4*x)/cos(x)^5,x, algorithm="giac")

[Out]

1/8*(29*sin(x)^3 - 27*sin(x))/(sin(x)^2 - 1)^2 + 35/16*log(sin(x) + 1) - 35/16*log(-sin(x) + 1)

Mupad [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.27 \[ \int \cos (4 x) \sec ^5(x) \, dx=\frac {35\,\mathrm {atanh}\left (\sin \left (x\right )\right )}{8}-\frac {\frac {27\,\sin \left (x\right )}{8}-\frac {29\,{\sin \left (x\right )}^3}{8}}{{\sin \left (x\right )}^4-2\,{\sin \left (x\right )}^2+1} \]

[In]

int(cos(4*x)/cos(x)^5,x)

[Out]

(35*atanh(sin(x)))/8 - ((27*sin(x))/8 - (29*sin(x)^3)/8)/(sin(x)^4 - 2*sin(x)^2 + 1)