GLOBAL KNOWLEDGE ARK

Physics · Article

Root finding and optimization

Separate solving a quantity-valued equation from minimizing an objective, retain a valid root bracket, and interpret stopping rules through original force and energy models.

Previous article: Floating-point arithmetic and numerical stability

Back to Physics

After reading, you can

  • Define a residual, a root, an objective value and a feasible minimizer with their units.
  • Check continuity, domain and endpoint signs before using bisection.
  • Carry out exact interval updates and return the midpoint of the retained bracket.
  • Distinguish a position-error bound from a residual tolerance or a small iterative step.
  • Derive and check one Newton update without assuming convergence from every starting point.
  • Compare an interior energy minimum with a constrained boundary minimum and report the limits of each conclusion.
01

Name the question and the quantities

For an original algebraic teaching model, let x be a scalar length setting restricted to 1 m ≤ x ≤ 2 m. Supply a modeled force response S(x) = κ x², with κ = 1 N/m², and a target F_target = 2 N. Define the residual F(x) = κ x² − F_target. A root r satisfies F(r) = 0 N, so the unique positive solution here is r = √2 m. This is a stipulated response, not an experimentally verified force law.

A root answers an equation: which allowed input makes a stated residual zero? A minimizer answers an ordering question: which feasible input gives the smallest objective value? The input and the output can represent different quantities. A length can be the unknown even when the equation's residual is a force or the optimization objective is an energy.

Minimizing F itself would answer a different question: its smallest value on this interval is −1 N at x = 1 m, rather than 0 N at the root. One may instead define a nonnegative objective such as F(x)², with units N², but must say so explicitly. The variable, objective and constraints together define the optimization problem.

Four questions for a numerical answer

  1. 1. Which problem was solved?

    F(x) = 0 N asks for a length root. Minimizing E(x) asks for a feasible length and an energy value. A root, a minimizer and a minimum value are distinct objects.

  2. 2. What interval is retained?

    Four updates leave [1.375 m, 1.4375 m]. Return its midpoint 1.40625 m with a 0.03125 m error bound, rather than confusing it with the last tested point 1.4375 m.

  3. 3. What does the stop rule mean?

    A retained half-width bounds the midpoint's length error. A force residual or a small update needs a separate interpretation; scaling a residual does not move its root.

  4. 4. Is the candidate feasible and minimal?

    E is minimized at 3 m on [0 m, 4 m], with value 1 J. Restricting the interval to [0 m, 2 m] moves the minimizer to 2 m, with value 3 J and a nonzero derivative.

The cards summarize exact stipulated force and energy models. They show logical checks and bounds, not measurements, uncertainty estimates or performance comparisons between solvers.
02

Establish a valid bracket

For a real continuous residual on the whole closed interval [a, b], opposite nonzero endpoint signs guarantee at least one root between them. An endpoint that is exactly zero is already a root and can be handled separately. Continuity and defined values throughout the interval are essential assumptions; endpoint signs alone do not supply them.

Our polynomial F is continuous on [1 m, 2 m], with F(1 m) = −1 N and F(2 m) = +2 N. It is strictly increasing there: for b > a ≥ 1 m, F(b) − F(a) = κ(b − a)(b + a) > 0 N. Therefore the bracket contains exactly one root. A general continuous residual need not be monotone, and the sign-change condition alone does not prove uniqueness.

Same-sign endpoints do not prove the absence of a root. The supplied residual Q(x) = (1 N/m²)(x − 1 m)² has Q(0.5 m) = Q(1.5 m) = 0.25 N but Q(1 m) = 0 N. Conversely, D(x) = (1 N m)/(x − 1.5 m) changes sign between 1 m and 2 m but is undefined at 1.5 m and never zero on its domain. Neither example satisfies the strict sign-change bracket conditions in the required way.

03

Halve the interval without losing the root

Take the midpoint q = (a + b)/2 and evaluate F(q). If it is exactly zero, return that root. Otherwise retain the half whose endpoints still have opposite signs. For our increasing model, a positive residual replaces the upper endpoint and a negative residual replaces the lower endpoint. This operation retains the known root while halving the interval width.

