One Variable Optimisation

Increasing and decreasing functions, stationary points, elasticity in demand, and curve sketching techniques. It explains derivatives’ roles in identifying maxima, minima, points of inflection, and applications in economics.

Increasing and Decreasing Functions

The behaviour of a function across an interval is governed by the sign of its first derivative. When f(x)>0f'(x) > 0 on an interval I the function is increasing: larger inputs produce larger outputs. When f(x)<0f'(x) < 0 it is decreasing. This follows from the linear approximation:

f(b)f(a)+(ba)f(a)f(b) \approx f(a) + (b – a)f'(a)

When b > a, the term (b − a) is positive, so the sign of f'(a) determines whether f(b) exceeds f(a) or falls below it.

To locate intervals of increase and decrease, find where f'(x) = 0, which divides the real line into regions where the sign of f’ is constant, then test f’ in each region. For f(x)=x32x215xf(x) = x³ − 2x² − 15x, the first derivative factorises as:

f(x)=3x24x15=(3x+5)(x3)f'(x) = 3x^2 – 4x – 15 = (3x + 5)(x – 3)

Setting f(x)=0f'(x) = 0 gives x=5/3x = −5/3 and x = 3. For x<5/3x < −5/3 both factors are negative so f(x)>0f'(x) > 0. For 5/3<x<3−5/3 < x < 3 the first factor is positive and the second negative, so f(x)<0.Forx>3f'(x) < 0. For x > 3 both factors are positive and f'(x) > 0. The function is increasing on (,5/3)(−∞, −5/3) and (3,)(3, ∞), and decreasing on (5/3,3)(−5/3, 3).

Stationary Points

stationary point occurs where f'(a) = 0: the tangent line is horizontal and the function is momentarily neither increasing nor decreasing. Every local maximum and local minimum must be a stationary point, though not every stationary point is a local extremum. Some are points of inflection.

For f(x)=2x39x2+12x4f(x) = 2x³ − 9x² + 12x − 4 the derivative is f(x)=6x218x+12f'(x) = 6x² − 18x + 12. Setting this to zero and simplifying:

6x218x+12=0(x1)(x2)=06x^2 – 18x + 12 = 0 \implies (x-1)(x-2) = 0

The stationary points occur at x = 1 and x = 2. Substituting back: f(1)=29+124=1f(1) = 2 − 9 + 12 − 4 = 1 and f(2)=1636+244=0f(2) = 16 − 36 + 24 − 4 = 0, giving stationary points at (1, 1) and (2, 0).

Classifying Stationary Points: The First-Order Test

The nature of a stationary point is determined by how the sign of f’ changes as x passes through it. If f’ goes from positive to negative the function rises then falls, making it a local maximum. If f’ goes from negative to positive the function falls then rises, making it a local minimum. If the sign of f’ is the same on both sides, the function continues in the same direction and the point is a point of inflection.

For f(x)=2x39x2+12x4f(x) = 2x³ − 9x² + 12x − 4, with f(x)=6(x1)(x2)f'(x) = 6(x − 1)(x − 2), the sign of f’ is positive for x < 1, negative for 1 < x < 2, and positive again for x > 2. At x = 1 the sign changes from + to −, giving a local maximum at (1, 1). At x = 2 the sign changes from − to +, giving a local minimum at (2, 0).

Elasticity and Revenue

The tools of differentiation apply directly to demand analysis. The elasticity of demand measures the proportional sensitivity of quantity demanded to a change in price:

ε(p)=pqq(p)\varepsilon(p) = -\frac{p}{q} q'(p)

A monopolist’s revenue is R(p)=pqR(p) = pq and its derivative with respect to price is:

R(p)=q(1ε(p))R'(p) = q\bigl(1 – \varepsilon(p)\bigr)

When ε > 1, demand is elastic and R'(p) < 0: a price increase reduces revenue. When ε < 1, demand is inelastic and R'(p) > 0: a price increase raises revenue. Revenue is maximised where ε = 1 and R'(p) = 0.

For the demand function q(p)=202pq(p) = 20 − 2p, the derivative is q'(p) = −2, giving:

ε(p)=p202p(2)=p10p\varepsilon(p) = -\frac{p}{20 – 2p}(-2) = \frac{p}{10 – p}

Setting ε > 1 requires p/(10 − p) > 1. Since 10 − p > 0 for p < 10, this simplifies to p > 5. Demand is elastic when 5 < p ≤ 10 and inelastic when 0 ≤ p < 5. Revenue is maximised at p = 5, the boundary between the two regions. This can be confirmed directly: R(p)=p(202p)=20p2p2R(p) = p(20 − 2p) = 20p − 2p², so:

R(p)=204p=0p=5R'(p) = 20 – 4p = 0 \implies p = 5

At this price, R(5)=5×10=50R(5) = 5 × 10 = 50.

The Second-Order Derivative Test

At a stationary point where f'(a) = 0, the quadratic approximation reduces to:

f(x)f(a)(xa)22f(a)f(x) – f(a) \approx \frac{(x-a)^2}{2} f”(a)

