3.757 \(\int x \sec ^2(3 x) \, dx\)

Optimal. Leaf size=19 \[ \frac{1}{3} x \tan (3 x)+\frac{1}{9} \log (\cos (3 x)) \]

[Out]

Log[Cos[3*x]]/9 + (x*Tan[3*x])/3

________________________________________________________________________________________

Rubi [A]  time = 0.0185204, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {4184, 3475} \[ \frac{1}{3} x \tan (3 x)+\frac{1}{9} \log (\cos (3 x)) \]

Antiderivative was successfully verified.

[In]

Int[x*Sec[3*x]^2,x]

[Out]

Log[Cos[3*x]]/9 + (x*Tan[3*x])/3

Rule 4184

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Simp[((c + d*x)^m*Cot[e + f*x])/f, x]
+ Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x \sec ^2(3 x) \, dx &=\frac{1}{3} x \tan (3 x)-\frac{1}{3} \int \tan (3 x) \, dx\\ &=\frac{1}{9} \log (\cos (3 x))+\frac{1}{3} x \tan (3 x)\\ \end{align*}

Mathematica [A]  time = 0.0084289, size = 19, normalized size = 1. \[ \frac{1}{3} x \tan (3 x)+\frac{1}{9} \log (\cos (3 x)) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sec[3*x]^2,x]

[Out]

Log[Cos[3*x]]/9 + (x*Tan[3*x])/3

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 16, normalized size = 0.8 \begin{align*}{\frac{\ln \left ( \cos \left ( 3\,x \right ) \right ) }{9}}+{\frac{x\tan \left ( 3\,x \right ) }{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sec(3*x)^2,x)

[Out]

1/9*ln(cos(3*x))+1/3*x*tan(3*x)

________________________________________________________________________________________

Maxima [B]  time = 1.46553, size = 100, normalized size = 5.26 \begin{align*} \frac{{\left (\cos \left (6 \, x\right )^{2} + \sin \left (6 \, x\right )^{2} + 2 \, \cos \left (6 \, x\right ) + 1\right )} \log \left (\cos \left (6 \, x\right )^{2} + \sin \left (6 \, x\right )^{2} + 2 \, \cos \left (6 \, x\right ) + 1\right ) + 12 \, x \sin \left (6 \, x\right )}{18 \,{\left (\cos \left (6 \, x\right )^{2} + \sin \left (6 \, x\right )^{2} + 2 \, \cos \left (6 \, x\right ) + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/18*((cos(6*x)^2 + sin(6*x)^2 + 2*cos(6*x) + 1)*log(cos(6*x)^2 + sin(6*x)^2 + 2*cos(6*x) + 1) + 12*x*sin(6*x)
)/(cos(6*x)^2 + sin(6*x)^2 + 2*cos(6*x) + 1)

________________________________________________________________________________________

Fricas [A]  time = 2.00315, size = 74, normalized size = 3.89 \begin{align*} \frac{\cos \left (3 \, x\right ) \log \left (-\cos \left (3 \, x\right )\right ) + 3 \, x \sin \left (3 \, x\right )}{9 \, \cos \left (3 \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/9*(cos(3*x)*log(-cos(3*x)) + 3*x*sin(3*x))/cos(3*x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.14042, size = 139, normalized size = 7.32 \begin{align*} \frac{\log \left (\frac{4 \,{\left (\tan \left (\frac{3}{2} \, x\right )^{4} - 2 \, \tan \left (\frac{3}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac{3}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{3}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{3}{2} \, x\right )^{2} - 12 \, x \tan \left (\frac{3}{2} \, x\right ) - \log \left (\frac{4 \,{\left (\tan \left (\frac{3}{2} \, x\right )^{4} - 2 \, \tan \left (\frac{3}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac{3}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{3}{2} \, x\right )^{2} + 1}\right )}{18 \,{\left (\tan \left (\frac{3}{2} \, x\right )^{2} - 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/18*(log(4*(tan(3/2*x)^4 - 2*tan(3/2*x)^2 + 1)/(tan(3/2*x)^4 + 2*tan(3/2*x)^2 + 1))*tan(3/2*x)^2 - 12*x*tan(3
/2*x) - log(4*(tan(3/2*x)^4 - 2*tan(3/2*x)^2 + 1)/(tan(3/2*x)^4 + 2*tan(3/2*x)^2 + 1)))/(tan(3/2*x)^2 - 1)