If the function $f(x)=a \sin x+\frac{1}{3} \sin 3 x$ has an extremum at $x=\frac{\pi}{3}$ then $a=$_____________
It is given that, the function $f(x)=a \sin x+\frac{1}{3} \sin 3 x$ has an extremum at $x=\frac{\pi}{3}$.
$\therefore f^{\prime}(x)=0$ at $x=\frac{\pi}{3}$
$f(x)=a \sin x+\frac{1}{3} \sin 3 x$
Differentiating both sides with respect to x, we get
$f^{\prime}(x)=a \cos x+\frac{1}{3} \times 3 \cos 3 x$
$\Rightarrow f^{\prime}(x)=a \cos x+\cos 3 x$
Now,
$f^{\prime}\left(\frac{\pi}{3}\right)=0$
$\Rightarrow a \cos \left(\frac{\pi}{3}\right)+\cos 3\left(\frac{\pi}{3}\right)=0$
$\Rightarrow a \times \frac{1}{2}+\cos \pi=0$
$\Rightarrow \frac{a}{2}-1=0$
$\Rightarrow a=2$
Thus, the value of a is 2.
If the function $f(x)=a \sin x+\frac{1}{3} \sin 3 x$ has an extremum at $x=\frac{\pi}{3}$ then $a=$ ___2___.