Given. Annual demand $D=40{,}000$ units/yr; ordering cost $K=\$16.00$ per order; holding (storage) cost $h=\$2.00$ per unit-year. Part (b) additionally allows planned shortages at a backorder cost $p=\$4.00$ per unit-year.
Find. (a) $TC(Q)$ and the optimal order quantity $Q^*$ with no shortages. (b) $TC(Q,s)$ and the optimal $(Q^*,s^*)$ when shortages (backorders) are allowed.
Saw-tooth inventory position for the planned-shortage policy of part (b): stock rises to $Q^*-s^*=653.2$ at each delivery, falls linearly to $0$, then continues into a backorder pit down to $-s^*=-326.6$ before the next delivery clears it. Part (a) is the same picture with the pit removed ($s=0$).
Approach. Build the classic EOQ average-annual-cost expression (ordering + holding, and + backorder in part b) as a function of the decision variable(s), then set the partial derivative(s) to zero to find the optimum.
Part (a) — total-cost expression, no shortages. One cycle of length $T=Q/D$ has one order (cost $K$) and average on-hand inventory $Q/2$ (holding cost $hQ/2$ per year). Annualizing the per-cycle order cost by dividing by $T$:
$$TC(Q)=\frac{KD}{Q}+\frac{hQ}{2}$$
Part (a) — optimize.$\dfrac{d(TC)}{dQ}=-\dfrac{KD}{Q^2}+\dfrac{h}{2}=0 \Rightarrow Q^{*2}=\dfrac{2KD}{h}$:
$$Q^*=\sqrt{\frac{2KD}{h}}=\sqrt{\frac{2(16)(40{,}000)}{2}}=\sqrt{640{,}000}$$
$$\boxed{Q^*_{(a)}=800\text{ units per order}}$$
Substituting back, $TC(Q^*)=\sqrt{2KDh}=\sqrt{2(16)(40{,}000)(2)}=\$1{,}600.00$ per year.
Part (b) — total-cost expression with planned shortages. With a maximum shortage (backorder) level $s$, the on-hand stock peaks at $Q-s$ and averages $(Q-s)^2/(2Q)$ over the cycle, while the backorder level averages $s^2/(2Q)$ (each derived from the two similar triangles of the saw-tooth):
$$TC(Q,s)=\frac{KD}{Q}+\frac{h(Q-s)^2}{2Q}+\frac{p\,s^2}{2Q}$$
Part (b) — optimize. Setting $\partial(TC)/\partial Q=0$ and $\partial(TC)/\partial s=0$ and solving the pair simultaneously gives the standard planned-shortage EOQ result:
$$Q^*=\sqrt{\frac{2KD}{h}\cdot\frac{h+p}{p}}=\sqrt{\frac{2(16)(40{,}000)}{2}\cdot\frac{2+4}{4}}=\sqrt{640{,}000\times1.5}$$
$$\boxed{Q^*_{(b)}=979.80\text{ units},\qquad s^*=Q^*\frac{h}{h+p}=979.80\times\frac{2}{6}=326.60\text{ units}}$$
The corresponding maximum on-hand stock is $Q^*-s^*=653.20$ units and the minimum annual cost is $TC^*=\sqrt{2KDh\,p/(h+p)}=\$1{,}306.39$, lower than part (a)'s $\$1{,}600.00$ because permitting backorders trades a controlled, cheaper shortage cost for less holding cost.