Considered the problem of flying over restricted areas by an unmanned aerial vehicle (UAV), which have various shapes and restrictions, set on the basis of the international airspace classification system for aviation in accordance with the Chicago Convention and the recommended principles for the formation of forbidden zones, rules for creating a flight route along forbidden zones and actions in case of border violations of restricted areas. The problem of analytical synthesis of the control acceleration of an unmanned aerial vehicle (UAV) is solved during its flight along a route passing along the boundaries of the forbidden zone of a given shape, along a given trajectory, which consists of subsequent segments located at the same height relative to the earth’s surface, in a given coordinate system. The optimal control synthesis problem is solved as an analytical definition of the optimal control of a linear non-stationary system based on the quadratic quality functional. A mathematical model of UAV motion in the horizontal plane is proposed, in the form of a system of ordinary differential equations in the Cauchy form. A law for measuring the control acceleration of the UAV’s center of mass is obtained on the basis of specifying the minimized quality functional and the corresponding constraints, which is a feature of the considered method of solving the problem. The proposed quality functional takes into account the parameters of coordinates and speed of the UAV, which correspond to the given points in the airspace, which characterize the necessary trajectory for flying around the restricted area. The derived mathematical dependences make it possible to implement them on board a UAV and minimize energy costs when guiding a UAV moving through specified points in space. Computer modeling of the derived analytical results, mathematical dependencies representing the optimal trajectory of the UAV flight along the boundaries of the forbidden zone, as well as the corresponding processes of changing the control acceleration and speed of the UAV movement was carried out, which made it possible to draw conclusions about the efficiency of the proposed method and the feasibility of its further use as a basis. for the initial stage of the synthesis of the UAV control system.