3.122 \(\int \cos (4 x) \sec (2 x) \, dx\)

Optimal. Leaf size=14 \[ \sin (2 x)-\frac{1}{2} \tanh ^{-1}(\sin (2 x)) \]

[Out]

-ArcTanh[Sin[2*x]]/2 + Sin[2*x]

________________________________________________________________________________________

Rubi [A]  time = 0.0199355, antiderivative size = 14, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {4364, 388, 206} \[ \sin (2 x)-\frac{1}{2} \tanh ^{-1}(\sin (2 x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-ArcTanh[Sin[2*x]]/2 + Sin[2*x]

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 388

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

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 (2 x) \, dx &=\frac{1}{2} \operatorname{Subst}\left (\int \frac{1-2 x^2}{1-x^2} \, dx,x,\sin (2 x)\right )\\ &=\sin (2 x)-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (2 x)\right )\\ &=-\frac{1}{2} \tanh ^{-1}(\sin (2 x))+\sin (2 x)\\ \end{align*}

Mathematica [A]  time = 0.008197, size = 14, normalized size = 1. \[ \sin (2 x)-\frac{1}{2} \tanh ^{-1}(\sin (2 x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-ArcTanh[Sin[2*x]]/2 + Sin[2*x]

________________________________________________________________________________________

Maple [A]  time = 0.034, size = 18, normalized size = 1.3 \begin{align*} -{\frac{\ln \left ( \sec \left ( 2\,x \right ) +\tan \left ( 2\,x \right ) \right ) }{2}}+\sin \left ( 2\,x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(4*x)*sec(2*x),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.54558, size = 174, normalized size = 12.43 \begin{align*} \frac{1}{4} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt{2} \cos \left (x\right ) + 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) - \frac{1}{4} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt{2} \cos \left (x\right ) - 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) - \frac{1}{4} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt{2} \cos \left (x\right ) + 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) + \frac{1}{4} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt{2} \cos \left (x\right ) - 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) + \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.31288, size = 81, normalized size = 5.79 \begin{align*} -\frac{1}{4} \, \log \left (\sin \left (2 \, x\right ) + 1\right ) + \frac{1}{4} \, \log \left (-\sin \left (2 \, x\right ) + 1\right ) + \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 20.5348, size = 427, normalized size = 30.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4*x + 32*x*tan(x/2)**4/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) + 64*x*tan(x/2)**2/(8*tan(x/2)**4 + 16*tan(x/2)**
2 + 8) + 32*x/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) - 3*log(tan(x/2)**2 - 2*tan(x/2) - 1)/2 + 3*log(tan(x/2)**2
 + 2*tan(x/2) - 1)/2 + 8*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**4/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) +
16*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**2/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) + 8*log(tan(x/2)**2 - 2*
tan(x/2) - 1)/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) - 8*log(tan(x/2)**2 + 2*tan(x/2) - 1)*tan(x/2)**4/(8*tan(x/
2)**4 + 16*tan(x/2)**2 + 8) - 16*log(tan(x/2)**2 + 2*tan(x/2) - 1)*tan(x/2)**2/(8*tan(x/2)**4 + 16*tan(x/2)**2
 + 8) - 8*log(tan(x/2)**2 + 2*tan(x/2) - 1)/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8) - 32*tan(x/2)**3/(8*tan(x/2)*
*4 + 16*tan(x/2)**2 + 8) + 32*tan(x/2)/(8*tan(x/2)**4 + 16*tan(x/2)**2 + 8)

________________________________________________________________________________________

Giac [B]  time = 1.1391, size = 34, normalized size = 2.43 \begin{align*} -\frac{1}{4} \, \log \left (\sin \left (2 \, x\right ) + 1\right ) + \frac{1}{4} \, \log \left (-\sin \left (2 \, x\right ) + 1\right ) + \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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