Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Connects to: Principles Parts I–II


This part builds the mathematical scaffolding that every subsequent part uses. Readers who have taken a year of calculus and a semester of linear algebra will find it a targeted review with macroeconomic applications — not a repetition of what they already know, but a reframing of familiar tools in the language of economic models. Each chapter introduces its tools in the context of a specific macroeconomic question, so that the mathematics never floats free of motivation.

Chapter 1 develops optimization theory — the mathematical heart of all macroeconomic modeling, since macroeconomics is the study of agents who optimize subject to constraints. Chapter 2 applies linear algebra to economic systems, deriving the Leontief inverse and the IS–LM solution as matrix problems. Chapters 3 and 4 develop differential and difference equations respectively, covering the analytical toolkit for the dynamic models of Parts III–IV. Chapter 5 introduces the stochastic processes — particularly the AR(1) — that appear as the shock processes in every model from Chapter 17 onward.

A note on difficulty: Chapter 1 through Chapter 5 are sequenced so that each builds on the previous, but they are also largely self-contained. A reader who wants only the stochastic methods of Part V can read Chapter 5 directly after Chapter 2.


Chapter 1: Calculus and Optimization in Macroeconomics

From Utility Maximization to Lagrange Multipliers

“Optimization is the heart of economics. Almost every economic model, at its core, is an optimization problem.” — Thomas Sargent

Cross-reference: Principles Ch. 1 (scope of macroeconomics); Ch. 11 (consumption theory, Euler equation); Ch. 12 (investment theory, Tobin’s q); Ch. 13 (labour supply and demand) [P:Ch.1, P:Ch.11, P:Ch.12, P:Ch.13]


1.1 Why Calculus? The Optimization Imperative

Macroeconomics, at every level of sophistication, is a discipline about constrained choice. A household chooses a consumption path to maximize lifetime utility subject to a budget constraint. A firm chooses investment to maximize the present value of profits subject to an adjustment cost technology. A central bank chooses a path for the interest rate to minimize a loss function subject to the constraints imposed by the Phillips curve and the IS relationship. In each case, the economic content is carried by the optimization problem, and the calculus is the language in which that problem is solved.

The models of Principles frequently invoke optimization without deriving the conditions in full. Chapter 11 of Principles states the Euler equation u(ct)=β(1+rt+1)Et[u(ct+1)]u'(c_t) = \beta(1+r_{t+1})\mathbb{E}_t[u'(c_{t+1})] and then explains it verbally; this chapter derives it, together with every other first-order condition that appears in Principles, from the underlying optimization problem. The derivations are not decorative. They matter because:

  1. They reveal what assumptions the result depends on — and what happens when those assumptions are relaxed.

  2. They provide the algebraic form needed for numerical computation (Part VI).

  3. They are the basis for comparative statics — understanding how the equilibrium changes when parameters change.

We begin with unconstrained optimization, move to equality-constrained problems (the Lagrangian), then to inequality-constrained problems (Kuhn–Tucker conditions), and finally to the implicit function theorem, which turns comparative statics from a graphical exercise into an algebraic one.


1.2 Unconstrained Optimization

1.2.1 Single-Variable Problems

Definition 1.1 (Local and Global Maxima). Let f:RRf: \mathbb{R} \to \mathbb{R}. A point xRx^* \in \mathbb{R} is a local maximum of ff if there exists ε>0\varepsilon > 0 such that f(x)f(x)f(x^*) \geq f(x) for all xx with xx<ε|x - x^*| < \varepsilon. It is a global maximum if f(x)f(x)f(x^*) \geq f(x) for all xRx \in \mathbb{R}.

The fundamental result connecting calculus to optimization:

Theorem 1.1 (First-Order Necessary Condition). If ff is differentiable and xx^* is a local maximum (or minimum) of ff, then f(x)=0f'(x^*) = 0.

Proof sketch. If f(x)>0f'(x^*) > 0, then by continuity of ff' there exists δ>0\delta > 0 such that f(x)>0f'(x) > 0 for all x(xδ,x+δ)x \in (x^* - \delta, x^* + \delta). Then ff is strictly increasing on this interval, so f(x+δ/2)>f(x)f(x^* + \delta/2) > f(x^*), contradicting xx^* being a local maximum. Similarly for f(x)<0f'(x^*) < 0. \square

