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

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 12, normalized size of antiderivative = 1.00, 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 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])

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

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.01, size = 12, normalized size = 1.00 \[ \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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos (4 x) \sec (x) \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [B]  time = 0.80, size = 27, normalized size = 2.25 \[ \frac {8}{3} \, {\left (\cos \relax (x)^{2} - 1\right )} \sin \relax (x) + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

giac [B]  time = 0.60, size = 23, normalized size = 1.92 \[ -\frac {8}{3} \, \sin \relax (x)^{3} + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

maple [B]  time = 0.33, size = 22, normalized size = 1.83




method result size



default \(\ln \left (\sec \relax (x )+\tan \relax (x )\right )+\frac {8 \left (2+\cos ^{2}\relax (x )\right ) \sin \relax (x )}{3}-8 \sin \relax (x )\) \(22\)
risch \(i {\mathrm e}^{i x}-i {\mathrm e}^{-i x}+\ln \left ({\mathrm e}^{i x}+i\right )-\ln \left ({\mathrm e}^{i x}-i\right )+\frac {2 \sin \left (3 x \right )}{3}\) \(44\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.45, size = 21, normalized size = 1.75 \[ -\frac {8}{3} \, \sin \relax (x)^{3} + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (\sin \relax (x) - 1\right ) \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.27, size = 10, normalized size = 0.83 \[ \mathrm {atanh}\left (\sin \relax (x)\right )-\frac {8\,{\sin \relax (x)}^3}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

atanh(sin(x)) - (8*sin(x)^3)/3

________________________________________________________________________________________

sympy [A]  time = 1.70, size = 24, normalized size = 2.00 \[ - \frac {\log {\left (\sin {\relax (x )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\relax (x )} + 1 \right )}}{2} - \frac {8 \sin ^{3}{\relax (x )}}{3} \]

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

________________________________________________________________________________________