How does this scalar transformation law make sense? A scalar field doesn't transform under a change of co-ordinates. Therefore, a scalar field $\phi(x)$ transforms to $\phi'(y)$ under the coordinate transformation $y^{\mu} = x^{\mu} + \epsilon^{\mu}(x)$, such that $\phi'(y) = \phi(x)$. Now, if we define $\delta \phi(x)$ to be the difference of the scalar field under the coordinate transformation at the same physical point, clearly $\delta \phi = 0$. However, if we define $\delta\phi$ as the difference at the same coordinate and not the same physical point, we obtain the following:
$$ \phi(x) = \phi(y^{\mu} - \epsilon^{\mu}) =\phi'(y)$$
$$\phi(y^{\mu}) - \epsilon^{\mu} \partial_{\mu}\phi(y) = \phi'(y)$$
Therefore, if we define $\delta \phi(x) = \phi(x) - \phi'(x)$, we arrive at $\delta \phi(x) = \epsilon^{\mu} \partial_{\mu}\phi(x)$. This is the result I was expecting. however, the lecture notes I'm following gives a completely foreign answer.
"Moreover, the part which contains the first derivatives $\partial_{\nu}\varepsilon^{\mu}(x)$ is also severely restricted. For instance, if $\varphi(x)$ is a scalar field, and we assume that it transforms undependently on other fields, we can write
$$\delta_\varepsilon \varphi(x)(x) = \varepsilon^{\mu}(x) \partial_{\mu}\varphi(x) + \frac{D}{d} (\partial_{\mu}\varepsilon^{\mu})\varphi(x)$$
where $d$ is the dimensionality of the space, and the parameter $D$ is related to the dimension of $\varphi$. This generalizes to more complicated scalar composite fields $\mathcal{O}_{\alpha}$ as follows
$$\delta_{\varepsilon} \mathcal{O}_{\alpha}(x) = \varepsilon^{\mu}(x) \partial_{\mu} \mathcal{O}_{\alpha}(x) + \frac{D^{\beta}_{\alpha}}{d} (\partial_{\mu}\varepsilon^{\mu}) \mathcal{O}_{\beta}(x) \\ + \ terms \ with \ \ \partial_{\nu} \partial_{\lambda} \varepsilon^{\mu}, \ etc.$$"
The transformation law has an additional $\phi(x)\partial_{\mu}\epsilon^{\mu}$ term. I just don't see how this term appears.
 A: I guess this is a conformal field theory lecture note. In fact, a scalar field does transform nontrivially under scale transformations, $x^\mu\rightarrow \lambda x^{\mu}$. A scalar field is associated with a scaling dimension $D$, which characterizes the reaction of the field to the scale transformation, $\phi'(\lambda x^{\mu}) = \lambda^D \phi(x^{\mu})$.
In infinitesimal form the scale transformation reads $\epsilon^{\mu} = \epsilon x^{\mu}$, and the infinitesimal transformation of the field reads $\delta_{\epsilon} \phi = \epsilon^{\mu} \partial_\mu \phi + \epsilon D \phi$. The first term comes from the coordinate change for the scalar field, as what you have shown. The second term is exactly what you are asking for (notice that $\frac{1}{d}\partial_\mu (\epsilon x^{\mu})=\epsilon$). More generally, $\frac{1}{d}\partial_\mu \epsilon^{\mu}$ gives the local scaling factor of the coordinate transformation, that is, it tells you how much the spacetime volume shrinks/expands locally.
Let me also review a little bit the meaning of the scaling dimension. In a free QFT, the scaling dimension coincides with the apparent dimension using dimensional analysis. For example, in a free massless scalar field theory in $d$ dimensions, the scaling dimension of the scalar field is $D_{\phi} = (d-2)/2$. One can check that the Lagrangian is invariant under scale transformations with this particular scaling dimension. More generally, if you add some interaction to the free field theory, you may end up with another renormalization group fixed point (such as Wilson-Fisher), where the scalar field takes on another scaling dimension $D_{\phi} = (d-2)/2 +\gamma$, where $\gamma$ is known as the anomalous dimension that can be computed perturbatively. All these should be familiar in an advanced QFT course. If not,  you can read more in Cardy's textbook on statistical mechanics, or any standard textbook of QFT.