The first-order condition (FOC) f(x)=0f'(x^*) = 0 is necessary but not sufficient. Points where f(x)=0f'(x) = 0 are called critical points or stationary points; they may be maxima, minima, or inflection points.

Theorem 1.2 (Second-Order Sufficient Conditions). Let ff be twice differentiable and let xx^* satisfy f(x)=0f'(x^*) = 0.

  • If f(x)<0f''(x^*) < 0, then xx^* is a strict local maximum.

  • If f(x)>0f''(x^*) > 0, then xx^* is a strict local minimum.

  • If f(x)=0f''(x^*) = 0, the test is inconclusive.

Application to macroeconomics: The Baumol–Tobin money demand model of Principles Ch. 14 minimizes total cost TC(n)=iY/(2n)+bnTC(n) = iY/(2n) + bn over the number of bank trips nn. Setting TC(n)=0TC'(n) = 0:

iY2n2+b=0    n=iY2b.-\frac{iY}{2n^2} + b = 0 \implies n^* = \sqrt{\frac{iY}{2b}}.

The second derivative TC(n)=iY/n3>0TC''(n) = iY/n^3 > 0 confirms this is a minimum.

1.2.2 Multivariate Unconstrained Optimization

Let f:RnRf: \mathbb{R}^n \to \mathbb{R}. The gradient is:

f(x)=(fx1,fx2,,fxn).\nabla f(\mathbf{x}) = \left(\frac{\partial f}{\partial x_1}, \frac{\partial f}{\partial x_2}, \ldots, \frac{\partial f}{\partial x_n}\right)'.

Theorem 1.3 (Multivariate FOC). If x\mathbf{x}^* is a local maximum or minimum of a differentiable f:RnRf: \mathbb{R}^n \to \mathbb{R}, then f(x)=0\nabla f(\mathbf{x}^*) = \mathbf{0}.

The second-order conditions require the Hessian matrix:

Hf(x)=(2fx122fx1x22fx2x12fx22).H_f(\mathbf{x}) = \begin{pmatrix} \frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2} & \cdots \\ \frac{\partial^2 f}{\partial x_2 \partial x_1} & \frac{\partial^2 f}{\partial x_2^2} & \cdots \\ \vdots & \vdots & \ddots \end{pmatrix}.

By Young’s theorem (symmetry of mixed partials), HfH_f is symmetric.

Definition 1.2 (Positive and Negative Definite Matrices). A symmetric matrix AA is positive definite if vAv>0\mathbf{v}'A\mathbf{v} > 0 for all nonzero vRn\mathbf{v} \in \mathbb{R}^n; equivalently, all eigenvalues of AA are strictly positive. It is negative definite if vAv<0\mathbf{v}'A\mathbf{v} < 0 for all nonzero v\mathbf{v}; equivalently, all eigenvalues are strictly negative. It is indefinite if it has both positive and negative eigenvalues.

Theorem 1.4 (Multivariate Second-Order Conditions). At a critical point x\mathbf{x}^*:

  • Hf(x)H_f(\mathbf{x}^*) negative definite \Rightarrow strict local maximum.

  • Hf(x)H_f(\mathbf{x}^*) positive definite \Rightarrow strict local minimum.

  • Hf(x)H_f(\mathbf{x}^*) indefinite \Rightarrow saddle point.

A practical check for negative definiteness: the leading principal minors of Hf-H_f must all be positive (i.e., HfH_f is negative definite iff Hf-H_f is positive definite iff all leading principal minors of Hf-H_f are positive).

1.2.3 The Envelope Theorem

The envelope theorem answers the question: how does the optimized value of the objective function change when a parameter changes, without re-solving the optimization problem?

Theorem 1.5 (Envelope Theorem, Unconstrained). Let f(x;α)f(x; \alpha) be differentiable in both xx and the parameter α\alpha. Define the value function V(α)=maxxf(x;α)V(\alpha) = \max_x f(x; \alpha), with maximizer x(α)x^*(\alpha) (assuming it is differentiable in α\alpha). Then:

dVdα=f(x(α);α)α.\frac{dV}{d\alpha} = \frac{\partial f(x^*(\alpha); \alpha)}{\partial \alpha}.

