The economic order quantity (EOQ) formula plays an important role in inventory management. EOQ model has had on a century of researchers and practitioners in the fields of operations management and operations research. EOQ model appeared in Harris (1913) describes a very simple deterministic inventory planning model with a tradeoff between fixed ordering cost and inventory carrying cost  . EOQ lays the foundation for all kinds of extensions and real world management applications     . Both the deterministic and the stochastic EOQ models were developed in      . The Economic Order Quantity (EOQ) is the number of units that a company should add to inventory with each order to minimize the total costs of inventory―such as holding costs, and shortage costs. The EOQ is used as part of a continuous review inventory system in which the level of inventory monitored at all times and a fixed quantity is ordered each time the inventory level reaches a specific reorder point. The EOQ provides a model for calculating the appropriate reorder point and the optimal reorder quantity to ensure the instantaneous replenishment of inventory with no shortages. It can be a valuable tool for small business owners who need to make decisions about how much inventory to keep on hand, how many items to order each time, and how often to reorder to incur the lowest possible costs.
The EOQ model assumes that demand is constant, and that inventory is depleted at a fixed rate until it reaches zero. At that point, a specific number of items arrive to return the inventory to its beginning level. Since the model assumes instantaneous replenishment, there are no inventory shortages or associated costs. Therefore, the cost of inventory under the EOQ model involves a tradeoff between inventory holding costs (the cost of shortage, as well the cost of tying up capital in inventory rather than investing or using it other purposes) and order costs (any fees associated with placing orders, such as delivery charges). Ordering a large amount at one time will increase a small business’s holding costs, while making more frequent orders of fewer items will reduce holding costs but increase order costs. The EOQ model finds the quantity that minimizes the sum of these costs.
The EOQ model computed by the following formula , where
D is the demand per time unit, c is the ordering cost, is the holding cost a per unit and time unit.
Research on the EOQ can be primarily classified into three areas of interest:
1) The performance of the EOQ against other lot-sizing rules: Lot size refers to the quantity of an item ordered for delivery on a specific date or manufactured in a single production run. Choi et al.  examined the EOQ versus eight other rules in multi-echelon MRP systems using FORTRAN, with the EOQ performing in the lower third. Evan L. Porteus  has introduced a model that shows a significant relationship between quality and lot size. Melnyk and Piper  examined the effects of lead time errors on different lot sizing rules.
2) Extensions of the EOQ model: EOQ extensions include an application to retail cycle stock inventories  , the addition of cost changes under a finite or infinite time horizon  , the inclusion of storage size considerations  , and the addition of damage costs   provided an exhaustive summary of the research on EOQ models that handle partial backordering, and some even more current models with partial or full backordering include those by    and  .
3) The role of the EOQ in logistics: Research that addressed the use of EOQ models in transportation and logistics first appeared in the 1980s. Eppen  was the first to discuss the ‘‘impact of inventories’’ on locations by exploiting risk pooling effects. Tanchoco et al.  considered the impact of material handling and the transportation of unit loads on lot sizing. Ng et al.  studied a type of EOQ problem where the (maximum) warehouse capacity is a decision variable. Furthermore, they assumed that the warehouse cost dominates all the other inventory holding costs. Keskin et al.  study generalized vendor selection models aimed at optimizing the total logistical costs including not only the vendor-specific fixed management and purchasing costs considered in traditional models, but also the transportation, inventory replenishment, and holding costs.
In their models, the authors mainly used convex optimization as a mathematical tool. However, dynamic models for EOQ have been less considered. To fulfill this gape, we formulate in this paper EOQ model as a calculus of variations. The new problem is a simple optimal control which can be solved by Euler-Lagrange equation as optimality conditions. In particular, we obtain the well-known EOQ formula  .
2. Calculus Variations Approach to EOQ
Assume that holding cost per unit depends on its rate and quantity of items.
In other words,
where , C is the cost function at moment t per each inventory. And q is the quantity inventory.
Then total cost is
Economic order quantity problem can be formulated as a problem of calculus of variations with a free left side constraint .
where, : order quantity function, : economic order quantity, T: final time,
In order to solve problem (2), we need to solve Euler-Lagrange equation  as an optimality condition for the calculus of variations.
Let be a solution to problem (3). The constants and can be found from the boundary conditions  solving a system of nonlinear equations.
For example, if we have , then Euler-Lagrange equation is:
The solution is .
Clearly, , and the system (4) gives
Now we have condition (4) as
Hence, we have and consequently, Then optimal solution is
In practice, usually type of order quantity function is given. For instance,
, and holding cost per unit is constant . Then total cost minimum problem is:
where, D is demand for the period T, and c ordering cost. b can be expressed as
Then the cost function TC has the form.
Taking derivative of TC, we have
Now we obtain
We find optimal order quantity as
If we take T = 1, then we have well known economic order quantity formula (EOQ) in the literature  .
An extended EOQ model has been considered for the first time as a simple optimal control problem with an unknown initial state. In particular, from the proposed model we obtain the well-known EOQ formula. The proposed approach allows to examine the order quantity function from a view point of dynamic system. That is why the stock can be controlled at each action time. The model was tested on a numerical example.
This work was supported by the research grants P2017-2373 of National University of Mongolia.