A traceless stress energy tensor? I'm trying to solve this exercise:

Suppose an arbitrary theory (Flat space-time?) with a single  field (Is a scalar field?) invariant under dilations, i.e.
  $x\mapsto b x$ and $\phi \mapsto \phi$. Show that the stress energy
  tensor is traceless.

Writing the transformations as $x\mapsto e^\theta x$, $\phi\mapsto e^{\omega\theta}\phi$, and $\partial_\mu\phi\mapsto e^{(\omega-1)\theta}\partial_\mu\phi$, for $\omega=0$.
I get the variations as $\delta x_\mu=\theta x_\mu$, $\delta\phi=\omega\theta\phi=0$, and $\partial_\mu\phi=(\omega-1)\theta\partial_\mu \phi=-\theta\partial_\mu\phi$; and
I've tried to get some useful expression bassed on the variation of lagrangian:
$$
\delta L=\frac{\partial L}{\partial\phi}\delta \phi+\frac{\partial L}{\partial(\partial_\mu\phi)}\delta({\partial_\mu\phi})=-\theta\frac{\partial L}{\partial(\partial_\mu\phi)}\partial_\mu\phi.
$$
On the other hand, the trace of the tensor takes the form
$$
T_\mu^\mu=\eta_{\mu\nu}T^{\mu\nu}=\eta_{\mu\nu}(-\eta^{\mu\nu}L+\frac{\partial L}{\partial(\partial_\mu\phi)}\partial^\nu\phi)=-2L+\frac{\partial L}{\partial(\partial_\mu\phi)}\partial_\mu\phi
$$
Thus,
$$
T_\mu^\mu=-2L-\frac{\delta L}{\theta}.
$$
Obviously, if the lagrangian is invariant then the Tensor isn't traceless. So I don't have idea how to proceed.
 A: We know that the stress-energy tensor is divergenceless, i.e. 
$$\partial_{\mu}T^{\mu\nu}=0.$$
A proof of this follows from the definition of canonical stress-energy tensor considering the action is invariant under translation $x^\mu \rightarrow x^\mu + a^\mu$. Now the transformation that you mentioned is a conformal transformation. Infinitesimally, the conformal transformation can be written as, $$x^\mu \rightarrow x'^\mu = x^\mu + \epsilon^\mu(x),$$ where $\epsilon$ follows,
$$\partial^\mu \epsilon^\nu + \partial^\nu\epsilon^\mu = \frac{2}{d}(\partial.\epsilon)\eta^{\mu\nu}.$$ This equation is known as confomal Killing equation which can be derived from the property about how the metric changes under a conformal transformation.
Now, for a conformal symmetry, Noether's theorem suggests that there is a current $j_\mu = T_{\mu\nu}\epsilon^\nu$ which is conserved. Hence,
$$\partial^\mu j_{\mu} = 0$$
$$\begin{align}
&\implies (\partial^\mu T_{\mu\nu})\epsilon^\nu + T_{\mu\nu}\partial^\mu\epsilon^\nu=0\\
&\implies \frac{1}{2} T_{\mu\nu} (\partial^\mu\epsilon^\nu + \partial^\nu\epsilon^\mu)=0\\
&\implies \frac{1}{2} T_{\mu\nu} \frac{2}{d}(\partial.\epsilon)\eta^{\mu\nu}=0\\
&\implies \frac{1}{d}(\partial.\epsilon) T^{\mu}_\mu = 0.
\end{align}$$
Since this is true for any $\epsilon(x)$, $T^\mu_\mu=0$. That is the stress-energy tensor is traceless. The $\epsilon(x)$ in your case is $(b-1)x$. 
The answer given by SuperCiocia is perfectly correct and nice but uses the Einstein-Hilbert form of the stress-energy tensor. However, from the question, it seems that the OP is more familiar with the canonical stress-energy tensor. Hence, this is an alternative derivation of the tracelessness of the stress-energy tensor for a conformal transformation.
A: "Arbitrary theory" probably means


*

*do not make a specific choice of metric (i.e. flat space time, your $\eta_{\mu\nu}$),

*do not make a specific choice of the symmetry operation (why did you define $\phi \rightarrow e^{\omega \theta}\phi$? If $\theta, \omega \in \mathbb{R}$, then it does not have magnitude $1$. If one of them is an imaginary number, then you've selected a $U(1)$ symmetry.


So basically use equations that are general and apply to anything within the Lagrangian formalism.
For instance, the stress energy tensor can be generally written as:
$$ T_{\mu\nu} = \frac{-2}{\sqrt{-g}}\frac{\delta S}{\delta g^{\mu\nu}},$$
where $S$ is the action.
Scaling transformations are a special case of conformal transformations where 
$$ \delta g^{\mu\nu} = \epsilon g^{\mu\nu},$$
in your specific example $\epsilon = b^2$.
Inverting the formula to single out the variation of the action:
$$ \delta S \propto T_{\mu\nu}\delta g^{\mu\nu} = \epsilon T_{\mu\nu} g^{\mu\nu}  = T^\mu_\mu,$$
where the last step is the trace!
Since the action must be minimised, $\delta S =0$, you must have $T^\mu_\mu=0$, i.e. a traceless stress-energy tensor.
