I want to find the derivative of a function $f$. If I manage to find a function $g$, whose derivative I know for all $n$ such that $$f(x)=\lim_{n\rightarrow \infty} g(x,n),$$ is it true that $$\frac{\partial f}{\partial x}(x)=\lim_{n\rightarrow \infty}\left( \frac{\partial g}{\partial x}g(x,n)\right)?$$
I'm asking this because I want to know $$\frac{\partial \theta}{\partial x_i}(||\vec{x}||),$$ where $\theta$ is the Heaviside step function.