That is, the total derivative of the value function with respect to a parameter equals the partial derivative of the objective with respect to that parameter, evaluated at the optimum. The channel through which α\alpha changes the optimal xx^* — the indirect effect — contributes nothing to the change in VV because fx(x;α)=0f_x(x^*;\alpha) = 0 at the optimum.

Proof:

dVdα=ddαf(x(α);α)=fx(x(α);α)=0 by FOCdxdα+fα(x(α);α)=fα(x(α);α).\frac{dV}{d\alpha} = \frac{d}{d\alpha} f(x^*(\alpha);\alpha) = \underbrace{f_x(x^*(\alpha);\alpha)}_{=0 \text{ by FOC}} \cdot \frac{dx^*}{d\alpha} + f_\alpha(x^*(\alpha);\alpha) = f_\alpha(x^*(\alpha);\alpha). \quad \square

Application: In the firm’s investment problem of Principles Ch. 12, the Hamiltonian is the value function and the shadow price qtq_t (Tobin’s qq) is the envelope of the profit function with respect to the capital stock. The costate equation q˙=rqFK\dot{q} = rq - F_K is the envelope theorem applied to the continuous-time optimal control problem — we derive this fully in Chapter 11.


1.3 Constrained Optimization: Equality Constraints

Most optimization problems in macroeconomics involve constraints. The household maximizes utility subject to a budget constraint; the firm maximizes profit subject to a production technology. Equality constraints are handled by the method of Lagrange multipliers.

1.3.1 The Lagrangian Method

Definition 1.3 (Lagrangian). For the problem maxxf(x)\max_{\mathbf{x}} f(\mathbf{x}) subject to g(x)=0g(\mathbf{x}) = 0, the Lagrangian function is:

L(x,λ)=f(x)λg(x),\mathcal{L}(\mathbf{x}, \lambda) = f(\mathbf{x}) - \lambda\, g(\mathbf{x}),

where λR\lambda \in \mathbb{R} is the Lagrange multiplier or shadow price associated with the constraint.

Theorem 1.6 (Lagrange Necessary Conditions). If x\mathbf{x}^* is a local maximum of ff subject to g(x)=0g(\mathbf{x}) = 0, and if the constraint qualification g(x)0\nabla g(\mathbf{x}^*) \neq \mathbf{0} holds, then there exists λ\lambda^* such that:

xL(x,λ)=0andg(x)=0.\nabla_{\mathbf{x}} \mathcal{L}(\mathbf{x}^*, \lambda^*) = \mathbf{0} \quad \text{and} \quad g(\mathbf{x}^*) = 0.

In components: f/xi=λg/xi\partial f/\partial x_i = \lambda^* \partial g/\partial x_i for all ii, plus the constraint.

Derivation from first principles. Consider maxx1,x2f(x1,x2)\max_{x_1, x_2} f(x_1, x_2) subject to g(x1,x2)=0g(x_1, x_2) = 0. Since the constraint implicitly defines x2x_2 as a function of x1x_1 near the optimum (by the IFT, provided gx20g_{x_2} \neq 0), we can write x2=h(x1)x_2 = h(x_1) where h(x1)=gx1/gx2h'(x_1) = -g_{x_1}/g_{x_2}. Substituting into the objective and taking the total derivative with respect to x1x_1:

ddx1f(x1,h(x1))=fx1+fx2h(x1)=fx1fx2gx1gx2=0.\frac{d}{dx_1}f(x_1, h(x_1)) = f_{x_1} + f_{x_2} h'(x_1) = f_{x_1} - f_{x_2}\frac{g_{x_1}}{g_{x_2}} = 0.

Rearranging: fx1/gx1=fx2/gx2λf_{x_1}/g_{x_1} = f_{x_2}/g_{x_2} \equiv \lambda^*. This gives fxi=λgxif_{x_i} = \lambda^* g_{x_i} for i=1,2i=1,2, which are exactly the FOCs of the Lagrangian. \square

1.3.2 Economic Interpretation of the Lagrange Multiplier

The Lagrange multiplier λ\lambda^* measures the marginal value of relaxing the constraint. Formally, if the constraint is g(x)=cg(\mathbf{x}) = c (parameterized by cc) and V(c)=maxx:g(x)=cf(x)V(c) = \max_{\mathbf{x}: g(\mathbf{x})=c} f(\mathbf{x}), then dV/dc=λdV/dc = \lambda^*. Each unit increase in cc allows the agent to reach a higher objective by exactly λ\lambda^*.

In the household problem with budget constraint p1x1+p2x2=mp_1 x_1 + p_2 x_2 = m, the Lagrange multiplier is the marginal utility of income: λ=dV/dm\lambda^* = dV/dm where V(m)V(m) is the indirect utility function. In the firm’s problem with a capital constraint, λ\lambda^* is the shadow price of capital — Tobin’s qq [P:Ch.12].

1.3.3 Multiple Equality Constraints

For maxf(x)\max f(\mathbf{x}) subject to gj(x)=0g_j(\mathbf{x}) = 0, j=1,,mj = 1, \ldots, m (with m<nm < n), the Lagrangian is:

L(x,λ)=f(x)j=1mλjgj(x),\mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}) = f(\mathbf{x}) - \sum_{j=1}^m \lambda_j g_j(\mathbf{x}),

and the FOCs are xL=0\nabla_{\mathbf{x}} \mathcal{L} = \mathbf{0} and gj(x)=0g_j(\mathbf{x}) = 0 for all jj, giving n+mn + m equations in n+mn + m unknowns.

Worked Example 1.1: Household Utility Maximization

A household maximizes u(c1,c2)=c11σ/(1σ)+βc21σ/(1σ)u(c_1, c_2) = c_1^{1-\sigma}/(1-\sigma) + \beta c_2^{1-\sigma}/(1-\sigma) subject to c1+c2/(1+r)=wc_1 + c_2/(1+r) = w, where β(0,1)\beta \in (0,1), σ>0\sigma > 0, and ww is lifetime wealth. Find the optimal consumption plan and the Lagrange multiplier.

Solution. The Lagrangian:

L=c11σ1σ+βc21σ1σλ(c1+c21+rw).\mathcal{L} = \frac{c_1^{1-\sigma}}{1-\sigma} + \beta\frac{c_2^{1-\sigma}}{1-\sigma} - \lambda\left(c_1 + \frac{c_2}{1+r} - w\right).

First-order conditions:

Lc1=c1σλ=0    λ=c1σ,\frac{\partial\mathcal{L}}{\partial c_1} = c_1^{-\sigma} - \lambda = 0 \implies \lambda = c_1^{-\sigma},
Lc2=βc2σλ1+r=0    λ=β(1+r)c2σ.\frac{\partial\mathcal{L}}{\partial c_2} = \beta c_2^{-\sigma} - \frac{\lambda}{1+r} = 0 \implies \lambda = \beta(1+r) c_2^{-\sigma}.

Equating: c1σ=β(1+r)c2σc_1^{-\sigma} = \beta(1+r) c_2^{-\sigma}, which gives the Euler equation:

c2c1=[β(1+r)]1/σ.\frac{c_2}{c_1} = [\beta(1+r)]^{1/\sigma}.

This is exactly equation (11.14) in Principles Ch. 11 [P:Ch.11.2], now derived explicitly. Substituting into the budget constraint and solving:

c1=w1+[β(1+r)]1/σ1+r,c2=[β(1+r)]1/σc1,λ=(c1)σ.c_1^* = \frac{w}{1 + \frac{[\beta(1+r)]^{1/\sigma}}{1+r}}, \quad c_2^* = [\beta(1+r)]^{1/\sigma} c_1^*, \quad \lambda^* = (c_1^*)^{-\sigma}.

The shadow price λ\lambda^* is the marginal utility of wealth: gaining one more unit of ww raises lifetime utility by (c1)σ(c_1^*)^{-\sigma}. \square


1.4 Constrained Optimization: Inequality Constraints

When constraints may or may not bind at the optimum — as in the borrowing constraint of Principles Ch. 11.4 — the Kuhn–Tucker conditions replace the simple Lagrange conditions.

1.4.1 The Kuhn–Tucker Conditions

