3.106 \(\int \cos (x) \tan (3 x) \, dx\)

Optimal. Leaf size=21 \[ \frac{\tanh ^{-1}\left (\frac{2 \cos (x)}{\sqrt{3}}\right )}{\sqrt{3}}-\cos (x) \]

[Out]

ArcTanh[(2*Cos[x])/Sqrt[3]]/Sqrt[3] - Cos[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0242572, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {388, 206} \[ \frac{\tanh ^{-1}\left (\frac{2 \cos (x)}{\sqrt{3}}\right )}{\sqrt{3}}-\cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[(2*Cos[x])/Sqrt[3]]/Sqrt[3] - Cos[x]

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

Mathematica [B]  time = 0.0527161, size = 48, normalized size = 2.29 \[ -\cos (x)-\frac{\tanh ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right )-2}{\sqrt{3}}\right )}{\sqrt{3}}+\frac{\tanh ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right )+2}{\sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(ArcTanh[(-2 + Tan[x/2])/Sqrt[3]]/Sqrt[3]) + ArcTanh[(2 + Tan[x/2])/Sqrt[3]]/Sqrt[3] - Cos[x]

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 19, normalized size = 0.9 \begin{align*} -\cos \left ( x \right ) +{\frac{\sqrt{3}}{3}{\it Artanh} \left ({\frac{2\,\cos \left ( x \right ) \sqrt{3}}{3}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x)+1/3*arctanh(2/3*cos(x)*3^(1/2))*3^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\cos \left (x\right ) - \int \frac{{\left (\sin \left (3 \, x\right ) - \sin \left (x\right )\right )} \cos \left (4 \, x\right ) -{\left (\cos \left (3 \, x\right ) - \cos \left (x\right )\right )} \sin \left (4 \, x\right ) -{\left (\cos \left (2 \, x\right ) - 1\right )} \sin \left (3 \, x\right ) + \cos \left (3 \, x\right ) \sin \left (2 \, x\right ) - \cos \left (x\right ) \sin \left (2 \, x\right ) + \cos \left (2 \, x\right ) \sin \left (x\right ) - \sin \left (x\right )}{2 \,{\left (\cos \left (2 \, x\right ) - 1\right )} \cos \left (4 \, x\right ) - \cos \left (4 \, x\right )^{2} - \cos \left (2 \, x\right )^{2} - \sin \left (4 \, x\right )^{2} + 2 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) - 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x) - integrate(((sin(3*x) - sin(x))*cos(4*x) - (cos(3*x) - cos(x))*sin(4*x) - (cos(2*x) - 1)*sin(3*x) + c
os(3*x)*sin(2*x) - cos(x)*sin(2*x) + cos(2*x)*sin(x) - sin(x))/(2*(cos(2*x) - 1)*cos(4*x) - cos(4*x)^2 - cos(2
*x)^2 - sin(4*x)^2 + 2*sin(4*x)*sin(2*x) - sin(2*x)^2 + 2*cos(2*x) - 1), x)

________________________________________________________________________________________

Fricas [B]  time = 2.85551, size = 109, normalized size = 5.19 \begin{align*} \frac{1}{6} \, \sqrt{3} \log \left (-\frac{4 \, \cos \left (x\right )^{2} + 4 \, \sqrt{3} \cos \left (x\right ) + 3}{4 \, \cos \left (x\right )^{2} - 3}\right ) - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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