Skip to content
GATEiit

GATE EC · Engineering Mathematics

Maxima and minima

Local and global extrema of functions of one and two variables: critical points, first, second and higher derivative tests, end points, the rt − s² test with saddle points, and Lagrange multipliers.

Before you start

  • Partial derivatives →

    Two-variable extrema use fx, fy and the second partials fxx, fxy, fyy.

  • Mean value theorems →

    The sign of f′ on an interval tells whether f is rising or falling, which is the basis of the first derivative test.

  • Eigenvalues →

    For more than two variables, the signs of the Hessian's eigenvalues decide the nature of a critical point.

Concept notes

1. Local extrema of f(x): critical points and the first two tests

f has a local maximum at c if f(c)≥f(x) for all x near c, and a local minimum if f(c)≤f(x) near c. A global (absolute) extremum compares against the whole domain.

If f has a local extremum at an interior point c and f′(c) exists, then f′(c)=0. Points where f′(c)=0 or f′(c) does not exist are critical points; only they (and end points) can be extrema. The converse is false: f(x)=x3 has f′(0)=0 but no extremum at 0.

First derivative test. Look at the sign of f′ just left and right of c:

Sign change of f′ Result at c
+ to − local maximum
− to + local minimum
no change neither

This test works even where f′(c) does not exist, for example f(x)=∣x∣ at 0 (a minimum).

Second derivative test. If f′(c)=0:

  • f′′(c)<0: local maximum (curve bends down).
  • f′′(c)>0: local minimum (curve bends up).
  • f′′(c)=0: the test fails; use the higher-order test or the first derivative test.

2. Higher-order test and inflection points

If f′(c)=f′′(c)=⋯=f(n−1)(c)=0 and f(n)(c)≠0, look at the order n of the first non-zero derivative:

  • n even: an extremum. Maximum if f(n)(c)<0, minimum if f(n)(c)>0.
  • n odd: no extremum; c is a stationary point of inflection.

Examples: x4 at 0 has f(4)=24>0, a minimum. x5 at 0 has f(5)=120, odd order, so no extremum.

A point of inflection is where the curve changes from concave up to concave down or back, so f′′ changes sign there. It need not be stationary: sin⁡x has inflection points at x=kπ, where f′=±1.

Standard results worth remembering:

Function Extreme values
asin⁡θ+bcos⁡θ ±a2+b2
xe−x, x>0 maximum 1/e at x=1
x1/x, x>0 maximum e1/e at x=e
x+1/x, x>0 minimum 2 at x=1
x+y=k, x,y≥0 xy is largest at x=y=k/2

3. Global extrema on a closed interval

A continuous function on a closed, bounded interval [a,b] always attains a global maximum and a global minimum (extreme value theorem). They occur at critical points inside the interval or at the end points.

Procedure:

  1. Find all critical points in (a,b).
  2. Evaluate f at each of them and at a and b.
  3. The largest value is the global maximum; the smallest is the global minimum.

No derivative test is needed: just compare values. A local maximum need not be the global maximum, and an end point can be a global extremum even though f′≠0 there.

Example: f(x)=x3−6x2+9x+1 on [0,5]. f′(x)=3(x−1)(x−3), so the critical points are 1 and 3. Values: f(0)=1, f(1)=5, f(3)=1, f(5)=21. Global maximum 21 at the end point x=5; global minimum 1, reached at both x=0 and x=3.

On an open interval or an unbounded domain, a global extremum may not exist (f(x)=x on (0,1) has neither), so check the limits at the ends.

0123455101520local max (1, 5)local min (3, 1)global max (5, 21), an end pointglobal min 1 at x = 0 and x = 3 (two points)xf(x)
f(x) = x³ − 6x² + 9x + 1 on [0, 5]: the local maximum at x = 1 is not the global maximum, which is at the end point x = 5.

4. Functions of two variables: the rt − s² test

For f(x,y), a local extremum at an interior point needs

fx=0,fy=0

Solve these together to get the stationary points. At each one compute

r=fxx,s=fxy,t=fyy,D=rt−s2

