← Optimization theory
PART 4 · 15 Optimization theory · 06

Nonlinear Optimization

Nonlinear Optimization · Optimizing when relationships are not straight lines

Nonlinear objectiveDerivatives and stationary pointsSecond-order conditionBoundary solutionsConvex · nonconvexGradient descent · Newton's method

The peakSlope 0The more you put in, the less each bit addsWhen it's a curve,not a straight line,find the best point

How do we find maximums and minimums when the relationship between variables is not a straight line? The linear programming of Chapters 02–05 dealt with problems whose objective function and constraints are expressed as straight lines, but not every relationship in the real world is linear. Doubling the advertising budget does not double sales: advertising has a big effect at first, but past a certain level each additional ad does less.

SECTION 01

What is nonlinear optimization?

An optimization problem in which the objective function or at least one constraint is nonlinear is called nonlinear optimization. It covers many forms, including squares, products of variables, exponential functions, and logarithms.

SECTION 02

Linear versus nonlinear optimization

AspectLinear optimizationNonlinear optimization
Example objectiveZ = 3x + 5yZ = 10x − x²
Variable–result relationshipChanges at a constant rateThe rate of change can vary
Shape of the graphStraight lineCurves and many other shapes
Location of the optimumA corner of the feasible regionAn interior stationary point or anywhere on the boundary
Finding the optimumThe structure and algorithms of linear programmingVarious methods depending on curvature and structure
Typical casesProduction problems with constant profit per unitAdvertising effects, portfolio risk, nonlinear costs

The key difference is whether the objective value changes at a constant rate as you change a variable. That is why, unlike in linear problems, the optimum can lie inside the region rather than at a corner.

SECTION 03

Example: advertising spend and advertising effect

R(x) = 10x − x²
x: advertising spend · R(x): a hypothetical score for the advertising effect (not actual sales or measured results)
x = 2: R' = +6x = 5: R' = 0x = 8: R' = -602468100102025Maximum R(5) = 25Advertising effect R(x)Ad spend x · R(x) = 10x − x² (hypothetical model) · segments = tangent at each point, slope = R'(x)
Figure 1. Advertising spend and advertising effect

As Figure 1 shows, the effect grows at first as ad spend rises, but the gains get smaller and smaller, and past a certain point spending more actually reduces the effect. In problems like this, instead of comparing the slopes of straight lines, we have to analyze how the function changes to find the optimum.

SECTION 04

Finding the optimum with derivatives

The derivative tells you how much the effect changes when you increase ad spend by a little.

R′(x) = 10 − 2x
R′(x) > 0

Spending more on ads increases the effect (x = 2 in Figure 1).

R′(x) < 0

Spending more on ads decreases the effect (x = 8).

R′(x) = 0

A stationary point where the rate of change is 0 (x = 5).

Setting 10 − 2x = 0 gives the stationary point x = 5. To check whether this point is a maximum, look at the second derivative.

R″(x) = −2 < 0 → the function is concave (bulges upward), so it peaks at x = 5 · R(5) = 10(5) − 5² = 25

If the second derivative is negative, the slope keeps decreasing and the curve bulges upward, so the stationary point is a maximum; if it is positive, the curve bulges downward and the point is a minimum. In this hypothetical model, the effect peaks at 25 when ad spend is 5. In real decisions you also need to consider the allowed range of ad spend, budget constraints, and how reliable the data used to estimate the advertising effect are.

SECTION 05

Nonlinear optimization with constraints

max R(x) = 10x − x²   s.t.   0 ≤ x ≤ 4
Constrained optimum: x = 4, R = 24Unconstrained optimum x = 5 (not allowed)0246810Allowed range 0 ≤ x ≤ 4R(x)R'(x) > 0 throughout the range, so increasing up to the boundary x = 4 is best
Figure 2. The optimum under a constraint

