Where do the rich and poor live in a city? (Calculus) I am reading 'Cities, Agglomeration and Spatial Equilibrium' by Ed Glaeser.

People live in a monocentric city, where consumers of heterogeneous income $y$ work at the centre of the city. They buy $H(y)$ housing for a price $p(d)$ at distance $d$ from the centre, incurring transport costs $t(y)d$ as they commute to work.

Consumers have a utility function:

$U(C,H)=v(y - t(y)d - p(d)H(y),H(y))$

The budget constraint is:

$C = y - t(y)d - p(d)H(y)$ where C is consumption net of transport and housing.

The tangency condition implies:

$\frac{U_1}{U_2} = p(d)$   

where the subscript 1 denotes partial differentiation w.r.t. the first argument etc.

By the spatial equilibrium assumption, $\frac{dU}{dd}=0$: there are no rents to be gained by changing location.

$\frac{dU}{dd} = U_1(-t(y)-p'(d)H(y))=0$

$\therefore p'(d)=\frac{-t(y)}{H(y)}$: the price of housing declines with distance $d$.

If the income elasticity of housing is greater than that of transport (i.e. $H(y)$ increases in $y$ more than $t(y)$ does), the rich (higher $y$) will live in the suburbs. Mathematically, the denominator gets larger than the numerator and the price gradient is less steep. The willingness to pay declines less with distance for the rich.

The book then defines the income associated with each distance $y(d)$ and differentiates again to find the 2nd order condition, $p''(d)&gt;0$.

The book states that this is:

$p''(d)=\frac{t(y)H'(y)-H(y)t'(y)}{y'(d)}&gt;0$

But I believe this is incorrect an should be:

$p''(d)=\frac{(t(y)H'(y)-H(y)t'(y))y'(d)}{H^2(y)}&gt;0$

Am I correct?

Also, how can you ignore the fact that $y=y(d)$ when calculating the 1st order condition then introduce it when you differentiate to find the 2nd order condition?

Should you not state $U(y(d)-t(y(d))d-p(d)H(y(d)),H(y(d)))$ and differentiate twice?
1. The first question is based on a misreading of the text.
First of all it is quite correct that under the model assumptions stated:
$$(A) \ \ p''(d) = \frac{t(y)H'(y) - t'(y)H(y)}{H(y)^2} y'(d),$$
however there is no problem because the book does not state that
$$(B)\ \ p''(d) = \frac{t(y)H'(y) - t'(y)H(y)}{y'(d)}$$
the book instead states that the second order condition
$$ p''(d) &gt; 0 $$ implies $$(C)\ \ \  \frac{t(y)H'(y) - t'(y)H(y)}{y'(d)} &gt; 0$$
which follows from (A) - the true experssion you have derived for $p''(d)$ - by multiplication of $(H(y))^2$ and division of $(y'(d))^2$.
Nevertheless, I suspect it is a typo even though it is inconsequential.
Obviously, given (C) or [(A) and the second order condition $p''(d)&gt;0$] it follows that $y'(d)&gt;0$ iff
$$t(y)H'(y) - t'(y)H(y) &gt; 0,$$
which again is equivalent to $$\frac{y}{H(y)} H'(y) &gt; \frac{y}{t(y)} t'(y)$$
hence the high income people live in the suburbs ( $y'(d)&gt;0$ income increases in distance from city center) iff and only if the income elasticity of housing is larger than the income elasticity of transport costs $t(y)$.

The second question: How can income be a function of distance $y=y(d)$ when we differentiate the second order condition but not when we consider the first order condition?

The idea is as usual that residents have some income $y$ exogenously given. They cannot decide themselves what income the want nor is their income a product of their location choice. When they choose an optimal location $d^\star$ they choose in such a manner that the first order condition $p'(d) = - t(y)/H(y)$ must hold. However, individuals of different income levels will choose different locations and therefore in equilibrium income will be a function of location $y = y(d)$. Therefore when you want to consider what things are like in equilibrium you can use that income $y$ is a function of $d$.
Glaeser does not proove the existence of such an equilibrium but this type of equilibria with perfect income sorting is known in the literature and the book is a textbook.
The derivation of the first order condition in this simplified model where housing demand is assumed exogenously given as a function of income goes along these lines:
The residents have utility function $U(c,H)$ and income $y - t(y)d$ net transport. They maximize with respect to $c$ so conditonal on $d$ the value function is $U(y - t(y)d - p(d)H(y),H(y))$. In spatial eq. if people with the income $y$ is in the city then they choose some $d^\star$ maximizing the conditional indirect utility function $U(y - t(y)d - p(d)H(y),H(y))$ with respect to $d$ giving the utility $U(y - t(y)d^\star - p(d^\star)H(y),H(y)) = u^\star(y)$. These individuals would only ever consider other locations if they gave the same level of utility (or higher but in that case $u^\star(w)$ would not be maximum). This allows the us to undertake the thought experiment: How would prices have to change as a function of location if other locations gives rise to the same level of utility? This thought experiment is carried out by imposing the condition that $U(y - t(y)d - pH(y),H(y)) = u^\star(y)$ at all locations and solving for the price (giving what is called the bid-function). The derivative of the implied bid-function can be found by differentiating $U(y - t(y)d - pH(y),H(y)) = u^\star(y)$ with respect to $d$ giving the condition $p'(d)H(y) = - t(y)$ which is the wellknown Muth condition.