The table shows four updates starting from [1 m, 2 m]. Each tested midpoint belongs to the interval before its row's update. The last column is the interval after that update. Decimal entries are exact rational stipulations here; the table is an arithmetic demonstration, not a claim about every computer's floating-point evaluation.

After the fourth update, the retained bracket is [1.375 m, 1.4375 m]. Its midpoint, 1.40625 m, is the returned approximation in our stopping example. It differs from the fourth tested point, 1.4375 m. Keep the tested point, retained interval and returned approximation distinct in the run record.

Halve the interval without losing the rootTake the midpoint q = (a + b)/2 and evaluate F(q). If it is exactly zero, return that root. Otherwise retain the half whose endpoints still have opposite signs. For our increasing model, a positive residual replaces the upper endpoint and a negative residual replaces the lower endpoint. This operation retains the known root while halving the interval width. The table shows four updates starting from [1 m, 2 m]. Each tested midpoint belongs to the interval before its row's update. The last column is the interval after that update. Decimal entries are exact rational stipulations here; the table is an arithmetic demonstration, not a claim about every computer's floating-point evaluation. After the fourth update, the retained bracket is [1.375 m, 1.4375 m]. Its midpoint, 1.40625 m, is the returned approximation in our stopping example. It differs from the fourth tested point, 1.4375 m. Keep the tested point, retained interval and returned approximation distinct in the run record.
Exact updates for F(x) = (1 N/m²)x² − 2 N. The retained interval in each row follows that row's midpoint test.
UpdateTested midpoint qResidual F(q)Retained interval
11.5 m+0.25 N[1 m, 1.5 m]
21.25 m−0.4375 N[1.25 m, 1.5 m]
31.375 m−0.109375 N[1.375 m, 1.5 m]
41.4375 m+0.06640625 N[1.375 m, 1.4375 m]
04

Stop with a bound that matches the question

If a retained bracket contains r and the returned approximation x̂ is its midpoint, |x̂ − r| ≤ (b − a)/2. After n actual halvings of an initial width w₀, the retained width is w₀/2ⁿ and the midpoint bound is w₀/2ⁿ⁺¹. These are bounds, not the unknown exact error.

Choose a length tolerance ε_x = 0.04 m for this example and stop when the retained half-width is at most ε_x. Three updates leave a half-width of 0.0625 m, which fails. Four leave 0.03125 m, which passes. Return x̂ = 1.40625 m together with its bracket and |x̂ − r| ≤ 0.03125 m; do not report four updates as proof of an exact root.

A residual tolerance uses force units and answers a different question. For this model, F(x) = κ(x − r)(x + r). When x and r are both in [1 m, 2 m], κ(x + r) ≥ 2 N/m, so |x − r| ≤ |F(x)|/(2 N/m). This separately derived link can turn a force residual into a length bound. It depends on this model and domain; a residual threshold alone is not generally a coordinate-error guarantee.

05

Use a tangent step with its conditions

Newton's method replaces a differentiable residual locally by its tangent and solves that linear approximation for a zero. When F′(x_k) is nonzero and defined, the proposed update is x_(k+1) = x_k − F(x_k)/F′(x_k). The quotient has units of length: N divided by N/m.

For our force residual, F′(x) = 2κx. Starting from x₀ = 1.5 m gives F(x₀) = 0.25 N and F′(x₀) = 3 N/m. The correction is (0.25 N)/(3 N/m) = (1/12)m, and x₁ = (17/12)m. This candidate is within the declared interval and has F(x₁) = (1/144)N. The earlier model-specific bound therefore gives |x₁ − r| ≤ (1/288)m < 0.004 m.

This successful chosen step does not guarantee every Newton run. A zero derivative makes the displayed quotient undefined; a proposed point can leave the model's domain; unsuitable starts or local behavior can prevent convergence. A retained valid bracket can support a safeguard: accept a defined proposal strictly inside the bracket and evaluate its residual, otherwise test the midpoint; in either case retain opposite-sign endpoints unless an exact root is found. That describes a checkable policy, not a proof that an unspecified implementation always succeeds.

