Transformatioons of linear system to canonical forms and their applications to optimal control problems