The regular nutritional intake of an expectant mother clearly affects the weight development of the fetus. Assuming the growth of the fetus follows a deterministic growth law, like a logistic equation, albeit dependent on the nutritional intake, the ideal solution is usually determined by the birth-weight being pre-assigned, for example, as a percentage of the mother's average weight. This problem can then be specified as an optimal control problem with the daily intake as the control, which appears in a Michaelis-Menten relationship, for which there are well-developed procedures to follow. The best solution is determined by requiring minimum total intake under which the preassigned birth weight is reached. The algorithm has been generalized to the case where the fetal weight depends in a detailed way on the cumulative intake, suitably discounted according to the history. The optimality system is derived and then solved numerically using an iterative method for the specific values of parameter. The procedure is generic and can be adapted to any growth law and any parameterisation obtained by the detailed physiology.