In the calculation on EOQ (Economic Order Quantity). Why carrying cost must divide by 2?

Because for simplicity (omitting discounting/interest rate for borrowed resources) formula takes average cost between beginning of cycle (without safety stock it it will be zero units remaining) and end of cycle (maximal stock).
So for one cycle (replenishment):
starting stock = 0 (carrying cost = C•Q=C•0=0 )
ending stock = Q (carrying cost = C•Q )
Cycle carrying cost = C•(0+Q)/2 = C•Q/2

A quantity discount is a price discount on an item if predetermined numbers of units.In the preceding formula PD is a constant value that would not alter the basic.The EOQ cost model with constant carrying costs for a pricing schedule with .