Theorem 1.7 (Kuhn–Tucker Necessary Conditions). Consider maxxf(x)\max_{\mathbf{x}} f(\mathbf{x}) subject to gj(x)0g_j(\mathbf{x}) \leq 0 for j=1,,mj = 1, \ldots, m. Define the Lagrangian L(x,μ)=f(x)jμjgj(x)\mathcal{L}(\mathbf{x}, \boldsymbol{\mu}) = f(\mathbf{x}) - \sum_j \mu_j g_j(\mathbf{x}). If x\mathbf{x}^* is a local maximum and a constraint qualification holds, then there exist μj0\mu_j^* \geq 0 such that:

  1. Stationarity: xL(x,μ)=0\nabla_{\mathbf{x}} \mathcal{L}(\mathbf{x}^*, \boldsymbol{\mu}^*) = \mathbf{0}

  2. Primal feasibility: gj(x)0g_j(\mathbf{x}^*) \leq 0 for all jj

  3. Dual feasibility: μj0\mu_j^* \geq 0 for all jj

  4. Complementary slackness: μjgj(x)=0\mu_j^* g_j(\mathbf{x}^*) = 0 for all jj

The complementary slackness condition is the key: either the constraint is binding (gj(x)=0g_j(\mathbf{x}^*) = 0) or the multiplier is zero (μj=0\mu_j^* = 0), or both. If a constraint is not binding, it plays no role in the optimum.

Application to the liquidity-constrained consumer [P:Ch.11.4]: The household maximizes u(ct)+βE[u(ct+1)]u(c_t) + \beta\mathbb{E}[u(c_{t+1})] subject to at+1=(1+r)(at+ytct)a_{t+1} = (1+r)(a_t + y_t - c_t) and the borrowing constraint at+1ba_{t+1} \geq \underline{b}. Writing the constraint as at+1+b0-a_{t+1} + \underline{b} \leq 0, the KKT conditions add a multiplier μt0\mu_t \geq 0:

u(ct)=β(1+r)E[u(ct+1)]+μt,μt(at+1b)=0.u'(c_t) = \beta(1+r)\mathbb{E}[u'(c_{t+1})] + \mu_t, \quad \mu_t(a_{t+1} - \underline{b}) = 0.

When the constraint binds (at+1=ba_{t+1} = \underline{b}): μt=u(ct)β(1+r)E[u(ct+1)]>0\mu_t = u'(c_t) - \beta(1+r)\mathbb{E}[u'(c_{t+1})] > 0 — the household is “constrained” in the sense that the Euler equation holds with a positive wedge. When the constraint is slack: μt=0\mu_t = 0 and the standard Euler equation holds. This is the formal derivation of Principles equation (11.16).


1.5 The Implicit Function Theorem and Comparative Statics

Comparative statics asks: when a parameter changes, how does the equilibrium change? The implicit function theorem (IFT) provides the algebraic tool for answering this question systematically.

Theorem 1.8 (Implicit Function Theorem — Scalar Version). Let F(x,α):R2RF(x, \alpha): \mathbb{R}^2 \to \mathbb{R} be continuously differentiable. Suppose F(x,α)=0F(x^*, \alpha^*) = 0 and Fx(x,α)0F_x(x^*, \alpha^*) \neq 0. Then there exists a neighborhood of α\alpha^* and a unique continuously differentiable function x=x(α)x = x(\alpha) such that x(α)=xx(\alpha^*) = x^* and F(x(α),α)=0F(x(\alpha), \alpha) = 0. Moreover:

dxdα=Fα(x,α)Fx(x,α).\frac{dx^*}{d\alpha} = -\frac{F_\alpha(x^*, \alpha^*)}{F_x(x^*, \alpha^*)}.

The multivariate version: if F(x,α)=0\mathbf{F}(\mathbf{x}, \boldsymbol{\alpha}) = \mathbf{0} defines x\mathbf{x} implicitly as a function of α\boldsymbol{\alpha} near (x,α)(\mathbf{x}^*, \boldsymbol{\alpha}^*), and if the Jacobian F/x\partial\mathbf{F}/\partial\mathbf{x} is nonsingular at (x,α)(\mathbf{x}^*, \boldsymbol{\alpha}^*), then:

dxdα=(Fx)1Fα.\frac{d\mathbf{x}^*}{d\boldsymbol{\alpha}} = -\left(\frac{\partial\mathbf{F}}{\partial\mathbf{x}}\right)^{-1} \frac{\partial\mathbf{F}}{\partial\boldsymbol{\alpha}}.

