This paper presents a control-based trajectory generation approach for unmanned aerial vehicles (UAVs) under dynamic constraints. It exploits the concept of optimal control to find closedform differential equations that satisfy any arbitrary dynamic limitation mapped into kinematic constraints. Pontryagin's Minimum Principle applies to derive a set of differential equations in which the dynamic environment is considered in the constrained Hamiltonian function. In particular, we aim to minimize the L 2 -norm of the control input avoiding dynamic obstacles, given initial and final boundary conditions. Lastly, this paper proposes a novel interpolation algorithm based on rational functions, referred to as rational recursive smooth trajectory (RRST) method. The method generates an analytic expression that approximates the control inputs, for which no closed-form solutions are in general attainable.