Numerical Optimization: Finding Minima Iteratively

Engineering and scientific problems constantly ask for the input that makes something as small as possible: material cost, energy, travel time or model error. When you can solve f′(x)=0f'(x) = 0 by hand, calculus finishes the job. When you cannot, because ff is messy, has many variables or is only available as the output of a simulation, you use an iterative method that improves a guess step by step. Maximizing ff is the same task as minimizing −f-f, so this lesson works with minima throughout.

What the methods are looking for

A point x∗x^* is a local minimum of ff if f(x∗)≤f(x)f(x^*) \le f(x) for every xx near x∗x^*. For a smooth function of one variable, the following conditions are sufficient for a strict local minimum at an interior point:


f′(x∗)=0andf′′(x∗)>0f'(x^*) = 0 \quad \text{and} \quad f''(x^*) > 0


A differentiable interior minimum must satisfy f′(x∗)=0f'(x^*) = 0, but positive second derivative is not necessary. If f′′(x∗)=0f''(x^*) = 0, the second-derivative test is inconclusive: f(x)=x4f(x) = x^4 has a minimum at zero even though f′′(0)=0f''(0) = 0.


In several variables, a sufficient test is ∇f(x∗)=0\nabla f(\mathbf{x}^*) = \mathbf{0} and a Hessian that is positive definite.


The methods below seek local minima without generally guaranteeing a global minimum. A function with several valleys makes the starting point or bracket important.

Bracketing with golden-section search

Suppose ff is unimodal on [a,b][a, b]: it decreases to a single minimum and then increases. Golden-section search uses only function values. It places two interior points


x1=b−r(b−a),x2=a+r(b−a),r=5−12≈0.618x_1 = b - r(b-a), \qquad x_2 = a + r(b-a), \qquad r = \frac{\sqrt{5}-1}{2} \approx 0.618


and compares them. If f(x1)<f(x2)f(x_1) < f(x_2), the minimum cannot lie to the right of x2x_2, so the new bracket is [a,x2][a, x_2]; otherwise it is [x1,b][x_1, b].


A unimodal curve over the interval from a to b with interior points x1 and x2, the part from a to x2 shaded as kept and the part from x2 to b shaded as discarded.


The ratio rr is chosen so that the surviving interior point lands exactly where one of the next pair must go. The first contraction requires two function evaluations. Each subsequent contraction reuses one value and requires only one new evaluation. After nn contractions, the bracket length is


Ln=rnL0L_n = r^n L_0


Example: To shrink a bracket of length 1 below 0.01, you need 0.618n<0.010.618^n < 0.01, which gives n>ln⁡(0.01)/ln⁡(0.618)≈9.6n > \ln(0.01)/\ln(0.618) \approx 9.6, so 10 contractions.


The method is robust: it never needs derivatives and its bracket keeps shrinking. Its limitation is that the bracket must contain exactly one minimum with the stated unimodal shape; with two valleys it may miss the lowest one.

Derivative-based methods: Newton and gradient descent

When derivatives are available, you can move much faster. Newton's method for minimization fits a parabola to ff at the current guess and jumps to that parabola's vertex:


xk+1=xk−f′(xk)f′′(xk)x_{k+1} = x_k - \frac{f'(x_k)}{f''(x_k)}


For a sufficiently smooth function, starting sufficiently close to a nondegenerate minimum with f′′(x∗)>0f''(x^*) > 0 gives local quadratic convergence. In several variables each step uses the Hessian and solves a linear system.



Gradient descent uses first derivatives only. It steps downhill along the negative gradient:


xk+1=xk−α∇f(xk)\mathbf{x}_{k+1} = \mathbf{x}_k - \alpha \nabla f(\mathbf{x}_k)


The step size α\alpha, often called the learning rate, controls the behaviour.


Example: For f(x)=x2f(x) = x^2 the update is xk+1=(1−2α)xkx_{k+1} = (1 - 2\alpha)x_k. With α=0.25\alpha = 0.25 each step halves xx; with α>1\alpha > 1, nonzero iterates grow without bound.


Method

Information needed

Convergence near the minimum

Main risk

Golden-section search

Values of ff on a bracket

Linear: length times 0.618 per contraction

One variable only; needs a unimodal bracket

Newton's method

f′f' and f′′f'' (gradient and Hessian)

Locally quadratic near a sufficiently smooth, nondegenerate minimum

Can converge to a maximum or diverge from a poor start

Gradient descent

f′f' (the gradient)

Linear under strong convexity, a Lipschitz-continuous gradient and a suitable step size; general smooth objectives need not converge linearly

Diverges if α\alpha is too large; slow in long, narrow valleys



What to remember

  • At a smooth interior stationary point, f′′>0f'' > 0 is sufficient for a minimum; f′′=0f'' = 0 is inconclusive.
  • Golden-section search needs a unimodal bracket: two evaluations initialize it, then one new evaluation per contraction.
  • Newton's quadratic convergence is local and requires sufficient smoothness and a nondegenerate minimum.
  • Gradient descent depends on step size and curvature; smoothness alone does not guarantee linear convergence.

Example: Least Material for an Open-Top Box

An open-top storage box must hold 4 m34\ \text{m}^3. Its base is a square of side xx metres and its height is h=4/x2h = 4/x^2 metres, so the sheet-metal area in square metres is


A(x)=x2+4xh=x2+16x,x>0A(x) = x^2 + 4xh = x^2 + \frac{16}{x}, \qquad x > 0


You will locate the best side length numerically, as you would if AA came from a simulation, and then confirm the result with calculus. Write the Newton guesses as p0,p1,p2p_0, p_1, p_2 to keep them apart from the golden-section points x1x_1 and x2x_2.


a) AA is unimodal on [1,4][1, 4] m. Carry out one iteration of golden-section search with r=0.618034r = 0.618034 and state the new bracket.


