I was reading through Jan Brueckner's "Lectures on Urban Economics" (2011), which is a "rigorous, but non-technical" explanation of various topics in urban economics. It was supposed to be light holiday reading, but my goofy existence wondered about how to do the math for a particular section. The consumer model at the start of chapter 2 is based off of his work in a specific chapter from the Handbook of Regional and Urban Economics. You can find the more detailed article here, but a non-paywalled version here may be more useful to refer to. I will distinguish between referring to the simpler "lectures" and the "Muth-Mills article" that I have linked to.
The very simple urban model has everyone commute to a point in the center of the city and everyone has the same preferences. There is a cost of commuting and there are two goods to buy, dwelling size which is rented out, and some all encompassing consumer good.
Mathematically, the problem is:
$$\max_{\{c, q \}} \quad v(c, q)$$ $$\text{s.t.} \quad c + pq = y - tx$$
$c$ is consumption (a numeraire good), $p$ is the rental price per square foot, $q$ is the square feet of dwelling space, $y$ is the identical income everyone gets from working, $t$ is the constant price of driving per mile, and $x$ is the distance in miles from the city center. And of course $v$ is the utility function.
Since all consumers are identical in this model, equilibrium price is characterized by whether you get the same utility no matter where you choose to live. If you live in the suburbs (further from the city center), you pick a lot of dwelling space but less consumption, and your commute is longer. If you live closer to the city you pick a smaller dwelling space and more consumption, with a smaller commute time.
The indifference curve he draws in the lectures implies convex preferences, so we will keep that in mind for characterizing $v$. His main conclusion in the lectures is that $p$ falls as $x$ increases, and $q$ rises and $x$ rises.
Intuitively, this all makes perfect sense to me, but although I can find $\frac{\partial p}{\partial x}$, I cannot find $\frac{\partial q}{\partial x}$, even following along with the Muth-Mills article, there is a total derivative that is giving me trouble.
I found $\frac{\partial p}{\partial x}$ by simply rearranging the budget constraint so that it read
$$p = \frac{y - tx - c}{q}$$
and the derivative is:
$$\frac{\partial p}{\partial x} = - \frac{t}{q}$$
The same cannot be done for $\frac{\partial q}{\partial x}$, as the sign would not be correct, and I thought about why and figured it probably has to do something with the fact that $q$ is chosen conditionally on $p$. It was here that I then turned to the Muth-Mills article.
In it, the maximization substitutes for $c$ by incorporating the budget constraint.
$$\max_q \quad v(y - tx - pq, q)\tag{1}$$
The first order condition sets the marginal rate of substitution equal to the price ratio:
$$\frac{v_2(y - tx - pq, q)}{v_1(y - tx - pq, q)} = p \tag{2}$$
And in equilibrium you have to reach the same utility no matter where you choose to live in the city. (So rather than fix price, we fix utility in this model.)
$$v(y - tx - pq, q) = u \tag{3}$$
The article then asks us to take the total derivative of $(3)$ with respect to $x$ and arrive at:
$$-v_1 \left( t + \frac{\partial p}{\partial x} q + p \frac{\partial q}{\partial x}\right) + v_2 \frac{\partial q}{\partial x} = 0 \tag{4}$$
And since $(2)$ implies $v_2 = pv_1$, the article then plugs this into $(4)$ to find the comparative static for $p$ given a change in $x$:
$$\frac{\partial p}{\partial x} = - \frac{t}{q}\tag{5}$$
Finally, the article reaches some form of the comparative static I am interested in:
"Note that since utility is constant, the increase in $q$ corresponds exactly to the substitution effect of the housing price decrease. Formally, it follows that
$$\frac{\partial q}{\partial x} = \eta\frac{\partial p}{\partial x} \tag{6}$$
where $\eta < 0$ is the slope of the appropriate income-compensated (constant-utility) demand curve."
So my main question really is just how do you fill in the steps to calculate the total derivative of $(3)$? I think I will feel really quite silly when I see the answer, but I cannot seem to work out where the dependencies are in trying to setup the chain rule here.
The closest thing I have gotten to a coherent attempt was to express the total derivative as:
$$\frac{\partial v(y - tx - pq, q)}{\partial x} = \frac{\partial v}{\partial (y - tx - pq)} \cdot \frac{\partial (y - tx - pq)}{\partial x} + \frac{\partial v}{\partial q} \cdot \frac{\partial q}{\partial x}$$
but I am not sure if this is correct or how to proceed (how to further break up the first set of partials into appropriate parts for the chain rule).
Additionally, I am wondering how to arrive at $(6)$, which I figure is some sort of Slutsky's decomposition, but I have not touched this part of the model yet. I will give a bonus for this harder section because typing up a bunch of matrices does not seem like much fun. Hopefully someone out there over the holidays is around to help out, and thanks in advance.
References:
Brueckner, Jan K. "The structure of urban equilibria: A unified treatment of the muth-mills model." In Handbook of Regional and Urban Economics, vol. 2, pp. 821-845. Elsevier, 1987.