  A proof is given of the formula, recently proposed by Cachazo, He and Yuan
(CHY) for gluon tree amplitudes in pure Yang-Mills theory in arbitrary
dimension. The approach is to first establish the corresponding result for
massless $\phi^3$ theory using the BCFW recurrence relation and then to extend
this to the gauge theory case. Additionally, it is shown that the scattering
equations introduced by CHY can be generalized to massive particles, enabling
the description of tree amplitudes for massive $\phi^3$ theory.
