The low quality of work packages is one of the reasons for the failure of projects and leads to losses such as
increasing the costs, projects’ delay and even bankruptcy of the projects’ contractors. One strategy for avoiding
these losses is the investment in the quality of projects. In this paper, we model the dynamic nature of the
investment in the quality of projects and formulate the relationship between cost, time and quality of projects
using the optimal control theory. We show that the proposed model is a linear control problem for which the
optimal path of investment is among some candidate paths and propose a procedure to find the optimal solution
among the eligible paths. The model is applied to two projects, namely a GIS project and a bridge construction
project. The results demonstrate that the quality investment strategy outperforms other strategies such as the
outsourcing of low-quality deliverables to a third party. Moreover, the investment in quality is regarded as the
only strategy for reducing the losses of quality in the first project. In that case, we show that the proposed
optimal path of investment results in less cost than other paths wherein the investment rate and the time of
investment are chosen randomly. Actually, the proper rate and the duration of investment in the proposed model
are determined by making a trade-off between the reworking cost, the investment cost and the time value of
money. Finally, we perform a sensitivity analysis to show the effects of parameters on the optimal path of
investment. The sensitivity analysis indicates that the bridge construction project is sensitive to the elasticity of
the quality level, the quality level at the beginning of the work package and the reworking cost parameters. The
reworking cost also is determined as the most sensitive parameters in the GIS project.