06

Interpret residuals and small steps

Residual size and changes between iterates are common stopping tests. Each needs an interpretation. A small change says that successive stored candidates are close; by itself it does not certify closeness to a root. A computation can also stop because it reached a resource limit or cannot represent a distinct new point. Report that reason separately from satisfying the requested mathematical criterion.

To see why residual scale matters, supply a new residual G(x) = 0.001 F(x), with the coefficient dimensionless. It has exactly the same roots as F. At x = 1.5 m, G(x) = 0.00025 N, which meets a stipulated 0.001 N residual threshold. Yet the root is below 1.4375 m, so this candidate's length error exceeds 0.0625 m and cannot meet ε_x = 0.04 m. Scaling the equation made its residual smaller without moving its root or the candidate.

Preserve the function version, allowed interval, units, endpoint signs, updates, returned point, residual, stopping rule and actual stop reason. If model evaluations are noisy or approximate, their computed signs may not be reliable. The exact bracket guarantee needs reliable signs and the stated continuity conditions; an additional error or uncertainty model is required before transferring it to such evaluations.

07

Minimize a separate energy objective

Now introduce a separate original objective E(x) = E₀ + c(x − d)², where x is a length, E₀ = 1 J, c = 2 J/m² and d = 3 m. Initially allow 0 m ≤ x ≤ 4 m. A feasible setting obeys that constraint, and a global minimizer has an objective value no greater than at every other feasible setting. A local minimizer makes that comparison only with nearby feasible settings.

The square is nonnegative, so E(x) ≥ 1 J, with equality only at x = 3 m. Thus x_min = 3 m is the unique global minimizer on [0 m, 4 m], and E_min = 1 J is the minimum value. The derivative E′(x) = 2c(x − d) is zero there. Energy never reaches 0 J in this model: finding the minimum has not found a root of E.

Change only the allowed interval to [0 m, 2 m]. The point 3 m is now infeasible. For every allowed x, d − x ≥ 1 m, so E(x) ≥ 3 J, with equality only at x = 2 m. The constrained minimum lies at the boundary, where E′(2 m) = −4 J/m rather than zero. The objective and feasible domain must be reviewed together; a root of the derivative outside that domain is not a feasible answer.

08

Check what an optimum claim establishes

For a differentiable function at an interior local minimum, a zero first derivative is a necessary condition, not a general proof of a minimum. If its derivative were positive or negative, moving a sufficiently small distance in one of the two allowed directions would decrease the function. Boundary points require a different check because both directions need not be feasible. For a convex objective, the graph between two inputs lies no higher than the straight segment joining their graph points; a convex feasible set contains the segment between any two of its points. Stronger differentiable optimality criteria require their stated convex structure and conditions.

In our energy case, the square and domain arguments establish the global minima directly; a short list of sampled values alone would not do so over a continuous interval. Conversely, the supplied function H(x) = 1 J − (1 J/m²)(x − 1 m)² on [0 m, 2 m] has H′(1 m) = 0 J/m, but H(1 m) = 1 J exceeds H(0 m) = H(2 m) = 0 J. Solving its derivative equation identifies a maximum, not a minimum.

A numerical optimization report should identify the objective, variables and units, feasible constraints, chosen method, initial conditions, stop reason and evidence for any local or global claim. Neither a small root residual nor an optimization termination message establishes that an algebraic model describes an actual apparatus. These exact examples teach how to inspect a declared problem; physical adequacy and uncertain evaluations need separate evidence.

Worked examples

Bisect the supplied force equation