Since (x − a)² > 0 for x ≠ a, the sign of f”(a) alone determines the shape of the function near the stationary point. If f”(a) > 0 the function curves upward and the point is a local minimum. If f”(a) < 0 it curves downward and the point is a local maximum. If f”(a) = 0 the test is inconclusive and the first-order test must be used instead.

For f(x) = x³ − 2x² − 15x, the stationary points are at x = −5/3 and x = 3, and the second derivative is f”(x) = 6x − 4. Evaluating at each stationary point:

f!(53)=6!(53)4=14<0local maximumf”!\left(-\tfrac{5}{3}\right) = 6!\left(-\tfrac{5}{3}\right) – 4 = -14 < 0 \implies \text{local maximum}
f(3)=6(3)4=14>0local minimumf”(3) = 6(3) – 4 = 14 > 0 \implies \text{local minimum}

The function values give a local maximum at (−5/3, 400/27) and a local minimum at (3, −36).

Convexity and Concavity

While the first derivative describes the direction of the function, the second derivative describes its curvature across an interval. A function is convex on an interval when f”(x) > 0 there: it curves upward and lies above its tangent lines. It is concave when f”(x) < 0: it curves downward and lies below its tangent lines. Local minima are found in convex regions; local maxima are found in concave regions.

For f(x)=x32x215xf(x) = x³ − 2x² − 15x, the second derivative is f(x)=6x4f”(x) = 6x − 4, which equals zero at x = 2/3. For x < 2/3, f”(x) < 0 and the function is concave. For x > 2/3, f”(x) > 0 and the function is convex.

Points of Inflection

point of inflection is where a function switches between convex and concave. Two conditions must both hold: f”(a) = 0 and f” changes sign at x = a. The first condition alone is not sufficient. For f(x) = x⁴ − 1, f”(0) = 0 but f”(x) = 12x² ≥ 0 everywhere, so there is no sign change and x = 0 is a local minimum, not an inflection point.

For f(x) = 2x⁴ − 4x³ + 2x², differentiating twice gives:

f(x)=24x224x+4f”(x) = 24x^2 – 24x + 4

Setting f”(x) = 0 and dividing through by 4 leads to 6x² − 6x + 1 = 0, which gives:

x=12±112x = \frac{1}{2} \pm \frac{1}{\sqrt{12}}

Label these a ≈ 0.211 and b ≈ 0.789. Writing f”(x) = 24(x − a)(x − b), the second derivative is positive for x < a, negative for a < x < b, and positive for x > b. The sign changes at both a and b, confirming points of inflection at:

x=12±112x = \frac{1}{2} \pm \frac{1}{\sqrt{12}}

Curve Sketching

A rigorous sketch identifies all key features analytically rather than plotting individual points. The standard procedure is to find the x-intercepts by solving f(x) = 0; find the y-intercept by evaluating f(0); locate and classify all stationary points; determine convexity and concavity from the sign of f”; locate any inflection points; and examine limiting behaviour as x → ±∞.

For polynomials, limiting behaviour is determined by the leading term ax^n. If a > 0 and n is even, f(x) → +∞ in both directions. If a > 0 and n is odd, f(x) → +∞ as x → +∞ and −∞ as x → −∞. Signs reverse when a < 0. For products of a polynomial and an exponential, the exponential always dominates: x³e^{−x} → 0 as x → +∞ even though x³ → ∞.

The function f(x) = x³e^{−x} illustrates the full procedure. Since e^{−x} is never zero, the only x-intercept is at x = 0, which is also the y-intercept. Differentiating by the product rule:

f(x)=x2(3x)exf'(x) = x^2(3 – x)e^{-x}

Setting f'(x) = 0 gives x = 0 and x = 3. At x = 0 the second-order test fails because f”(0) = 0. Applying the first-order test, f'(x) > 0 on both sides of x = 0 (since x² ≥ 0 and (3 − x) > 0 near zero), so there is no sign change and x = 0 is a point of inflection. At x = 3, differentiating f'(x) gives:

f(x)=(6x6x2+x3)exf”(x) = (6x – 6x^2 + x^3)e^{-x}

Evaluating at x=3:f(3)=(1854+27)e3=9e3<0x = 3: f”(3) = (18 − 54 + 27)e^{−3} = −9e^{−3} < 0, confirming a local maximum at (3, 27e^{−3}). As x → +∞ the exponential dominates and f(x) → 0. As x → −∞, x³ → −∞ and e^{−x} → +∞, so f(x) → −∞. The curve starts at −∞ for large negative x, passes through the origin as an inflection point, rises to the local maximum at (3, 27e^{−3}), then decays back toward zero.

Asymptotes and Cusps

When a function or its derivatives are undefined at some point x = a, the curve requires additional analysis. A vertical asymptote occurs when f(x) → ±∞ as x → a. A horizontal asymptote occurs when f(x) → L as x → ±∞. A cusp occurs when the function is defined at x = a but the derivative is not.

For f(x) = 1/(x − 1)², the function is undefined at x = 1. The derivatives are:

f(x)=2(x1)3f(x)=6(x1)4f'(x) = -\frac{2}{(x-1)^3} \qquad f”(x) = \frac{6}{(x-1)^4}