The bracket length is b−a=4−1=3b - a = 4 - 1 = 3 m, so r(b−a)=0.618034×3=1.854102r(b - a) = 0.618034 \times 3 = 1.854102 m. The interior points are x1=4−1.854102=x_1 = 4 - 1.854102 = ________ and x2=1+1.854102=x_2 = 1 + 1.854102 = ________.


Evaluate the area at both points:


A(x1)=2.1458982+162.145898=4.604878+7.456086A(x2)=2.8541022+162.854102=8.145898+5.605966\begin{aligned} A(x_1) &= 2.145898^2 + \frac{16}{2.145898} = 4.604878 + 7.456086 \\ A(x_2) &= 2.854102^2 + \frac{16}{2.854102} = 8.145898 + 5.605966 \end{aligned}


These give A(x1)=A(x_1) = ________ and A(x2)=A(x_2) = ________.


Because A(x1)<A(x2)A(x_1) < A(x_2) and AA is unimodal, the minimum cannot lie in (x2,4](x_2, 4]. The new bracket is [1,2.854][1, 2.854] m, of length 1.8541.854 m, which is 0.618×30.618 \times 3 m. The old x1=2.146x_1 = 2.146 m lies inside the new bracket and becomes the next iteration's right interior point, so the next step needs only one new evaluation of AA.


b) Starting from p0=1.5p_0 = 1.5 m, take two iterations of Newton's method for minimization and report p2p_2 to three decimal places.


The derivatives are


A′(x)=2x−16x2,A′′(x)=2+32x3A'(x) = 2x - \frac{16}{x^2}, \qquad A''(x) = 2 + \frac{32}{x^3}


At p0=1.5p_0 = 1.5: A′(1.5)=−37/9≈A'(1.5) = -37/9 \approx ________ and A′′(1.5)=310/27≈A''(1.5) = 310/27 \approx ________. The Newton update gives


p1=1.5−−37/9310/27=288155≈1.858065p_1 = 1.5 - \frac{-37/9}{310/27} = \frac{288}{155} \approx 1.858065


so the first iterate is p1≈p_1 \approx ________. Retain the exact value p1=288/155p_1 = 288/155 throughout the next calculation.


At p1p_1, the derivative values are


A′(p1)=2(288155)−16(288/155)2≈−0.918323A′′(p1)=2+32(288/155)3≈6.988473\begin{aligned} A'(p_1) &= 2\left(\frac{288}{155}\right) - \frac{16}{(288/155)^2} \approx -0.918323 \\ A''(p_1) &= 2 + \frac{32}{(288/155)^3} \approx 6.988473 \end{aligned}


Using the unrounded values in the second Newton update gives


p2=p1−A′(p1)A′′(p1)≈1.989470p_2 = p_1 - \frac{A'(p_1)}{A''(p_1)} \approx 1.989470


After two iterations p2=1.989p_2 = 1.989 m to three decimal places. Both steps moved right because A′<0A' < 0 (the area decreases to the right) and A′′>0A'' > 0 (the parabola model opens upward, so its vertex is a minimum).


c) Find the exact minimizer with calculus, confirm that it is a minimum, and compare it with your results from parts a) and b).


Setting A′(x)=0A'(x) = 0 gives 2x=16/x22x = 16/x^2, so x3=8x^3 = 8 and x∗=2x^* = 2 m. The second derivative there is A′′(2)=2+32/8=A''(2) = 2 + 32/8 = ________, which is positive, so x∗=2x^* = 2 m is a minimum with A(2)=4+8=12 m2A(2) = 4 + 8 = 12\ \text{m}^2 and height h=4/22=1h = 4/2^2 = 1 m.


The golden-section bracket [1,2.854][1, 2.854] m contains x∗=2x^* = 2 m, as it must. Newton's p2=1.989p_2 = 1.989 m is already within 0.0110.011 m of x∗x^*. For golden-section search to guarantee the same accuracy, its bracket must shrink below 0.0220.022 m so that the midpoint is within 0.0110.011 m: 3(0.618)n<0.0223(0.618)^n < 0.022 requires n>ln⁡(0.007333)/ln⁡(0.618)≈10.2n > \ln(0.007333)/\ln(0.618) \approx 10.2, so 11 iterations. Newton's quadratic convergence is the payoff for supplying A′A' and A′′A''.

Match each numerical optimization term with the description that fits it, using the standard meanings from numerical methods courses.

Match each term
A.

Steps opposite the direction of steepest increase, scaled by a step size α\alpha

B.

Subtracts f′(x)/f′′(x)f'(x)/f''(x); converges quadratically from sufficiently close guesses if ff is three times continuously differentiable near a minimizer x∗x_* with f′′(x∗)>0f''(x_*)>0

C.

A point whose function value is no larger than at any point in some neighbourhood around it

D.

Shrinks a bracket by a factor of about 0.618 per iteration using function values only

E.

A point where the first derivative, or every partial derivative, equals zero

F.

On an interval, decreases to one lowest point and increases after it

Newton's method for minimization

Unimodal function

Gradient descent

Golden-section search

Stationary point

Local minimum

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A student wants to minimize a smooth function of one variable on an interval using golden-section search. Arrange the steps of a complete run of the method in the correct order.

Loading ordering steps…

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Golden-section search is used to minimize a unimodal function on the starting bracket [0,10][0, 10], with xx measured in metres. Each iteration multiplies the bracket length by r=0.618034r = 0.618034. What is the smallest number of iterations after which the bracket length is less than 0.010.01 m? Give your answer as a whole number of iterations.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice