
Mathematics for Master Students
Which tasks gave you trouble? Bring them up now. We take the time to go through them before we move on to today’s topic.
Question
Differentiate \(f(x) = 2x^2 - 8x + 3\). At which \(x\) is the tangent horizontal?
Optimisation means finding the input \(x\) that makes \(f(x)\) as large or as small as possible.
An extremum of a smooth function can only sit in one of three kinds of place:
For the smooth business functions in this tutorial, the first two cover almost everything, and stationary points come first.
Question
\(f(x) = |x - 3|\) has its minimum at \(x = 3\). Which kind of place is that?
| (a) A stationary point | (b) A boundary of the domain |
| (c) A kink | (d) It has no minimum |
(c): the graph is V-shaped, and at the tip no tangent exists, so \(f'(3)\) is undefined and the FOC cannot find it.
Session 4’s non-differentiable points are not exotic: tiered tariffs and absolute deviations (forecast errors!) produce kinks all the time.

At a smooth peak or valley the graph momentarily stops rising or falling, the tangent is horizontal, so its slope \(f'(x)\) is zero.
A point \(x^*\) with \(f'(x^*) = 0\) is called a stationary point (or critical point).
\[f'(x^*) = 0 \qquad \text{the first-order condition (FOC)}\]
Take \(f(x) = x^3 - 3x^2 - 9x + 5\). Where are its stationary points?
Always factor \(f'(x)\) if you can, the stationary points are just its roots, and a factored form hands them to you directly.
Question
Where are the stationary points of \(\;f(x) = x^3 - 12x\;\)? Shout all of them.
\[f'(x) = 3x^2 - 12 = 3(x^2 - 4) = 3(x - 2)(x + 2) = 0 \quad \Rightarrow \quad x = 2 \ \text{ or } \ x = -2\]
Common Mistake
Solving \(x^2 = 4\) as “\(x = 2\)” loses half the candidates. A square root has two signs; keep them both until the second-order test sorts them.
Session 4 promised: the best output is where marginal revenue meets marginal cost. Here is why.
Profit is revenue minus cost: \(\;\pi(q) = R(q) - C(q)\).
The first-order condition \(\pi'(q) = 0\) becomes:
\[\pi'(q) = R'(q) - C'(q) = 0 \quad \Longleftrightarrow \quad R'(q) = C'(q)\]
Question
Marginal revenue is \(R'(q) = 80 - 2q\), marginal cost is \(C'(q) = 20 + q\). At which output is profit maximal? Shout the number.
\[80 - 2q = 20 + q \quad \Rightarrow \quad 60 = 3q \quad \Rightarrow \quad q = 20\]
Below \(20\) the next unit earns more than it costs, above \(20\) it costs more than it earns: the gap between revenue and cost is widest at \(q = 20\).
Question
A function satisfies \(f'(2) = 0\). Does that alone tell you \(x = 2\) is a maximum or a minimum?
At a stationary point \(x^*\), curvature settles the question, Session 4’s \(f''\) returns:
Every optimisation problem in this tutorial runs through the same four steps:
Say the goal out loud first, maximise or minimise, so you know which sign of \(f''\) you are hoping for.

Question
Back to \(f(x) = x^3 - 12x\) with stationary points \(x = 2\) and \(x = -2\). Which is which?
| (a) Maximum at \(2\), minimum at \(-2\) | (b) Minimum at \(2\), maximum at \(-2\) |
| (c) Both are minima | (d) The test is inconclusive |
(b): \(f''(x) = 6x\), so \(f''(2) = 12 > 0\) (valley) and \(f''(-2) = -12 < 0\) (peak).
Values: \(f(2) = 8 - 24 = -16\) and \(f(-2) = -8 + 24 = 16\), a local minimum of \(-16\) and a local maximum of \(16\).

For \(f(x) = x^3\): \(f'(0) = 0\) and \(f''(0) = 0\). The tangent is flat, yet the graph keeps rising, a saddle point, neither peak nor valley.
Common Mistake
Declaring “\(f'(x^*) = 0\), therefore it is a maximum”. A stationary point is only a candidate. Always check the second-order condition (or watch how \(f'\) changes sign across \(x^*\)) before naming it a max or a min.
For \(f(x) = x^3 - 3x^2 - 9x + 5\), \(f'(x) = 3(x - 3)(x + 1)\). One test point per interval:
| Interval | \(x < -1\) | \(-1 < x < 3\) | \(x > 3\) |
|---|---|---|---|
| test point | \(x = -2\) | \(x = 0\) | \(x = 4\) |
| \(f'(x)\) | \(3 \cdot (-5) \cdot (-1) = 15\) | \(3 \cdot (-3) \cdot 1 = -9\) | \(3 \cdot 1 \cdot 5 = 15\) |
| sign | \(+\) | \(-\) | \(+\) |
Question
At a stationary point \(x^*\) of a cost function, you compute \(f''(x^*) = 8 > 0\). Is \(x^*\) a local maximum or a local minimum?
A local optimum is best only in its neighbourhood, a bigger peak may sit elsewhere.
To find the global max and min of \(f\) on \([a, b]\), compare a short list:
Common Mistake
Finding stationary points but forgetting the endpoints. The global optimum often sits at a boundary, skip it and you get the wrong answer.

Maximise \(g(x) = x^3 - 3x\) on \([0,3]\):
| \(x\) | \(0\) (endpoint) | \(1\) (stationary) | \(3\) (endpoint) |
|---|---|---|---|
| \(g(x)\) | \(0\) | \(-2\) | \(\mathbf{18}\) |
The only interior stationary point is a minimum; the global max \(18\) sits at the boundary \(x = 3\).
Question
Find the global maximum of \(\;f(x) = x^2 - 4x\;\) on \([0, 5]\). Shout the maximum value.
Common Mistake
Reporting \(-4\) because “that is where \(f' = 0\)”. An upward parabola has no interior maximum at all: on a closed interval its maximum always sits at an endpoint.
Real decisions come with hard limits, and those edges are candidates:
Question
You maximise profit and the FOC gives \(q = 45\). But your plant can make at most \(40\) units, so \(q \in [0, 40]\) and profit is still rising at \(q = 40\). What is the best feasible output?
We reuse Session 4’s cost function and add a revenue function:
\[C(q) = 0.5q^2 + 10q + 200 \qquad R(q) = 100q - 0.5q^2\]
Subtract cost from revenue, term by term:
\[\pi(q) = (100q - 0.5q^2) - (0.5q^2 + 10q + 200)\]
\[\pi(q) = -q^2 + 90q - 200\]

Question
The rent goes up: fixed costs rise from \(200\) to \(500\), so \(C(q) = 0.5q^2 + 10q + 500\). What happens to the optimal output \(q = 45\) and to the maximum profit?
| (a) \(q\) falls, profit falls | (b) \(q\) rises, profit falls |
| (c) \(q\) unchanged, profit falls by \(300\) | (d) \(q\) unchanged, profit unchanged |
(c): \(\pi(q) = -q^2 + 90q - 500\) has the same derivative \(\pi'(q) = -2q + 90\), so the FOC still gives \(q = 45\); the constant only shifts the curve down.
Fixed costs never change the decision, only the result. That is the practical meaning of “constants differentiate to zero”.

The optimal quantity is \(q = 45\), and the maximum profit is \[\pi(45) = -45^2 + 90 \cdot 45 - 200 = -2025 + 4050 - 200 = 1825,\] that is €1825, the highest point of the profit curve.
Question
Demand improves and revenue becomes \(R(q) = 120q - 0.5q^2\), cost stays \(C(q) = 0.5q^2 + 10q + 200\). What is the new optimal output? Shout the number.
A plant’s total cost is \(C(q) = 400 + 4q + 0.01q^2\). Which output makes the cost per unit smallest?
Notice the shape \(\frac{a}{q} + bq\): a falling term against a rising one. The next example, the most famous formula in inventory management, has exactly the same shape.
A warehouse orders a product with steady annual demand. Order too often and ordering costs pile up; order too much and holding costs pile up. Balance them.
Question
You switch to larger orders \(q\), same annual demand \(D\). What happens to the two cost terms in \(T(q) = \frac{D}{q}K + \frac{q}{2}h\)?
| (a) Ordering cost rises, holding cost falls | (b) Ordering cost falls, holding cost rises |
| (c) Both fall | (d) Both rise |
(b): fewer orders per year (\(D/q\) shrinks), but a higher average stock (\(q/2\) grows).
Exactly this tug of war makes the total cost U-shaped, and a U has a bottom to find.

With \(D = 1000\), \(K = 80\), \(h = 4\), so \(T(q) = 80000/q + 2q\):
Solve the FOC in symbols and the classic EOQ formula drops out:
\[\frac{D K}{q^2} = \frac{h}{2} \;\Rightarrow\; q^2 = \frac{2 D K}{h} \;\Rightarrow\; \boxed{\,q^* = \sqrt{\dfrac{2 D K}{h}}\,}\]
Question
Annual demand \(D = 1800\) units, \(K = 25\) per order, holding cost \(h = 4\) per unit and year. What is the economic order quantity? Shout the number.
\[q^* = \sqrt{\frac{2 \cdot 1800 \cdot 25}{4}} = \sqrt{\frac{90000}{4}} = \sqrt{22500} = 150\]
Check the balance: ordering cost \(\frac{1800}{150} \cdot 25 = 300\), holding cost \(\frac{150}{2} \cdot 4 = 300\), equal, as the theory promised.
The EOQ also fixes the rhythm of ordering:
The formula answers “how much”; dividing by demand answers “how often”. Both are needed for a replenishment plan.
Question
A supplier doubles the fixed cost \(K\) per order. According to \(q^* = \sqrt{\frac{2DK}{h}}\), does the economic order quantity rise or fall, and by how much?
That’s it for today.
Any Questions?
The recipe is always the same: differentiate, set \(f' = 0\), solve, then let \(f''\) decide. Name the goal (maximise or minimise) and the sign of \(f''\) you want follows.
See you there, and bring your questions!
Session 05 - Single Variable Optimization | Dr. Tobias Vlcek | Home