Since (x − 1)⁴ > 0 wherever the function is defined, f”(x) > 0 everywhere: both branches are convex. For x < 1, the denominator of f'(x) is negative, making f'(x) > 0, so the function increases toward the asymptote from the left. For x > 1, f'(x) < 0 and the function decreases away from the asymptote to the right. The y-intercept is f(0) = 1 and there are no x-intercepts. As x → 1 from either side f(x) → +∞, giving a vertical asymptote at x = 1, and as x → ±∞, f(x) → 0, giving a horizontal asymptote at y = 0.

Global Maxima and Minima

global maximum is the largest value a function attains over its entire domain. Identifying it requires comparing the values at all local maxima with the function’s limiting behaviour as x → ±∞. If the function tends to +∞ in either direction, no global maximum exists. If the function tends to −∞ in either direction, no global minimum exists.

For f(x)=x3exf(x) = x³e^{−x}, the only local maximum is at x = 3 with value 27e327e^{−3}. As x → +∞, f(x) → 0, which is always below 27e327e^{−3}. As x,f(x)x → −∞, f(x) → −∞. The global maximum is therefore 27e327e^{−3} at x = 3, and a global minimum does not exist because the function is unbounded below.

Constrained Optimisation on a Closed Interval

When x is restricted to a closed interval [a, b], extrema can occur at interior stationary points or at the endpoints. The procedure is to find all stationary points inside the interval, evaluate f at each of these and at both endpoints, and select the largest value as the maximum and the smallest as the minimum.

For f(x)=x32x215xf(x) = x³ − 2x² − 15x on [−3, 5], the stationary points at x = −5/3 and x = 3 both lie within the interval. Evaluating f at all four candidates: f(3)=2718+45=0f(−3) = −27 − 18 + 45 = 0, f(5/3)=400/2714.8f(−5/3) = 400/27 ≈ 14.8, f(3)=271845=36f(3) = 27 − 18 − 45 = −36, and f(5)=1255075=0f(5) = 125 − 50 − 75 = 0. The maximum value is 400/27 at x = −5/3 and the minimum value is −36 at x = 3.

Economic Applications

Profit Maximisation

A monopolist’s profit is π(q) = R(q) − C(q), where R(q)=q·pD(q)R(q) = q · p^D(q). Profit maximisation is treated as a constrained optimisation over the feasible output range. For C(q)=q310q2+25q+10C(q) = q³ − 10q² + 25q + 10 and pD(q)=10qp^D(q) = 10 − q on [0, 10], the profit function is:

π(q)=q(10q)(q310q2+25q+10)=q3+9q215q10\pi(q) = q(10 – q) – (q^3 – 10q^2 + 25q + 10) = -q^3 + 9q^2 – 15q – 10

Differentiating and setting to zero:

π(q)=3q2+18q15=0(q1)(q5)=0 \pi'(q) = -3q^2 + 18q – 15 = 0 \implies (q-1)(q-5) = 0

The second derivative is π”(q) = −6q + 18. At q = 1: π”(1) = 12 > 0, a local minimum. At q = 5: π”(5) = −12 < 0, a local maximum. Evaluating π at all candidates: π(0) = −10, π(1) = −17, π(5) = 15, π(10) = −260. The maximum profit is 15, achieved at q = 5.

Maximising Tax Revenue

When a government imposes an excise tax T per unit, equilibrium quantity adjusts to q*(T) and tax revenue is R(T)=q(T)·TR(T) = q*(T) · T. For q(T)=2T/2q*(T) = 2 − T/2 on [0, 4], the revenue function is:

R(T)=(2T2)T=2TT22 R(T) = \left(2 – \frac{T}{2}\right)T = 2T – \frac{T^2}{2}

Differentiating: R(T)=2T=0R'(T) = 2 − T = 0 gives T = 2. Since R(T)=1<0R”(T) = −1 < 0 this is a local maximum. Evaluating at the endpoints confirms R(0) = 0 and R(4) = 0, so the revenue-maximising tax is T* = 2.

This illustrates a general pattern for linear demand: the optimal excise tax is always exactly halfway between zero and the prohibitive tax T_m. Here T* = 2 = T_m/2 = 4/2.

The Classification Workflow

The full analysis of any function f(x) follows a fixed sequence. Begin by solving f(x) = 0 for x-intercepts and evaluating f(0) for the y-intercept. Then solve f'(x) = 0 to find stationary point candidates, apply the second-order test at each — falling back to the first-order sign analysis when f”(a) = 0 — and record the classification and function value at each stationary point. Next solve f”(x) = 0 and check for a sign change to locate any inflection points. Finally examine the behaviour as x±x → ±∞ to identify asymptotes or unbounded growth, and for a constrained problem on [a, b], evaluate f at every stationary point inside the interval and at both endpoints, selecting the largest and smallest values.

See you soon.

View Comments (1)

Leave a Reply

Subscribe to My Newsletter

Subscribe to my email newsletter to get the latest posts delivered right to your email. Pure inspiration, zero spam.

Discover more from Discuss Data Science, Machine Learning and Analytics

Subscribe now to keep reading and get access to the full archive.

Continue reading