Abstract—In this work we present a variational formulation for a multilayer perceptron neural network. With this formulation any learning task for the neural network is defined in terms of finding a function that is an extremal for some functional. Thus the multilayer perceptron provides a direct method for solving general variational problems. The application of this numerical method is investigated through an optimal control example, the aircraft landing problem. Using a multilayer perceptron neural network, the optimal control of the aircraft was determined by locating the extremal value of a variational problem formulated using the state variables of the aircraft.