First, make a #u# substitution. Let #u=3x#. That means #du=3dx#. We'll have a #1/3# outside the integral:
#1/3intcos^3u#
Split the #cos^3u# into #cosu# and #cos^2u#:
#1/3intcosucos^2u#
Use trig identities on #cos^2u#. #cos^2u=1-sin^2u#
#1/3intcosu(1-sin^2u)#
Do another substitution. To not confuse myself, I'll call my variable #v#. Let #v=sinu#. That means #dv=-cosudu#
#1/3int1-v^2#
This we can integrate. Don't forget the constant:
#1/3(v-v^3/3+C)#
Distribute the #1/3#:
#v/3-v^3/9+C#
Note that I left #C# the same even though I distributed the #1/3# into it. Dividing a constant by #3# will still leave a constant.
Undo the substitutions. Remember that #v=sinu# and #u=3x#:
#sinu/3-sin^3u/9+C#
#sin(3x)/3-sin^3(3x)/9+C#