3.367 \(\int \cos (4 x) \sec (x) \, dx\)

Optimal. Leaf size=12 \[ \tanh ^{-1}(\sin (x))-\frac{8 \sin ^3(x)}{3} \]

[Out]

ArcTanh[Sin[x]] - (8*Sin[x]^3)/3

________________________________________________________________________________________

Rubi [A]  time = 0.0231566, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.429, Rules used = {4364, 1153, 206} \[ \tanh ^{-1}(\sin (x))-\frac{8 \sin ^3(x)}{3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[Sin[x]] - (8*Sin[x]^3)/3

Rule 4364

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])

Rule 1153

Int[((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, 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] && IGtQ[q, -2]

Rule 206

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

Rubi steps

\begin{align*} \int \cos (4 x) \sec (x) \, dx &=\operatorname{Subst}\left (\int \frac{1-8 x^2+8 x^4}{1-x^2} \, dx,x,\sin (x)\right )\\ &=\operatorname{Subst}\left (\int \left (-8 x^2+\frac{1}{1-x^2}\right ) \, dx,x,\sin (x)\right )\\ &=-\frac{8}{3} \sin ^3(x)+\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )\\ &=\tanh ^{-1}(\sin (x))-\frac{8 \sin ^3(x)}{3}\\ \end{align*}

Mathematica [A]  time = 0.0103242, size = 12, normalized size = 1. \[ \tanh ^{-1}(\sin (x))-\frac{8 \sin ^3(x)}{3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[Sin[x]] - (8*Sin[x]^3)/3

________________________________________________________________________________________

Maple [B]  time = 0.021, size = 22, normalized size = 1.8 \begin{align*} \ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) +{\frac{ \left ( 16+8\, \left ( \cos \left ( x \right ) \right ) ^{2} \right ) \sin \left ( x \right ) }{3}}-8\,\sin \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(sec(x)+tan(x))+8/3*(2+cos(x)^2)*sin(x)-8*sin(x)

________________________________________________________________________________________

Maxima [A]  time = 0.930704, size = 28, normalized size = 2.33 \begin{align*} -\frac{8}{3} \, \sin \left (x\right )^{3} + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.30134, size = 97, normalized size = 8.08 \begin{align*} \frac{8}{3} \,{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 1.3245, size = 24, normalized size = 2. \begin{align*} - \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} + \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2} - \frac{8 \sin ^{3}{\left (x \right )}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(sin(x) - 1)/2 + log(sin(x) + 1)/2 - 8*sin(x)**3/3

________________________________________________________________________________________

Giac [B]  time = 1.06832, size = 31, normalized size = 2.58 \begin{align*} -\frac{8}{3} \, \sin \left (x\right )^{3} + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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