*Looking at a fundamental use of calculus, and the incredible insight it can provide.*

Calculus is arguably the most influential mathematical discovery in history, finding uses in physics, economics, engineering, biology, and so much more. Calculus has two branches: Differential calculus; Integral calculus. The former grapples with the rate of change at an instant; the latter with the area between a function and the x-axis.

In this article, we will be looking at the differential flavour and, more importantly, at one of its many applications: optimization. Optimization involves finding either the *minimum* or *maximum* of a function. You can use this technique whenever you need to maximize or minimize a certain quantity: find the *max *volume of a box; calculate the *minimum *cost of a sphere; estimate the *least *amount of travel time.

The power of differential calculus lies in the fact that we can find the rate of change at an instant (visually, this is the tangent line to a point on the function). This, in turn, allows us to uncover characteristics of functions—the extrema, inflection points, concavity, and behaviour — at a single point.

The key concept in analyzing a function during an optimization problem is finding the **extrema** (minima and maxima). There are both **global **and **local **extrema.

*δ ∈ X* is a global maximum of function f: *X* → ℝ *⇔ (∀ x ∈ X), *f*(δ) ≥ *f*(x).*

*δ ∈ X *is a global minimum of function f: *X* → ℝ *⇔ (∀ x ∈ X), *f*(δ) ≤ *f*(x).*

*δ ∈ X *is a local minimum of function f: *X* → ℝ *⇔ (∀ x ∈ [δ-*ε*, δ+*ε*]), *f*(δ) ≤ *f*(x).*

*δ ∈ X *is a local minimum of function f: *X* → ℝ *⇔ (∀ x ∈ [δ-*ε*, δ+*ε*]), *f*(δ) ≥ *f*(x).*

Visually, whenever we have a **valley** or a **hill**, it is a local minimum or a maximum; if this is the lowest valley or the highest hill in the entire domain of our function, it is a global minimum or maximum. The **extreme value theorem** states that on a closed interval, there will always be a minima and maxima. The highest and lowest values could potentially be at an endpoint as well.

When analyzing a function numerically, there is a two-step process in determining an extremum point. First, you take the first derivative of the function and set it to 0. You then solve this equation, which will give you all the values which could potentially be extrema. You then calculate the second derivative of the function. This is simply the derivative of the first derivative which you found earlier. You plug in each of the values you previously found and perform the **candidates’ test**.

The candidates’ test allows you to determine if a point on a function is a minimum, maximum, or inflection point (a point where the graph changes concavity).

Let *x* *∈ X* for a function *f: X→ ℝ*

If *f’(x) = 0 and f’’(x) > 0, x is a minimum point*

If *f’(x) = 0 and f’’(x) < 0, x is a maximum point*

If *f’(x) = 0 and f’’(x) =0, x is an inflection point*

By using the first derivative test and the candidates’ test, we can precisely determine where the minima and maxima of a function are, as well as the behaviour of the graph at those points. This is incredibly useful, and are the techniques which allow us to easily evaluate and solve optimization problems.

An optimization problem is where you are tasked with discovering the optimal value (i.e. minimum or maximum) for a function. You want to **optimize** the function for a given scenario: what’s the *greatest* profit margin; what’s the *least* amount of people we need to hire; what’s the *maximum* number of plants we can grow? By determining a function to represent a specific scenario or condition, you can optimize it. Now you can use calculus as previously demonstrated to find the optimal value.

Here’s an example, which shows the applications of optimization in economics.

The demand for a certain commodity can be modelled as *Q(x) = 10 *–* 0.001x. Q* is the price in dollars and *x* is the number of units sold*.*

The total cost of producing *x* items can be represented as the function* C(x) = 50 + 5x.*

What is the level of production that maximizes the profit?

Let *P(x)* represent the profit function of the commodity.

*P(x) = xQ(x) – C(x)*. Now, plugging in the values for these functions we get *P(x) = x(10−0.001x)−(50+5x) = 5x − 0.001x² − 50.*

We now take the derivative of *P(x)*: *P’(x) = 5 − 0.002x. *Setting this equal to 0, we can see that *x = 5/0.002 = 2500*. So, x = 2500 is a point of interest. Using the candidates’ test, we can evaluate if this is a minimum or a maximum (or neither, as you will see in some cases).

*P’’(x) = −0.002. P’’(x) < 0 *∴ x is at a maximum. We can conclude that the amount of units produced in order to maximize the profit is 2500. This is a small sampling of the power of calculus and the use of optimization problems in the real world.

There is a myriad of issues that require the use of optimization and calculus provides a method of analyzing these problems and finding a solution. The ability to precisely describe the behaviour of functions provides surprising insights and capabilities. Calculus has changed how we view our world and provides the basis for understanding some of the most complicated phenomena. But sometimes, all we really need is to use it for a bit of optimism.

Great explanation! How do you come up with the initial demand curve? By pricing a product at different prices to see (all other things being reasonably equal), the quantities that will be sold at each price point? Thanks!

For a linear demand curve, as I used in the example, what you can do is simply take two ordered pairs:

(x1, y1);(x2, y2). What this means is that at the price of x, the demand is y. Using this, you can solve the equationp = a – b * q, wherepis the price,qis the quantity demanded,ais the price when the demand is 0, andbis the slope.bcan be calculated from the ordered pairs, and you can solve forausing one of the pairs.I simply chose an arbitrary linear function that could be used to showcase the use-case of optimization in a real-world scenario!