Application of Chebyshev polynomials to the optimal control of time-varying linear systems