This is the fundamental formula for comparative statics in any system of equilibrium conditions.

Worked Example 1.2: Comparative Statics for the IS Curve

Derive the slope of the IS curve (how YY changes with rr in goods-market equilibrium) using the IFT.

The IS curve is the locus satisfying F(Y,r)YC(YT)I(r)G=0F(Y, r) \equiv Y - C(Y - T) - I(r) - G = 0. Then:

FY=1C(YT),Fr=I(r).F_Y = 1 - C'(Y - T), \quad F_r = -I'(r).

By the IFT:

dYdrIS=FrFY=I(r)1C=I(r)1C<0,\left.\frac{dY}{dr}\right|_{\text{IS}} = -\frac{F_r}{F_Y} = -\frac{-I'(r)}{1 - C'} = \frac{I'(r)}{1 - C'} < 0,

since I(r)<0I'(r) < 0 and 1C>01 - C' > 0. The IS curve slopes downward, with steeper slope when the MPC CC' is large (strong multiplier) or investment is insensitive to the interest rate (small I|I'|). This is the algebraic derivation of the IS slope stated qualitatively in Principles Ch. 9.1 [P:Ch.9.1]. \square


1.6 Concavity, Convexity, and Global Optima

The FOCs and SOCs identify local optima. For global optima, we need concavity or convexity.

Definition 1.4 (Concave and Convex Functions). A function f:CRf: C \to \mathbb{R} defined on a convex set CRnC \subseteq \mathbb{R}^n is concave if for all x,yC\mathbf{x}, \mathbf{y} \in C and θ[0,1]\theta \in [0,1]:

f(θx+(1θ)y)θf(x)+(1θ)f(y).f(\theta\mathbf{x} + (1-\theta)\mathbf{y}) \geq \theta f(\mathbf{x}) + (1-\theta) f(\mathbf{y}).

It is strictly concave if the inequality is strict for xy\mathbf{x} \neq \mathbf{y} and θ(0,1)\theta \in (0,1).

Proposition 1.1. If ff is strictly concave, any local maximum is also a global maximum. If ff is twice differentiable, it is concave iff HfH_f is negative semi-definite everywhere.

Most utility functions used in macroeconomics are strictly concave: u(c)=lncu(c) = \ln c, u(c)=c1σ/(1σ)u(c) = c^{1-\sigma}/(1-\sigma) for σ>0\sigma > 0, and u(c)=(cc)2u(c) = -(c - c^*)^2 are all strictly concave in cc. This guarantees that the Lagrange FOCs identify a global maximum.

For convex constraint sets (which are the rule in consumer and producer theory), the constraint qualification is automatically satisfied, and the Lagrange/KKT conditions are both necessary and sufficient under concavity of the objective.


1.7 Worked Example: Deriving the Labour Supply Curve

Cross-reference: Principles Ch. 13 (labour supply and demand) [P:Ch.13.1]

Consider a household with preferences u(c,)=lnc+χlnu(c, \ell) = \ln c + \chi \ln \ell, where cc is consumption and =1n\ell = 1 - n is leisure (nn is hours worked), and χ>0\chi > 0 is the relative weight on leisure. The budget constraint is c=wn+ac = w n + a (wage income plus non-labour income aa), and time is normalized so +n=1\ell + n = 1.

Step 1: Write the constrained problem.

maxc,nlnc+χln(1n)s.t.c=wn+a.\max_{c, n} \ln c + \chi \ln(1-n) \quad \text{s.t.} \quad c = wn + a.

Substitute the constraint: maxnln(wn+a)+χln(1n)\max_n \ln(wn + a) + \chi\ln(1-n).

Step 2: First-order condition.

ddn[ln(wn+a)+χln(1n)]=wwn+aχ1n=0.\frac{d}{dn}\left[\ln(wn+a) + \chi\ln(1-n)\right] = \frac{w}{wn+a} - \frac{\chi}{1-n} = 0.

Step 3: Solve for nn^*.

w(1n)=χ(wn+a)    wwn=χwn+χa    n(w,a)=wχaw(1+χ).w(1-n) = \chi(wn+a) \implies w - wn = \chi wn + \chi a \implies n^*(w,a) = \frac{w - \chi a}{w(1+\chi)}.

Step 4: Comparative statics.