Condition Nature
D>0, r>0 local minimum
D>0, r<0 local maximum
D<0 saddle point (neither)
D=0 test fails; examine f near the point

When D>0, r and t have the same sign, so you can check either.

A saddle point is stationary but f rises along some directions and falls along others, like x2−y2 at the origin.

More than two variables. Form the Hessian matrix H of second partials. At a stationary point: H positive definite (all eigenvalues positive, or all leading principal minors positive) gives a minimum; negative definite gives a maximum; eigenvalues of both signs give a saddle. The rt−s2 test is the 2×2 case of this.

++−−minimum: rt − s² > 0, r > 0f rises in every directionmaximum: rt − s² > 0, r < 0f falls in every directionsaddle: rt − s² < 0rises one way, falls the other
Level curves near a stationary point. Closed curves around the point: a minimum or a maximum. Hyperbolas with f above the saddle value (solid, +) on one pair of sides and below it (dashed, −) on the other: a saddle.

5. Constrained extrema: Lagrange multipliers

To find extrema of f(x,y,z) subject to g(x,y,z)=0, form

F=f+λg

and solve Fx=Fy=Fz=0 together with g=0. At the solution, ∇f is parallel to ∇g: the level surface of f just touches the constraint surface.

The method gives candidate points; decide maximum or minimum from the physical meaning or by comparing values. With a closed and bounded constraint set, the largest and smallest values among the candidates are the global ones.

When to substitute instead. If the constraint is easy to solve for one variable (for example x+y=10), substitute and reduce to fewer variables. Lagrange multipliers are cleaner when the constraint is symmetric or hard to solve.

Useful shortcut (AM-GM). For positive numbers, x+y+z3≥xyz3, with equality when x=y=z. So with a fixed sum the product is largest when all are equal, and with a fixed product the sum is smallest when all are equal.

Distance problems. To find the nearest point of a surface to a point, minimise the square of the distance; it has the same minimiser and avoids square roots.

Formulas to remember

Critical point
f′(c)=0 or f′(c) does not exist
Second derivative test
f′′(c)<0⇒max⁡,f′′(c)>0⇒min⁡
Higher-order test
f(n)(c)≠0 first: n even⇒extremum, n odd⇒inflection
Two-variable test
r=fxx, s=fxy, t=fyy, D=rt−s2
Lagrange function
F=f+λg,∇F=0, g=0
Sinusoidal sum
−a2+b2≤asin⁡θ+bcos⁡θ≤a2+b2

Common mistakes

  • Assuming f′(c)=0 means an extremum; x3 at 0 is stationary but is neither a maximum nor a minimum.
  • Forgetting the end points when asked for a global extremum on a closed interval.
  • Stopping when f′′(c)=0 and declaring a point of inflection; check higher derivatives, since x4 has a minimum at 0.
  • Using only the sign of r when rt−s2<0; a negative D always means a saddle point.
  • Missing critical points where the derivative does not exist, such as the corner of ∣x∣.
  • Minimising the distance itself in Lagrange problems and getting messy roots; minimise the squared distance instead.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Global extrema on a closed interval

numerical

Find the global maximum and minimum of f(x)=x3−6x2+9x+1 on [0,5].

  1. Step 1: Find the critical points.

    Try it on paper first.

Example 2: Stationary points of a two-variable function

numerical

Classify the stationary points of f(x,y)=x3+y3−3xy.

  1. Step 1: Solve $f_x = f_y = 0$.

    Try it on paper first.

Example 3: Nearest point on a plane

numerical

Find the point of the plane x+2y+2z=9 nearest to the origin, and its distance from the origin.

  1. Step 1: Set up the Lagrange function with the squared distance.

    Try it on paper first.

Example 4: When the second derivative test fails

conceptual

Classify the stationary points of f(x)=x4−4x3.

  1. Step 1: Find the stationary points.

    Try it on paper first.

Previous year questions

1 official GATE EC question on this topic, newest first.

Topic test

9 questions: up to 1 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE EC syllabus; being checked by a reviewer. Updated 2026-11-28. Spotted a mistake? Use Report an issue on any question, or contact us.