Skip to content
GATEiit

GATE DA · Calculus and Optimization

Optimization involving a single variable

Finding the maximum or minimum of a function of one variable: critical points, first and second derivative tests, closed-interval method, convexity, word problems and one-variable gradient descent.

Before you start

  • Maxima and minima →

    Local and global extrema are the objects we are searching for here.

  • Derivatives →

    Every method starts by finding f′(x) and checking where f is not differentiable.

  • Taylor series →

    The second derivative test and Newton's method both come from the second-order Taylor expansion.

Concept notes

1. The optimisation problem and critical points

We want to minimise (or maximise) a function f(x) over a set of allowed values, usually all of R, an open interval, or a closed interval [a,b]. Maximising f is the same as minimising −f.

A point c is a critical point of f if f′(c)=0 or f′(c) does not exist. Fermat's theorem: if f has a local extremum at an interior point c and is differentiable there, then f′(c)=0.

The converse is false. f(x)=x3 has f′(0)=0 but no extremum at 0. Critical points are only candidates.

Points where f′ does not exist also count. f(x)=∣x∣ has its minimum at x=0, where there is no derivative.

Global vs local: a local minimum is the lowest value in some neighbourhood; a global minimum is the lowest value over the whole allowed set. A function on an open interval or on R may have no global extremum at all (for example f(x)=x on (0,1)).

Extrema of a cubic on a closed intervallocal max (1, 5)local min (3, 1)global max at endpoint (5, 21)(0, 1)xf
f(x) = x³ − 6x² + 9x + 1 on [0, 5]: the local maximum at x = 1 is not the global maximum; the endpoint x = 5 is.

2. First and second derivative tests

At a critical point c:

First derivative test (works even when f′′ is messy):

  • f′ changes from + to − at c: local maximum.
  • f′ changes from − to + at c: local minimum.
  • No sign change: neither (a stationary point of inflection if f′(c)=0).

Second derivative test (when f′(c)=0):

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

Higher-order test: let f(n)(c) be the first non-zero derivative at c. If n is even, c is a local minimum when f(n)(c)>0 and a local maximum when f(n)(c)<0. If n is odd, c is not an extremum.

Example: x4 at 0: first non-zero derivative is the 4th (=24>0), so a minimum. x5 at 0: 5th derivative, odd, so neither.

The tests come from Taylor's theorem: near c, f(x)−f(c)≈f(n)(c)n!(x−c)n, and (x−c)n keeps one sign only when n is even.

3. Global extrema on a closed interval

Extreme value theorem: a function that is continuous on a closed, bounded interval [a,b] attains both a global maximum and a global minimum there.

Closed-interval method:

  1. Find all critical points of f inside (a,b).
  2. Evaluate f at these critical points and at both endpoints 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. Forgetting the endpoints is the most common mistake; in the figure the global maximum sits at the endpoint x=5, not at the local maximum.

On an open interval or on R: check the critical points and the behaviour at the ends (limits as x→±∞ or towards the open endpoints). If there is only one critical point and it is a local minimum, it is the global minimum for a continuous function on an interval.

Domain Global extremum guaranteed? What to check
[a,b], f continuous Yes, both critical points + endpoints
(a,b) or R Not always critical points + limits at the ends

4. Convexity and concavity

A twice-differentiable f is convex on an interval if f′′(x)≥0 there, and concave if f′′(x)≤0. Equivalently, f is convex if the chord between any two points lies on or above the graph: f(λx+(1−λ)y)≤λf(x)+(1−λ)f(y),0≤λ≤1.

Why it matters for optimisation:

  • For a convex function, every local minimum is a global minimum, and if f′(c)=0 then c is a global minimiser.
  • If f′′>0 everywhere (strictly convex), the minimiser, if it exists, is unique.
  • For a concave function the same holds for maxima.

An inflection point is where concavity changes, i.e. f′′ changes sign. f′′(c)=0 alone is not enough: x4 has f′′(0)=0 but is convex on both sides.

Useful facts: x2, ex, ∣x∣ and −ln⁡x (for x>0) are convex; a sum of convex functions is convex; a positive multiple of a convex function is convex. Squared-error loss in one parameter, ∑i(wxi−yi)2, is a convex quadratic in w, which is why its stationary point is the global minimum.

5. Word problems and one-variable gradient descent

Word problems. (1) Name the variable and its allowed range. (2) Write the objective as a function of that one variable, using the constraint to eliminate others. (3) Use the closed-interval method or a derivative test. (4) Answer exactly what is asked (the value of x, or the optimum value of f).

Example: with a fixed perimeter, a rectangle of maximum area is a square; with a fence on three sides against a wall, the side parallel to the wall is twice each other side.

Gradient descent minimises f numerically by stepping against the slope: xk+1=xk−η f′(xk), where η>0 is the learning rate (step size). At a minimiser f′=0, so the iterate stops moving.

For f(x)=a2x2 with a>0, the update is xk+1=(1−ηa) xk. It converges to 0 exactly when ∣1−ηa∣<1, i.e. 0<η<2a; at η=1a it lands on the minimum in one step; for η>2a it diverges with alternating sign.

Newton's method for optimisation uses curvature: xk+1=xk−f′(xk)f′′(xk). On a quadratic it reaches the minimiser in a single step.

Formulas to remember

Critical point
f′(c)=0 or f′(c) undefined
Second derivative test
f′(c)=0: f′′(c)>0⇒min,f′′(c)<0⇒max
Higher-order test
f(n)(c)≠0 first non-zero:n even⇒extremum, n odd⇒none
ConvexityThen any stationary point is a global minimum.
f′′(x)≥0 ∀x⇒f convex
Gradient descent step
xk+1=xk−η f′(xk)
Newton step for optimisation
xk+1=xk−f′(xk)f′′(xk)
Gradient descent on a quadraticConverges iff 0<η<2/a.
f(x)=a2x2: xk+1=(1−ηa) xk
AM–GM boundEquality at x=1.
x+1x≥2(x>0)

Common mistakes

  • Forgetting to evaluate the endpoints in the closed-interval method; the global extremum is often at an endpoint.
  • Treating every point with f'(c) = 0 as an extremum; x³ at 0 is the standard counter-example.
  • Concluding 'neither' when f''(c) = 0; the second derivative test is simply inconclusive there (x⁴ has a minimum at 0).
  • Ignoring points where the derivative does not exist, such as the corner of |x|.
  • Reporting the location x when the question asks for the optimum value f(x), or the other way round.
  • Assuming a larger learning rate always converges faster; beyond 2/a on a quadratic, gradient descent diverges.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Closed-interval method on a cubic

numerical

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

  1. Step 1: Find the critical points inside the interval.

    Try it on paper first.

Example 2: Open-top box from a square sheet

numerical

Equal squares of side x cm are cut from the corners of a 12×12 cm sheet and the sides folded up to make an open box. Find the maximum volume.

  1. Step 1: Write the volume as a function of x and give its range.

    Try it on paper first.

Example 3: When the second derivative test fails

conceptual

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

  1. Step 1: Find the critical points.

    Try it on paper first.

Example 4: Three steps of gradient descent

numerical

Minimise f(x)=(x−3)2 by gradient descent from x0=0 with learning rate η=0.25. Find x3.

  1. Step 1: Write the update rule for this f.

    Try it on paper first.

Previous year questions

No official GATE DA question is tagged with this topic yet. The topic test below uses practice questions.

Topic test

8 questions: 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 DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.