The muscle force sharing problem was solved for the swing phase of gait using a dynamic optimization algorithm. For comparison purposes the problem was also solved using a typical static optimization algorithm. The objective function for the dynamic optimization algorithm was a combination of the tracking error and the metabolic energy consumption. The latter quantity was taken to be the sum of the total work done by the muscles and the enthalpy change during the contraction. The objective function for the static optimization problem was the sum of the cubes of the muscle stresses. To solve the problem using the static approach, the inverse dynamics problem was first solved in order to determine the resultant joint torques required to generate the given hip, knee and ankle trajectories. To this effect the angular velocities and accelerations were obtained by numerical differentiation using a low-pass digital filter. The dynamic optimization problem was solved using the Fletcher-Reeves conjugate gradient algorithm, and the static optimization problem was solved using the Gradient-restoration algorithm. The results show influence of internal muscle dynamics on muscle control histories vis a vis muscle forces. They also illustrate the strong sensitivity of the results to the differentiation procedure used in the static optimization approach.