3.117 \(\int \cos (x) \sec (3 x) \, dx\)

Optimal. Leaf size=44 \[ \frac{\log \left (\sqrt{3} \sin (x)+\cos (x)\right )}{2 \sqrt{3}}-\frac{\log \left (\cos (x)-\sqrt{3} \sin (x)\right )}{2 \sqrt{3}} \]

[Out]

-Log[Cos[x] - Sqrt[3]*Sin[x]]/(2*Sqrt[3]) + Log[Cos[x] + Sqrt[3]*Sin[x]]/(2*Sqrt[3])

________________________________________________________________________________________

Rubi [A]  time = 0.0362144, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {206} \[ \frac{\log \left (\sqrt{3} \sin (x)+\cos (x)\right )}{2 \sqrt{3}}-\frac{\log \left (\cos (x)-\sqrt{3} \sin (x)\right )}{2 \sqrt{3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Log[Cos[x] - Sqrt[3]*Sin[x]]/(2*Sqrt[3]) + Log[Cos[x] + Sqrt[3]*Sin[x]]/(2*Sqrt[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])

Rubi steps

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

Mathematica [A]  time = 0.0165691, size = 15, normalized size = 0.34 \[ \frac{\tanh ^{-1}\left (\sqrt{3} \tan (x)\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[Sqrt[3]*Tan[x]]/Sqrt[3]

________________________________________________________________________________________

Maple [A]  time = 0.054, size = 13, normalized size = 0.3 \begin{align*}{\frac{\sqrt{3}{\it Artanh} \left ( \tan \left ( x \right ) \sqrt{3} \right ) }{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)*sec(3*x),x)

[Out]

1/3*3^(1/2)*arctanh(tan(x)*3^(1/2))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.48839, size = 162, normalized size = 3.68 \begin{align*} \frac{1}{12} \, \sqrt{3} \log \left (-\frac{8 \, \cos \left (x\right )^{4} + 4 \,{\left (2 \, \sqrt{3} \cos \left (x\right )^{3} - 3 \, \sqrt{3} \cos \left (x\right )\right )} \sin \left (x\right ) - 9}{16 \, \cos \left (x\right )^{4} - 24 \, \cos \left (x\right )^{2} + 9}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*sqrt(3)*log(-(8*cos(x)^4 + 4*(2*sqrt(3)*cos(x)^3 - 3*sqrt(3)*cos(x))*sin(x) - 9)/(16*cos(x)^4 - 24*cos(x)
^2 + 9))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos{\left (x \right )} \sec{\left (3 x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*sec(3*x),x)

[Out]

Integral(cos(x)*sec(3*x), x)

________________________________________________________________________________________

Giac [A]  time = 1.15658, size = 42, normalized size = 0.95 \begin{align*} -\frac{1}{6} \, \sqrt{3} \log \left (\frac{{\left | -2 \, \sqrt{3} + 6 \, \tan \left (x\right ) \right |}}{{\left | 2 \, \sqrt{3} + 6 \, \tan \left (x\right ) \right |}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/6*sqrt(3)*log(abs(-2*sqrt(3) + 6*tan(x))/abs(2*sqrt(3) + 6*tan(x)))