Nonlinear Programming by Wiley 3rd ed, 1.2 a,b (I don't understand obj function) The following is from page 30, chapter 1 of Wiley's Nonlinear Programming: Theory and Algorithms (third edition). This is for a graduate course in Optimization Theory. My problem is that I do not understand how they came up with the objective function from the given information.

[1.2] Suppose that the daily demand for product $j$ is $d_j$ for $j=1,2$. The demand should be met from inventory, and the latter is replenished from production whenever the inventory reaches zero. Here, the production time is assumed to be insignificant. During each production run, $Q_j$ units can be produced at a fixed setup cost of $k_j$ and a variable cost of $c_j Q_j$. Also, a variable inventory-holding cost of $h_j$ per unit per day is also incurred, based on the average inventory. Thus, the total cost associated with product $j$ during $T$ days is $T d_j k_j/Q_j + T c_j d_j + T Q_j h_j/2$. Adequate storage area for handling the maximum inventory $Q_j$ has to be reserved for each product $j$. Each unit of product $j$ needs $s_j$ square feet of storage space, and the total space available is $S$.

a. We wish to find optimal production quantities $Q_1$ and $Q_2$ to minimize the total cost. Construct a model for this problem.
b. Now suppose that shortages are permitted and that production need not start when inventory reaches a level of zero. During the period when inventory is zero, demand is not met and the sales are lost. The loss per unit thus incurred is $l_j$. On the other hand, if a sale is made, the profit per unit is $P_j$. Reformulate the mathematical model.


I have fooled around with this function a little, but have still yet to understand it. The subscripted quantities are clearly vectors. Something strange here is that the quantity $c_j Q_j$ is given meaning in the description but does not appear in the objective function. Why is the third term divided by 2? Is that because half of production is for product 1 and the other half is for product 2 (that doesn't make sense)?
I am not principally concerned with even answering the questions yet, I want to understand the premise first. Can anyone explain this, please?

I am mostly comfortable with the objective function now, and propose the following solution:
Let $C(Q_j)=T[d_j k_j/Q_j + c_j d_j + Q_j h_j/2]$, under the (possibly erroneous) assumption that only $Q_j$ varies and the rest of the unknowns are constant. Under the simplification that all other unknowns are constant, let $a=Td_j k_j$, $b=Th_j/2$, $c=T c_j d_j$. Then
$C(Q_j)=a/Q_j + bQ_j + c$.
Differentiating and setting the derivative equal to zero, we have
$C'(Q_j)=-a(Q_j)^{-2} + b = 0$
$\implies (Q_j)^{2} = b/a$
$\implies Q_j = \pm\sqrt{b/a}$
So then $Q_j = \pm \sqrt{\frac{Td_jk_j}{Th_j/2}}$
In this context, $Q_j \approx \sqrt{\frac{2d_jk_j}{h_j}}$.
Presumably, the information given after the objective function was provided for use in Part b. I'm still thinking about that solution.
