In the paper a Lyapunov matrices approach to the parametric optimization problem of a time-delay system with two commensurate delays and a PI-controller is presented. The value of integral quadratic performance index is equal to the value of the Lyapunov functional for the initial function of the time-delay system. The Lyapunov functional is determined by means of the Lyapunov matrix. In the paper is presented the example of a scalar system with two delays and a PI controller.