For F(x) = (1 N/m²)x² − 2 N on [1 m, 2 m], carry out four bisection updates. Return the midpoint of the final bracket and decide whether its length-error bound meets ε_x = 0.04 m.

  1. The residual is continuous on the whole interval. Its endpoint values are −1 N and +2 N; strict increase establishes one root in this bracket.
  2. The tested midpoints 1.5 m, 1.25 m, 1.375 m and 1.4375 m have residuals +0.25 N, −0.4375 N, −0.109375 N and +0.06640625 N. Retaining opposite-sign endpoints after each test gives the intervals in the teaching table.
  3. After four updates the bracket is [1.375 m, 1.4375 m], of width 0.0625 m. Its midpoint is x̂ = (1.375 + 1.4375)m/2 = 1.40625 m.
  4. The midpoint error is bounded by 0.03125 m, which is below 0.04 m. Its residual is F(x̂) = −(23/1024)N = −0.0224609375 N, so the returned midpoint is an approximation rather than an exact zero.

Return 1.40625 m with bracket [1.375 m, 1.4375 m] and bound |x̂ − r| ≤ 0.03125 m. The declared length tolerance is met after four updates.

Check a Newton candidate independently

For the same force model, start Newton's method at x₀ = 1.5 m. Compute one proposed point, verify its domain and residual, and use the model-specific residual-to-length bound to check a 0.004 m length target.

  1. Compute F(1.5 m) = 0.25 N and F′(1.5 m) = 3 N/m. The derivative is defined and nonzero.
  2. The proposed correction is (1/12)m, so x₁ = (3/2 − 1/12)m = (17/12)m. It lies between 1 m and 2 m.
  3. Substitution gives F(x₁) = ((17/12)² − 2)N = (289/144 − 288/144)N = (1/144)N. This is a force residual, not a length error.
  4. Because x₁ and the known root both lie in [1 m, 2 m], |x₁ − r| ≤ |F(x₁)|/(2 N/m) = (1/288)m. Since 1/288 < 1/250 = 0.004, the length target is certified for this candidate.

The proposed point is (17/12)m, with residual (1/144)N and length-error bound (1/288)m < 0.004 m. This selected result uses the checked force model and domain, rather than a general convergence promise.

Recheck the energy minimum after a constraint change

Minimize E(x) = 1 J + (2 J/m²)(x − 3 m)² first on [0 m, 4 m] and then on [0 m, 2 m]. Identify both the minimizer and minimum value, and check whether E′ = 0 is required at the restricted answer.

  1. On [0 m, 4 m], the square is at least 0 m² and vanishes only at 3 m. The unique minimizer is therefore 3 m, with minimum value 1 J.
  2. After restricting the domain, 3 m is no longer feasible. For 0 m ≤ x ≤ 2 m, the distance 3 m − x is at least 1 m, so the square is at least 1 m².
  3. The lower energy bound is then 1 J + (2 J/m²)(1 m²) = 3 J, attained only at x = 2 m. For comparison, E(0 m) = 19 J and E(1 m) = 9 J.
  4. E′(2 m) = (4 J/m²)(2 m − 3 m) = −4 J/m. The negative derivative is compatible with the boundary minimum because moving farther to the right would violate the new domain.

On [0 m, 4 m], x_min = 3 m and E_min = 1 J. On [0 m, 2 m], x_min = 2 m and E_min = 3 J; the boundary minimizer does not satisfy E′ = 0.

