BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

The second derivative test

To classify a critical point, first study a quadratic function w = ax² + bxy + cy²: completing the square writes it as a sum or difference of two squares, and the sign of 4ac − b² decides: positive gives a minimum (a > 0) or maximum (a < 0), negative a saddle, zero a degenerate point. For a general function, the quadratic approximation brings in the second derivatives A = f_xx, B = f_xy, C = f_yy at the point, and the test uses AC − B² the same way. Global extremes may also lie on the boundary or at infinity.

You need this first

Full reading path (9 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. Parametric equations of lines and the cycloid (18.02)
  7. Velocity, acceleration and Kepler's second law (18.02)
  8. Functions of two variables and partial derivatives (18.02)
  9. Tangent planes, critical points and least squares (18.02)
On this page · 5 sections
  1. Local and global
  2. The quadratic case
  3. The second derivative test
  4. An example with a boundary
  5. Summary

The last lecture found critical points, where fx=fy=0f_x = f_y = 0. This one decides what kind each is, a local minimum, a local maximum or a saddle, using second derivatives (transcript, p. 1).

Local and global#

On a contour plot, a maximum or minimum shows as level curves shrinking to a point (only the values tell which), and a saddle as a level curve crossing itself in a figure eight (transcript, p. 1). Two further questions (p. 1; notes, p. 2):

The quadratic case#

Start with a function that is just quadratic, w=ax2+bxy+cy2w = ax^2 + bxy + cy^2, at its critical point, the origin (p. 1; notes, p. 2). Last time x2−2xy+3y2=(x−y)2+2y2x^2 - 2xy + 3y^2 = (x - y)^2 + 2y^2, a sum of squares, showed a minimum (p. 1). In general, if a≠0a \ne 0, complete the square (pp. 1–2; notes, p. 2):

Completing the square
w=a(x+b2ay)2+(c−b24a)y2=14a(4a2(x+b2ay)2+(4ac−b2) y2)w = a\left(x + \frac{b}{2a}y\right)^2 + \left(c - \frac{b^2}{4a}\right)y^2 = \frac{1}{4a}\left(4a^2\left(x + \frac{b}{2a}y\right)^2 + (4ac - b^2)\,y^2\right)
In words

w equals a the quantity x plus b over the quantity 2 a, times y, all squared plus the quantity c minus b squared over the quantity 4 a, y squared equals 1 over the quantity 4 a, times the quantity 4 a squared the quantity x plus b over the quantity 2 a, times y, all squared plus the quantity 4 a c minus b squared, y squared

Source: 18.02 Lecture 10 transcript, pp. 1–2

Inside the brackets, the first term is never negative. Three cases (p. 2; notes, p. 2):

  • 4ac−b2<04ac - b^2 < 0: a square minus a square, so ww takes both signs: a saddle.
  • 4ac−b2>04ac - b^2 > 0: a sum of two squares, never negative, so ww has the sign of aa: a minimum if a>0a > 0, a maximum if a<0a < 0.
  • 4ac−b2=04ac - b^2 = 0: one square only, w=a(x+b2ay)2w = a(x + \frac{b}{2a}y)^2. There is a direction in which nothing happens, like the flat-bottomed valley w=x2w = x^2, with critical points all along a line: a degenerate critical point (p. 2).

The quantity 4ac−b24ac - b^2 is the discriminant of the quadratic formula with its sign changed, and there is a second way to see the cases, for y≠0y \ne 0 (p. 3; notes, p. 2):

Through the discriminant
w=y2(a(xy)2+b xy+c)w = y^2\left(a\left(\frac{x}{y}\right)^2 + b\,\frac{x}{y} + c\right)
In words

w equals y squared the quantity a ( x over y ) squared plus b x over y plus c

If b2−4ac>0b^2 - 4ac > 0, the quadratic at2+bt+cat^2 + bt + c has two roots and takes both signs, so ww does too: a saddle. If b2−4ac<0b^2 - 4ac < 0, it has no roots and keeps the sign of aa, and so does ww: a minimum or maximum (p. 3; notes, p. 2).

The second derivative test#

A function of two variables has second derivatives fxx=∂2f/∂x2f_{xx} = \partial^2 f/\partial x^2, fxyf_{xy} (first xx, then yy), fyxf_{yx} and fyyf_{yy}. The mixed ones are always equal, fxy=fyxf_{xy} = f_{yx}, a fact the lecture admits without proof (p. 3; notes, p. 2). At a critical point (x0,y0)(x_0, y_0) let (p. 3; notes, p. 2):

The three numbers
A=fxx(x0,y0),B=fxy(x0,y0),C=fyy(x0,y0)A = f_{xx}(x_0, y_0), \qquad B = f_{xy}(x_0, y_0), \qquad C = f_{yy}(x_0, y_0)
In words

capital A equals f sub x x ( x nought, y nought ), capital B equals f sub x y ( x nought, y nought ), capital C equals f sub y y ( x nought, y nought )

Source: 18.02 lecture summaries, Week 4 (Prof. Auroux), Lecture 10, pp. 2–3, Lecture 10, p. 2

Then (p. 3; notes, pp. 2–3):

  • AC−B2>0AC - B^2 > 0 and A>0A > 0 (or equally C>0C > 0): local minimum;
  • AC−B2>0AC - B^2 > 0 and A<0A < 0: local maximum;
  • AC−B2<0AC - B^2 < 0: saddle point;
  • AC−B2=0AC - B^2 = 0: no conclusion.

Check on the quadratic case. For w=ax2+bxy+cy2w = ax^2 + bxy + cy^2: wx=2ax+byw_x = 2ax + by, wxx=2aw_{xx} = 2a, wxy=bw_{xy} = b; wy=bx+2cyw_y = bx + 2cy, wyx=bw_{yx} = b (equal, as promised) and wyy=2cw_{yy} = 2c. So A=2aA = 2a, B=bB = b, C=2cC = 2c, and AC−B2=4ac−b2AC - B^2 = 4ac - b^2: the same cases (p. 3; notes, p. 3).

Why it works in general. The quadratic approximation (Taylor's formula to second order) is (pp. 3–4; notes, p. 3):

Quadratic approximation
Δf≈fx (x−x0)+fy (y−y0)+12fxx (x−x0)2+fxy (x−x0)(y−y0)+12fyy (y−y0)2\Delta f \approx f_x\,(x - x_0) + f_y\,(y - y_0) + \tfrac12 f_{xx}\,(x - x_0)^2 + f_{xy}\,(x - x_0)(y - y_0) + \tfrac12 f_{yy}\,(y - y_0)^2
In words

capital delta f is approximately f sub x the quantity x minus x nought, all plus f sub y the quantity y minus y nought, all plus one half f sub x x the quantity x minus x nought, all squared plus f sub x y the quantity x minus x nought, the quantity y minus y nought, all plus one half f sub y y the quantity y minus y nought, all squared

Source: 18.02 Lecture 10 transcript, pp. 3–4

(No 12\frac12 on the middle term: it collects the equal xyxy and yxyx terms, p. 4.) At a critical point the linear terms vanish, leaving a quadratic function with a=A/2a = A/2, b=Bb = B, c=C/2c = C/2, and the type of the critical point is the same as for that quadratic (p. 4; notes, p. 3). In the degenerate case the approximation is not good enough: the ignored cubic and higher terms, however small, can bend the flat direction up or down and turn the point into a minimum or a saddle, so higher derivatives would be needed (p. 4; notes, p. 3). (In one variable, x5x^5 at 0 has f′′=0f'' = 0 too.) If it happens, the lecture suggests inspecting the function or plotting it (p. 4).

An example with a boundary#

The lecture's example is f(x,y)=x+y+1xyf(x, y) = x + y + \frac{1}{xy} for x>0x > 0, y>0y > 0 (p. 4; notes, p. 3). Critical points: fx=1−1x2y=0f_x = 1 - \frac{1}{x^2y} = 0 and fy=1−1xy2=0f_y = 1 - \frac{1}{xy^2} = 0, so x2y=1x^2y = 1 and xy2=1xy^2 = 1. Dividing gives x=yx = y, then y3=1y^3 = 1: the only critical point is (1,1)(1, 1) (p. 4). Second derivatives (p. 4; notes, p. 3):

Second derivatives at (1, 1)
fxx=2x3y,fxy=1x2y2,fyy=2xy3;A=2, B=1, C=2,  AC−B2=3>0f_{xx} = \frac{2}{x^3y},\quad f_{xy} = \frac{1}{x^2y^2},\quad f_{yy} = \frac{2}{xy^3}; \qquad A = 2,\ B = 1,\ C = 2,\ \ AC - B^2 = 3 > 0
In words

f sub x x equals 2 over the quantity x cubed y, f sub x y equals 1 over the quantity x squared y squared, f sub y y equals 2 over the quantity x y cubed; capital A equals 2, capital B equals 1, capital C equals 2, capital A capital C minus capital B squared equals 3 greater than 0

With A>0A > 0, it is a local minimum, in fact the global one, f(1,1)=3f(1, 1) = 3. The maximum is not at a critical point: f→∞f \to \infty as xx or yy goes to infinity, and also as xx or yy goes to 0, so there is no maximum (p. 4; notes, p. 3).

Worked example

Two critical points of different types

Find and classify the critical points of f(x,y)=x3−3x+y2f(x, y) = x^3 - 3x + y^2. Does ff have a global minimum?

Critical points

fx=3x2−3=0f_x = 3x^2 - 3 = 0 gives x=±1x = \pm 1, and fy=2y=0f_y = 2y = 0 gives y=0y = 0: the critical points are (1,0)(1, 0) and (−1,0)(-1, 0).

The test

fxx=6xf_{xx} = 6x, fxy=0f_{xy} = 0, fyy=2f_{yy} = 2. At (1,0)(1, 0): A=6A = 6, B=0B = 0, C=2C = 2, AC−B2=12>0AC - B^2 = 12 > 0 with A>0A > 0: a local minimum, f(1,0)=1−3=−2f(1, 0) = 1 - 3 = -2. At (−1,0)(-1, 0): A=−6A = -6, so AC−B2=−12<0AC - B^2 = -12 < 0: a saddle, with f(−1,0)=−1+3=2f(-1, 0) = -1 + 3 = 2.

Global behaviour

Along the xx-axis, f(x,0)=x3−3x→−∞f(x, 0) = x^3 - 3x \to -\infty as x→−∞x \to -\infty, so there is no global minimum: the local minimum at (1,0)(1, 0) is only local. The lowest values are "at infinity".

Summary#

Symbols on this page

Show the 33 symbols used here
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
∂\partial partial.
Partial derivative: the rate of change with one variable, holding the others fixed. Say it: “partial”.
aa a.
The coefficient of x² in w. Say it: “a”.
cc c.
The coefficient of y² in w. Say it: “c”.
xx x.
The first variable. Say it: “x”.
yy y.
The second variable. Say it: “y”.
tt t.
Stands for the ratio x/y in the quadratic at² + bt + c. Say it: “t”.
ff f.
A function of two variables, f(x, y). Say it: “f”.
AA A.
The second derivative f_xx at the critical point. Say it: “capital A”.
BB B.
The mixed second derivative f_xy at the critical point. Say it: “capital B”.
CC C.
The second derivative f_yy at the critical point. Say it: “capital C”.
bb b.
The coefficient of xy in w. Say it: “b”.
x0x_{0} x nought.
The x coordinate of the critical point. Say it: “x nought”.
y0y_{0} y nought.
The y coordinate of the critical point. Say it: “y nought”.
ww w.
A quadratic function w = ax² + bxy + cy² (its own critical point is the origin). Say it: “w”.
f′′f'' f double prime.
The second derivative of a function of one variable. Say it: “f double prime”.
fxf_{x} f sub x.
The partial derivative ∂f/∂x. Say it: “f sub x”.
fyf_{y} f sub y.
The partial derivative ∂f/∂y. Say it: “f sub y”.
fxxf_{\text{xx}} f sub x x.
The second partial derivative of f with respect to x twice, ∂²f/∂x². Say it: “f sub x x”.
fxyf_{\text{xy}} f sub x y.
The mixed second partial derivative: first with respect to x, then y. Say it: “f sub x y”.
fyxf_{\text{yx}} f sub y x.
The mixed second partial derivative in the other order: first y, then x. Equal to f_xy. Say it: “f sub y x”.
fyyf_{\text{yy}} f sub y y.
The second partial derivative of f with respect to y twice, ∂²f/∂y². Say it: “f sub y y”.
wxw_{x} w sub x.
The partial derivative of w with respect to x. Say it: “w sub x”.
wyw_{y} w sub y.
The partial derivative of w with respect to y. Say it: “w sub y”.
wxxw_{\text{xx}} w sub x x.
The second partial derivative of w with respect to x twice. Say it: “w sub x x”.
wxyw_{\text{xy}} w sub x y.
The mixed second partial derivative of w, first x then y. Say it: “w sub x y”.
wyxw_{\text{yx}} w sub y x.
The mixed second partial derivative of w, first y then x. Say it: “w sub y x”.
wyyw_{\text{yy}} w sub y y.
The second partial derivative of w with respect to y twice. Say it: “w sub y y”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 28 words used here

New here

degenerate.
Of a critical point: a borderline case where the second-derivative test gives no answer, such as a flat valley floor.
second derivative test.
A rule that uses second derivatives at a critical point to tell whether it is a minimum, a maximum or a saddle.

Also used

critical point.
A point where a function's derivative is zero, so its graph is level there; maxima and minima are found among such points. Explained in Curve sketching with the first and second derivative.
local minimum.
A point where a function is smaller than at every nearby point, though it may be larger than somewhere farther away. Explained in Tangent planes, critical points and least squares.
local maximum.
A point where a function is larger than at every nearby point, though it may be smaller than somewhere farther away. Explained in Tangent planes, critical points and least squares.
saddle point.
A point where a surface rises in some directions and falls in others, like the middle of a horse's saddle or a mountain pass. Explained in Functions of two variables and partial derivatives.
second derivative.
The derivative of a derivative: how fast a rate of change itself is changing. Explained in Acceleration in one dimension.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
contour map.
A flat map of a function of two variables, drawing the curves along which it keeps one value, like height lines on a hiking map. Explained in Fields: scalar, vector, gravitational and electric.
level curve.
A curve along which a function of two variables keeps the same value, like a line of equal height on a map. Explained in Functions of two variables and partial derivatives.
global maximum or minimum.
The largest, or smallest, value a function takes anywhere in its domain, not only near one point.
completing the square.
Rewriting x² + bx + c as (x + b/2)² plus a number, which turns any quadratic into a shifted square. Explained in Inverse substitution and completing the square.
proof.
A chain of reasoning showing beyond doubt that a statement follows from definitions and results already known. Explained in Limits and continuity.
quadratic approximation.
Replacing a function near a point by the best-matching expression with squares and products of the small changes, using first and second derivatives. Explained in Linear and quadratic approximations.
linear.
Of a relation or equation: using only first powers of the unknowns, so doubling the cause doubles the effect and effects simply add. Explained in Solving and rearranging formulas.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
inflation.
A proposed burst of enormously fast expansion in the first tiny fraction of a second, which made the universe smooth and flat. Explained in Inflation.
false vacuum.
A state of a field stuck at a raised energy for a long time, like a ball in a high valley, before it decays. Explained in The false vacuum and the mechanism of inflation.
potential energy.
Energy stored in the arrangement of a system, such as a raised weight or a stretched spring, that a conservative force can give back. Explained in Gravitational potential energy.
field.
Something that has a value at every point of space, such as the temperature, the wind velocity or the electric field at each place. Explained in Newton's law of gravitation.
stable.
Of a state or motion: a small disturbance stays small or dies away, so the system remains close to it. Explained in Torque and balance.
tunnel.
In quantum physics: to pass through an energy barrier that classical physics says cannot be crossed, with a small probability. Explained in The cosmological constant and vacuum energy.
new inflation.
The improved inflation model of 1982 (Linde; Albrecht and Steinhardt), in which the field rolls slowly off a broad, flat plateau. Explained in The false vacuum and the mechanism of inflation.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
to first order.
Keeping terms only up to a stated power of a small quantity: to first order keeps the first power and drops squares and higher powers.
vanish.
To become zero; sometimes, of a fixed point or solution, to stop existing.
approximation.
Close to, but not exactly, the true value; an approximation is such a value or formula, chosen because it is simpler.
conclusive.
Settling a question beyond reasonable doubt.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

36 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. For w=x2+4xy+y2w = x^2 + 4xy + y^2, the origin is…
  2. At a critical point, fxx=−3f_{xx} = -3, fxy=1f_{xy} = 1, fyy=−2f_{yy} = -2. The point is…
  3. If AC−B2=0AC - B^2 = 0 at a critical point…
  4. The global maximum of a function on a region…
0 of 4 answered

Flashcards

1 / 3