Step 1: Differentiate $ f(x) $.
$ f'(x) = a\cos x+\cos 3x $.
Step 2: Apply the extremum condition at $ x=\pi/3 $.
\[ f'(\pi/3) = a\cdot\frac{1}{2}+\cos\pi = \frac{a}{2}-1=0 \implies a=2 \]
Step 3: Compute the second derivative.
\[ f''(x) = -a\sin x-3\sin 3x \] With $ a=2 $: $ f''(\pi/3) = -2\cdot\frac{\sqrt{3}}{2}-3\sin\pi = -\sqrt{3} < 0 $.
Step 4: Classify using the second derivative test.
Since $ f''(\pi/3)<0 $, $ x=\pi/3 $ is a local maximum, confirming it is a genuine extremum.
Step 5: Compute the extremum value to verify.
$ f(\pi/3) = 2\cdot\frac{\sqrt{3}}{2}+\frac{1}{3}\cdot 0 = \sqrt{3} $. This is a local maximum value.
Step 6: State the answer.
\[ \boxed{a=2} \]