Try it yourself

  1. For F(x) = (1 N/m²)x² − 2 N on [1 m, 2 m], identify the root and the setting that minimizes F itself. Give the units of the two settings and of the minimum residual value.

    Show the answer and reasoning

    The root is √2 m. F itself is minimized at 1 m, where its value is −1 N. Both settings are lengths, whereas the minimum residual value is a force.

    F is strictly increasing on the allowed interval. Its zero and its smallest signed value therefore occur at different settings. An objective such as F² would be a separately defined problem.

  2. For D(x) = (1 N m)/(x − 1.5 m), the values at 1 m and 2 m are −2 N and +2 N. Does that sign change certify a root between them? For Q(x) = (1 N/m²)(x − 1 m)², do equal positive endpoint values on [0.5 m, 1.5 m] certify that there is no root?

    Show the answer and reasoning

    Neither conclusion follows. D is undefined at 1.5 m and has no zero on its domain. Q has a root at 1 m despite equal positive endpoint values.

    The intermediate-value bracket argument requires a function defined and continuous on the whole interval. Its opposite-sign condition guarantees existence under that assumption; it is not a necessary condition for every root.

  3. Starting from the retained bracket [1.375 m, 1.4375 m] for F, perform one more bisection update. Return the new bracket's midpoint and decide whether its bound meets ε_x = 0.02 m.

    Show the answer and reasoning

    The tested point is 1.40625 m with negative residual. Retain [1.40625 m, 1.4375 m], return 1.421875 m, and report an error bound of 0.015625 m, which meets the target.

    F(1.40625 m) = −(23/1024)N. The new width is 0.03125 m, so its midpoint is (1.40625 + 1.4375)m/2 = 1.421875 m and its half-width is 0.015625 m. The returned point is distinct from the point just tested.

  4. Let G(x) = 0.001 F(x), with the coefficient dimensionless and the same force model and domain. At x = 1.5 m, does satisfying |G(x)| ≤ 0.001 N certify |x − r| ≤ 0.04 m? Explain using the previously retained bracket.

    Show the answer and reasoning

    No. G(1.5 m) = 0.00025 N satisfies the residual test, but r < 1.4375 m implies 1.5 m − r > 0.0625 m, exceeding 0.04 m.

    Multiplication by a nonzero constant preserves the zeros and the physical units while changing residual size. An associated coordinate bound must include the new residual scale; copying the old force threshold does not supply it.

  5. For the same F, propose one Newton update from x₀ = 2 m. Give the derivative, correction, candidate and candidate residual. Does this single calculation prove convergence from every allowed starting point?

    Show the answer and reasoning

    F′(2 m) = 4 N/m, the correction is 0.5 m, the candidate is 1.5 m and its residual is 0.25 N. This one step does not prove a general convergence claim.

    F(2 m) = 2 N, so dividing by 4 N/m gives 0.5 m and subtracting from 2 m gives 1.5 m. The selected candidate is allowed, but each broader convergence statement needs its own conditions and argument.

  6. For the separately supplied H(x) = 1 J − (1 J/m²)(x − 1 m)² on [0 m, 2 m], the derivative is zero at 1 m. Is that point a minimizer? Identify the minimum value and all minimizing settings.

    Show the answer and reasoning

    The stationary point 1 m is a maximum, with value 1 J. The minimum value is 0 J, attained at both 0 m and 2 m.

    On this interval, (x − 1 m)² lies between 0 m² and 1 m². Subtracting it with the positive coefficient reverses the ordering: energy is largest at the center and smallest at the two endpoints. A derivative root alone does not classify an extremum.

What to carry forward

  • State the equation or objective, allowed inputs and quantity units before choosing a method.
  • A continuous sign-change bracket ensures at least one root; uniqueness needs an additional argument.
  • Return and record the retained interval's midpoint with its half-width bound, keeping iteration indexing explicit.
  • Residual size, coordinate error and a small iterative step measure different things; connect them only under checked conditions.
  • A Newton step requires a defined nonzero derivative and a domain check; a successful example is not a universal convergence result.
  • Optimization conclusions depend on the feasible domain, and a stationary point or termination message alone does not prove a global minimum or physical validity.

References

Sources for the concepts and teaching approaches in this article.

  1. Bracketing MethodsNPTEL — Indian Institute of Technology Kanpur, Numerical Analysis in Computer Programming courseTeaching resourcearchive.nptel.ac.inRead source
  2. Notes on Numerical Analysis小林健太 (Kenta Kobayashi) — Hitotsubashi University, Graduate School of Business AdministrationTeaching resource · PDFkobayashi.hub.hit-u.ac.jpRead source
  3. Convex OptimizationStephen Boyd and Lieven Vandenberghe; revised slides with Parth Nobel — Stanford-hosted teaching materialTeaching resource · PDFweb.stanford.eduRead source