nw=11+χ+χaw2(1+χ)>0(substitution effect dominates for a>0).\frac{\partial n^*}{\partial w} = \frac{1}{1+\chi} + \frac{\chi a}{w^2(1+\chi)} > 0 \quad \text{(substitution effect dominates for } a > 0\text{)}.
na=χw(1+χ)<0(labour supply falls with non-labour income).\frac{\partial n^*}{\partial a} = \frac{-\chi}{w(1+\chi)} < 0 \quad \text{(labour supply falls with non-labour income)}.

Step 5: Verify second-order condition.

d2dn2[ln(wn+a)+χln(1n)]=w2(wn+a)2χ(1n)2<0.\frac{d^2}{dn^2}\left[\ln(wn+a)+\chi\ln(1-n)\right] = -\frac{w^2}{(wn+a)^2} - \frac{\chi}{(1-n)^2} < 0.

The objective is strictly concave in nn, confirming nn^* is a global maximum.

The upward-sloping labour supply curve (n/w>0\partial n^*/\partial w > 0) is consistent with the competitive benchmark of Principles Ch. 13.1 [P:Ch.13.1]. The formula n=(wχa)/[w(1+χ)]n^* = (w - \chi a)/[w(1+\chi)] also shows that the Frisch elasticity of labour supply (the elasticity of nn with respect to ww holding the marginal utility of wealth constant) depends on the preference parameter χ\chi — a result used in Chapter 13 of this volume when calibrating the RBC model.


1.8 Programming Exercises

Exercise 1.1 (APL)

Implement Newton’s method for finding the root of f(x)=0f'(x) = 0 where f(x)=x4+3x32f(x) = -x^4 + 3x^3 - 2 using the APL power operator with a convergence guard.

⍝ Dyalog APL — Fixed Newton's Method
⎕IO←0 ⋄ ⎕ML←1

⍝ Parentheses are mandatory for polynomials in APL
f   ← {(-⍵*4) + (3×⍵*3) - 2}
df  ← {(-4×⍵*3) + 9×⍵*2}      ⍝ f'
ddf ← {(-12×⍵*2) + 18×⍵}      ⍝ f''

⍝ One Newton step for finding a root of df(x)
⍝ Newton's formula: x - f'(x)/f''(x)
step ← {⍵ - (df ⍵) ÷ (ddf ⍵)}

⍝ Use the Power operator with a dyadic comparison guard
⍝ ⍺ is current value, ⍵ is previous value
x_star ← step ⍣ {1e¯10 > |⍺ - ⍵} 2.0

x_star     ⍝ Should be 2.25
f x_star   ⍝ Should be 6.54296875
Loading...
Loading...

Note the idiom f ⍣ converged ⊢ start: apply f repeatedly until the predicate converged is satisfied. with a dyadic right argument iterates until convergence — this pattern appears throughout the book for fixed-point computations.

Exercise 1.2 (Python)

# Python — Newton's method for critical point of f(x) = -x**4 + 3*x**3 - 2
from scipy.optimize import minimize_scalar
import numpy as np

f   = lambda x: -x**4 + 3*x**3 - 2
df  = lambda x: -4*x**3 + 9*x**2    # first derivative
ddf = lambda x: -12*x**2 + 18*x     # second derivative

def newton_critical(x0, tol=1e-10, max_iter=100):
    x = x0
    for i in range(max_iter):
        x_new = x - df(x) / ddf(x)
        if abs(x_new - x) < tol:
            return x_new, i+1
        x = x_new
    raise RuntimeError("Did not converge")

x_star, iters = newton_critical(0.5)
print(f"x* = {x_star:.10f}, f(x*) = {f(x_star):.10f}, converged in {iters} iterations")
x* = 0.0000000001, f(x*) = -2.0000000000, converged in 32 iterations

Exercise 1.3 (Julia)

# Julia — Newton's method for critical point
f(x)   = -x^4 + 3x^3 - 2
df(x)  = -4x^3 + 9x^2
ddf(x) = -12x^2 + 18x

function newton_critical(x0; tol=1e-10, max_iter=100)
    x = x0
    for i in 1:max_iter
        x_new = x - df(x) / ddf(x)
        abs(x_new - x) < tol && return x_new, i
        x = x_new
    end
    error("Did not converge")
