This paper presents the linear quadratic tracking (LQT) control of a quadrotor UAV by solving discrete time matrix difference Riccati Equation. First, the nonlinear dynamic model of the quadrotor is obtained by using Newton's equations of motion. Then, the nonlinear dynamic model is linearized around hover condition. The linearized dynamic model is used to solve the optimal control problem. A trade off between good tracking performance and energy consumption is made while defining the performance index (cost function). Time-variant optimal control gains are found off-line by solving discrete time matrix difference Riccati Equation backwards in time. Finally, to validate optimal control system, simulations are performed by using the nonlinear dynamic model as plant and time-variant optimal control gains as state feedback control. The optimal control algorithm used in this paper uses time-variant control gains instead of fixed (time-invariant) control gains used in classical LQR control. Simulations show that, good tracking performance is achieved while decreasing energy consumption compared to the fixed gain LQR control. Some other advantageous properties of the optimal control system used in this paper compared to the fixed gain LQR control are also analyzed. In addition, disturbance rejection properties of the optimal control system are also studied. All algorithms and simulations are done by using MATLAB software.