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]

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

________________________________________________________________________________________

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

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.05, 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]

________________________________________________________________________________________

fricas [B]  time = 1.51, size = 38, normalized size = 1.81 \[ \frac {1}{6} \, \sqrt {3} \log \left (-\frac {4 \, \cos \relax (x)^{2} + 4 \, \sqrt {3} \cos \relax (x) + 3}{4 \, \cos \relax (x)^{2} - 3}\right ) - \cos \relax (x) \]

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)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos \relax (x) \tan \left (3 \, x\right )\,{d x} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.05, size = 19, normalized size = 0.90 \[ -\cos \relax (x )+\frac {\arctanh \left (\frac {2 \cos \relax (x ) \sqrt {3}}{3}\right ) \sqrt {3}}{3} \]

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.00, size = 0, normalized size = 0.00 \[ -\cos \relax (x) - \int \frac {{\left (\sin \left (3 \, x\right ) - \sin \relax (x)\right )} \cos \left (4 \, x\right ) - {\left (\cos \left (3 \, x\right ) - \cos \relax (x)\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 \relax (x) \sin \left (2 \, x\right ) + \cos \left (2 \, x\right ) \sin \relax (x) - \sin \relax (x)}{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} \]

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)

________________________________________________________________________________________

mupad [B]  time = 2.31, size = 42, normalized size = 2.00 \[ -\frac {\sqrt {3}\,\mathrm {atanh}\left (\frac {32\,\sqrt {3}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3\,\left (\frac {56\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}-\frac {8}{3}\right )}\right )}{3}-\frac {2}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

- (3^(1/2)*atanh((32*3^(1/2)*tan(x/2)^2)/(3*((56*tan(x/2)^2)/3 - 8/3))))/3 - 2/(tan(x/2)^2 + 1)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos {\relax (x )} \tan {\left (3 x \right )}\, dx \]

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)

________________________________________________________________________________________