Without the constraint, x = 5 was optimal, but if ad spend is allowed only up to 4, then R′(x) = 10 − 2x stays positive throughout that range. Since the effect keeps growing, the optimum is the boundary of the constraint, x = 4, with R(4) = 24. The unconstrained optimum and the optimum you can actually implement may differ, and in nonlinear problems the optimum can be either an interior stationary point or a boundary point, so you need to check both (Chapter 07).

SECTION 06

Main types of nonlinear optimization

① Convex optimization

Problems whose objective function and feasible region are convex. They have the important property that, in a minimization problem, any local optimum is also the global optimum.
Examples: portfolio optimization that accounts for variance, resource allocation

② Nonconvex optimization

There can be several peaks or valleys, so there is no guarantee that an optimum found from one starting point is the overall optimum.
Examples: complex process optimization, neural network training

③ Constrained nonlinear optimization

Optimizes a nonlinear objective function subject to equality or inequality constraints.
Example: process design that considers output, cost, and quality requirements together

Convex versus nonconvex is a distinction based on the problem's structure, while constrained nonlinear optimization is a distinction based on whether there are constraints, so the categories are not mutually exclusive.

1.91-1.36-0.27Global minimumGradient descent from three different starting points (solid dots) · each stops in its nearest valley (local minimum)
Figure 3. A nonconvex function and gradient descent

Figure 3 shows gradient descent run from three starting points on a nonconvex function with several valleys. Starting on the left it stops at a local minimum of 1.91, starting on the right at a local minimum of -0.27, and only the start in the middle reaches the global minimum of -1.36. This is why nonconvex problems call for trying several starting points or using global search methods as well.

SECTION 07

Which algorithm should you use?

MethodBasic ideaUse
Gradient descentUses the gradient to move a little at a time in the direction that decreases the objectiveTraining machine learning models (13 · Chapter 01)
Newton's methodSearches for the optimum using first- and second-derivative informationDifferentiable optimization problems
Sequential quadratic programming (SQP)Repeatedly approximates the nonlinear problem with a quadratic programming problemConstrained nonlinear optimization
Interior-point methodsSearch for the optimum from inside the feasible regionLarge-scale optimization problems
Evolutionary algorithmsGenerate candidate solutions and improve them by selection and variationComplex nonlinear · nonconvex problems
Optimum x = 5Newton's method: there in 1 stepGradient descent (learning rate 0.15)0246810120246Current estimate xIterations · start x = 0.5 · on a quadratic, Newton's method (using the 2nd derivative) lands exactly in one step
Figure 4. Convergence of gradient descent and Newton's method

In Figure 4, gradient descent moves a fixed proportion along the gradient and approaches x = 5 only after many iterations, whereas Newton's method also uses the curvature (second derivative) and, on a quadratic function, reaches the optimum in a single step. In exchange, Newton's method has to compute second derivatives, which becomes expensive when there are many variables. There are also methods, such as evolutionary algorithms, that use no derivative information, and no method is always best for every problem. Choose by weighing differentiability, constraints, starting values, and computational cost together.

SECTION 08

Where it is used in practice

Marketing

Budget allocation that accounts for the nonlinear relationship between ad spend and response rate

Finance

Portfolio construction that accounts for the relationship between return and risk

Production management

Optimizing costs and efficiency that change with output

Energy

Operating plans that account for power output, fuel consumption, and operating constraints

Machine learning

Searching for the parameters that minimize a loss function

Engineering

Optimizing structural designs, control systems, and process conditions

Example report

Assuming an advertising effect of R(x) = 10x − x², the effect peaked (25) at x = 5, where R′(x) = 0, and R″(x) = −2 < 0 confirmed that this is a maximum. With an ad spend cap of 4, R′(x) > 0 across the whole allowed range, so the optimum was the boundary x = 4 (R = 24).

✓ KEY TAKEAWAYS

Check both the points where the slope is 0 and the boundaries, and use curvature to tell maximums from minimums.


Next is 07 Constrained optimization. Using Lagrange multipliers and the KKT conditions, we look at how constraints affect the optimal solution.