I am trying to fully understand the process of maximizing a utility function subject to a budget constraint while utilizing the Substitution Method (as opposed to the Lagrangian Method). I am following the work of Henderson and Quandt's Microeconomic Theory (1956).
My confusion lies with obtaining the total differential of the generalized utility function after substituting in the budget constraint. For example, suppose you have the following utility function:
$$U=f(q_1,q_2)$$ Subject to: $$y^0=p_1q_1+p_2q_2$$
The total differential of this utility function is:
$$dU=f_{q_1}dq_1+f_{q_2}dq_2$$
where $f_{q_1}$ and $f_{q_2}$ are the partial derivatives of $U$ with respect to $q_1$ and $q_2$, and $dq_1$ and $dq_2$ are the changes in $q_1$ and $q_2$.
Substituting the budget constraint into the utility function results in: $$U=f(q_1,\frac{y^0-p_1q_1}{p_2})$$
I am struggling to calculate the total differential of the above function. Would the total differential just be the partial derivative of $U$ with respect to $q_1$ multiplied by the change in $q_1$? Below is my attempt:
$$U=f(q_1,\frac{y^0}{p_2}-\frac{p_1}{p_2}q_1)$$ $$dU=f_{q_1}dq_1-\frac{p_1}{p_2}dq_1$$
The next step in the book (after skipping the above total differential) is: $$\frac{dU}{dq_1}=f_1+f_2(-\frac{p_1}{p_2})=0$$
Obviously, my intermediate calculation is incorrect (probably in multiple ways). Can someone identify and clarify my mistakes in progressing from the substituted utility function to the above equation? I understand that this process is used to equate the marginal rate of substitution to the goods price ratio and I am aware of its interpretation. My question lies simply with the mathematical derivation.