<s>[INST] Differentiating from the first principle How do I convincingly differentiate $\sin 3x$ or any trig function that comes in the form $\tan nx$, $\sin nx$, $\cos nx$ from the first principle?
I have tried expanding some forms using some trig identities but the $n$ coefficient isn't just showing up 
 [/INST] If you allow the trigonometric functions to be defined by their McLauren series, then you can differentiate these term-by-term.
For example:
$$\cos nx = 1 - \frac{(nx)^2}{2!} + \frac{(nx)^4}{4!}-\frac{(nx)^6}{6!}+\cdots$$
$$
\frac{d\cos nx}{dx} =  - \frac{2n(nx)}{2!} + \frac{4n(nx)^3}{4!}-\frac{6n(nx)^5}{6!}+\cdots$$
$$
\frac{d\cos nx}{dx} =  - n(nx) + \frac{n(nx)^3}{3!}-\frac{n(nx)^5}{5!} 
+\cdots= -n \sin nx$$
Also
$$ \tan nx = nx + \frac{1}{3} (nx)^3 + \frac{2}{15} (nx)^5 + \frac{17}{315}(nx)^7+\cdots$$
$$\frac{d \tan nx}{dx} = n + n(nx)^2 + \frac{2n}{3} (nx)^4 + \frac{17n}{45} (nx)^6 + \cdots = n\sec^2 nx$$
since the McLauren series for $\sec nx$ is 
$$\sec nx = 1 + \frac{1}{2} (nx)^2 + \frac{5}{24} (nx)^4 + \frac{61}{720} (nx)^6 +\cdots$$
Using Euler's identity:
$$e^{inx} = \cos nx + i \sin nx$$
$$\frac{d e^{inx}}{dx}=n i e^{i n x} = n ( i \cos nx - \sin nx)$$
Equating the real and imaginary parts:
$$\frac{d \cos nx}{dx} = -n \sin nx, \quad \frac{d \sin nx}{dx} = n\cos nx$$
</s>