Consider $x \in \mathbf R$, $\theta(x)$ is defined as $\theta : \mathbf R \to \mathbf R^n$, and $f(\theta)$ defined as $f : \mathbf R^n \to \mathbf R$. That is, $f$ is a function of $\theta$, and $\theta$ is a function of $x$.
You may assume that $\theta$ is differentiable in $x$, and $f$ differentiable in $\theta$.
I am trying to evaluate $\nabla_x f$, but am worried that my intuition is incorrect. I am wondering if it is correct to say that, using the chain rule, $$\nabla_x f = (\nabla_{\theta} f)^T \nabla_x \theta.$$ Is this valid?
$\newcommand{\bbR}{\mathbb{R}}$It doesn't really make sense to talk about differentiating $f$ in both $x$ and $\theta$. Note that $\theta(x)$ is a single-variable function so $\nabla_x\theta$ doesn't make sense either.
Define a new function $g \colon \bbR \to \bbR$ given by $g(x) = f(\theta(x))$. Then by the chain rule, $$g'(x_0) = \left.\nabla_\theta(f)\right|_{\theta(x_0)} ^\top \theta'(x_0).$$ Spelled out completely, $$g'(x_0) = \left.\frac{\partial f}{\partial \theta_1}\right|_{\theta_1(x_0)} \left.\frac{d\theta_1}{dx}\right|_{x_0} + \cdots + \left.\frac{\partial f}{\partial \theta_n} \right|_{\theta(x)}\left.\frac{d\theta_n}{dx}\right|_{x_0}$$