end

x_star, iters = newton_critical(0.5)
println("x* = $(round(x_star, digits=10)),  f(x*) = $(round(f(x_star), digits=10)),  iters = $iters")

Exercise 1.4 (R)

# R — Newton's method for critical point
f   <- function(x) -x^4 + 3*x^3 - 2
df  <- function(x) -4*x^3 + 9*x^2
ddf <- function(x) -12*x^2 + 18*x

newton_critical <- function(x0, tol = 1e-10, max_iter = 100) {
  x <- x0
  for (i in seq_len(max_iter)) {
    x_new <- x - df(x) / ddf(x)
    if (abs(x_new - x) < tol) return(list(x = x_new, iters = i))
    x <- x_new
  }
  stop("Did not converge")
}

res <- newton_critical(0.5)
cat(sprintf("x* = %.10f,  f(x*) = %.10f,  iters = %d\n", res$x, f(res$x), res$iters))

Exercise 1.5 — Household Problem (\star)

Extend Worked Example 1.1 to three periods. The household maximizes t=13βt1u(ct)\sum_{t=1}^3 \beta^{t-1} u(c_t) with u(c)=lncu(c) = \ln c subject to the lifetime budget constraint t=13ct/(1+r)t1=w\sum_{t=1}^3 c_t/(1+r)^{t-1} = w. (a) Derive the three Euler equations. (b) Solve analytically for ctc_t^* as a function of ww, rr, and β\beta. (c) In APL, solve the system using (matrix divide) for a range of parameter values and produce a table of consumption shares ct/wc_t^*/w.

Exercise 1.6 — Comparative Statics (\star)

Using the IS condition Y=C(YT)+I(r)+GY = C(Y-T) + I(r) + G with C(y)=a+byC(y) = a + by, compute Y/G\partial Y^*/\partial G, Y/T\partial Y^*/\partial T, and Y/r\partial Y^*/\partial r using the IFT. Verify these match the IS–LM multipliers derived in Chapter 6. Implement the computation in APL as a dfn that takes the parameters (a,b,I,G,T)(a, b, I', G, T) as a vector and returns the three partial derivatives.

Exercise 1.7 — Kuhn–Tucker (\star\star)

Consider a household that maximizes u(c1,c2)=c11/2+βc21/2u(c_1, c_2) = c_1^{1/2} + \beta c_2^{1/2} subject to c1+c2/(1+r)=wc_1 + c_2/(1+r) = w and c1cc_1 \geq \underline{c} (a consumption floor). (a) Write the Lagrangian with two multipliers. (b) Identify the two regimes (constraint binding vs. not binding) and solve for the optimum in each. (c) Find the threshold wealth wˉ\bar{w} below which the floor binds.


1.9 Chapter Summary

This chapter developed the optimization tools that underlie every macroeconomic model in Principles and in this volume.

Key results:

  • The first-order necessary condition f(x)=0\nabla f(\mathbf{x}^*) = \mathbf{0} must hold at any interior maximum or minimum of a differentiable function.

  • The second-order sufficient condition requires the Hessian to be negative definite (for a maximum) or positive definite (for a minimum) at the critical point.

  • The envelope theorem states that the marginal value of a parameter equals its direct effect on the objective, evaluated at the optimum; indirect effects through the optimal policy function contribute nothing.

  • The Lagrange method converts equality-constrained problems into unconstrained problems over an augmented objective; the multiplier is the shadow price of the constraint.

  • The Kuhn–Tucker conditions extend the Lagrange method to inequality constraints, with complementary slackness ensuring that a slack constraint has a zero multiplier.

  • The implicit function theorem provides the formula for comparative statics: dx/dα=(Fx)1Fαd\mathbf{x}^*/d\boldsymbol{\alpha} = -(F_{\mathbf{x}})^{-1} F_{\boldsymbol{\alpha}}.

Connections forward: Chapter 3 extends these tools to infinite-horizon continuous-time problems (the Hamiltonians of optimal control). Chapter 11 applies them to the RCK model. Chapter 15 develops the discrete-time analogue (Bellman equations and dynamic programming). Chapter 18 applies the Lagrange method to the household’s problem under rational expectations.


Next: Chapter 2 — Linear Algebra for Macroeconomic Systems