An earlier development of some results in quantum mechanics from a stochastic variational principle is extended in several directions. An outline is first given of the methods of control theory upon which the development is based, and earlier results are briefly described. Extensions are then given to relativistic systems, to Dirac's equation, and to elementary quantum field theory. The aim thoughout is to show that results in the standard theory can be obtained in a uniform way from an extended form of Hamilton's principle, which has the advantage of conciseness and a relatively close relationship to the classical theory. The wave function appears as a modified form of the optimal cost function, and the photon can be identified with a singularity in the electromagnetic field. Interference is explained by optimization of an expected value, the ensemble over which the expectation is taken being dependent upon the information available.