Opening the book…
Many times we want to find a maximum or minimum in a real life scenario. These mostly show up in the form of word problems, which will ask for the biggest, smallest, shortest, tallest, etc. value of some function. This can be very straightforward, but typically these functions depend on more than one parameter (or variable). The hard work is turning these into a function of one variable!
The most common example of an optimization problem is the fence question:
A farmer wants to build a rectangular pig pen for his pigs, but only has 200 feet of fence material available. What is the largest area he can enclose with this fence?
To solve this, we know that a rectangular pig pen's area is the product of its length and width. We write this as \(A(\ell,w)=\ell\cdot w\)
This function alone poses a lot of issues for us. Firstly, it has more than once variable (and this is single variable calculus), so we don't know how to find its extrema. Secondly, we can clearly make this as large as we desire by just making \(\ell\) and \(w\) bigger and bigger.
This brings us to the second major ingredient to an optimization problem: the constraint. These types of problems always provide some relationship that must be obeyed. In this example its the perimeter of the rectangle being limited by the 200 feet of fence.
\(2\ell + 2w=200\)
We can use this constraint to solve for one variable in terms of the other:
\(\ell=100-w\)
Then we can plug this into \(A(\ell,w)\) to get:
\( A(w)=(100-w)\cdot w=100w-w^2 \)
This is the single variable function we want to find the maximum of!
Notice that it has a natural domain of \(w\in[0,100]\) (since \(w,\ell \ge 0\) must hold).
\(A'(w)=100-2w\)
So \(A'(w)=0\) when \(w=50\)
Finally we check our endpoints and critical points to get:
\(A(0)=100\cdot0-0^2=0\)
\(A(50)=100\cdot50-50^2=2500\)
\(A(100)=100\cdot100-100^2=0\)
Thus our maximum possible area is 2500 feet\(^2\)
This is the blueprint for solving any optimization question:
Find the optimizing function and constraint, then use the constraint to solve for one variable and substitute to create a single variable function so you can differentiate and find extrema. Just dont forget to answer the question being asked and include units when necessary!
Another farming example awaits us:
This time a farmer wants to create two identical adjacent rectangular paddocks for his cattle. To save in fence material, he puts one side of the rectangle along the edge of a river as shown in the diagram below (since cows cant swim). What width of the paddock will enclose the largest possible area using exactly 60 meters of fence material?

Solution
Here we are again trying to find the maximum possible area, so our optimizing function is \(A(w,d)=w\cdot d\) where \(w\) is the width and \(d\) is the depth in the diagram above.
The constraint is that the amount of fence material must total to 60$ meters. Since we need 3 walls of length \(d\) and one of length \(w\), we need \(3d+w=60\)
Notice that it is easy to solve for either variable here in terms of the other, and it does not matter which you pick as it will ultimately lead to the same final answer. To make our lives easier we will just solve for \(w\), giving \(w=60-3d\)
Now substituting this into \(A\) we get \(A(d)=(60-3d)\cdot d=60d-3d^2\)
This function has a natural domain since \(w\ge 0\) and \(d\ge 0\) must hold, so we get \(d\in [0,20]\)
Now we can differentiate, giving \(A'(d)=60-6d\)
This always exists, so our critical points are when \(A'(d)=0\), giving only \(d=10\)
We check our critical points and endpoints to find the maximum for \(A\):
\(A(0)=60\cdot 0-3\cdot 0^2=0 \)
\(A(10)=60\cdot 10-3\cdot 10^2=200\)
\(A(20)=60\cdot 20-3\cdot 20^2=0 \)
Clearly the maximum possible area is 200 meters\(^2\), but the question asks for the width.
We can plug in \(d=10\) to the equation \(w=60-3d\) to get \(w=30\) meters.
Therefore our answer is the maximum area occurs when the width is 30 meters.
Always remember to answer the question being asked!
Lets try a non-farming example for some variety:
The army wants to make a cylindrical soup can that can hold \(250\pi\) yards\(^3\) of soup to feed a battalion. Since they are making such a large can, they want to be efficient and be sure to use the smallest possible surface area (so that they can use less metal when creating the can). What is the smallest possible surface area of such a can?
Solution
Remember a cylinder with base radius \(r\) and height \(h\) has a volume of \(V=\pi r^2 h\) and a surface area of \(S=2\pi r^2+2 \pi rh\)
We want to find the smallest surface area, so that should be our optimizing function: \(S(r,h)=2\pi r^2+2\pi rh\)
Our constraint is that we want the volume to be \(250\pi\), therefore \(250\pi=\pi r^2h\)
We can solve for \(h\) more easily than \(r\) here, giving \(h=\displaystyle{\frac{250}{r^2}}\)
We substitute this into our optimizing function to get:
\(\displaystyle{S(r)=2\pi r^2+2\pi r\cdot \frac{250}{r^2}=2\pi r^2+500\pi r^{-1}}\)
The domain here is again \(r,h\ge 0\) must hold, but this only tells us \(r\in[0,\infty)\).
Differentiating this gives \(S'(r)=4\pi r-500\pi r^{-2}=\displaystyle{\frac{4\pi r^3-500\pi}{r^2}}\)
Thus \(S'(r)=0\) when \(4\pi r^3-500\pi=0 \longrightarrow r=5$\)
and \(S'(r)=\)DNE when \(r^2=0 \longrightarrow r=0\)
Since our domain is not a closed interval, we make a sign chart:

Our local minimum must therefore occur at \(r=5\) yards. This question asked us to find the smallest possible surface area, so we plug this into \(S(r)\) to get:
\(S(5)=2\pi\cdot 5^2+500\pi \cdot 5^{-1}=50\pi+100\pi=150\pi\)
Our answer is officially that the minimum surface area is \(150\pi\) yards\(^2\).
Not all optimization problems are from the real world. Many times we can use optimization to answer questions about graphs!
Find the point on the line \(\textcolor{red}{y-2x=1}\) which is closest to \(\textcolor{brown}{(2,1)}\)
Solution
Here it helps to draw a sketch of what is going on:

Our goal is to minimize the length of the purple line connecting \(\textcolor{red}{(x,y)}\) to \(\textcolor{brown}{(2,1)}\).
We can find this length by using the distance formula: \(\textcolor{purple}{d(x,y)=\sqrt{(x-2)^2+(y-1)^2}} \)
The constraint is that the point \(\textcolor{red}{(x,y)}\) must be on the line \(y-2x=1\), which we can easily solve for \(y\) in to get: \(y=2x+1\)
Now we substitute that into our optimizing function \(d\) to get:
\(d(x)=\sqrt{(x-2)^2+((2x+1)-1)^2}=\sqrt{5x^2-4x+4}\)
The domain is clearly \((-\infty,\infty)\), but you can check by hand if needed.
Next, we find \(d'(x)=\displaystyle{\frac{1}{2}(5x^2-4x+4)^{-\frac{1}{2}}\cdot (10x-4)=\frac{5x-2}{\sqrt{5x^2-4x+4}}}\)
We have \(d'(x)=0\) when \(5x-2=0 \longrightarrow \displaystyle{x=\frac{2}{5}}\)
And \(d'(x)=\)DNE when \(\sqrt{5x^2-4x+4}=0\) (which has no real solutions, so never)
A quick check of the sign chart confirms we indeed have a minimum at \(x=\displaystyle{\frac{2}{5}}\):

We want to find the closest point, so we need to find \(y\) next:
Since \(y=2x+1\), we plug in \(\displaystyle{x=\frac{2}{5}}\) to get \(\displaystyle{ y=\frac{9}{5}}\)
So our final answer is the closest point is at \(\displaystyle{\left(\frac{2}{5},\frac{9}{5}\right)}\)
What is the largest possible area of a rectangle which can be inscribed inside of the parabola \(y=12-x^2\) with one side resting on the x-axis?
Solution
Once again we start with a sketch to help see what is going on:

We can parameterize the rectangle in terms of the corner that lands in quadrant one at \((x,y)\). Moving this point along the parabola will create infinitely many different rectangles. We want to maximize the area of the blue rectangle, which has a base of \(2x\) and a height of \(y\). This gives our optimizing function as \(A(x,y)=2xy\)
The constraint is that the point \((x,y)\) must be on the parabola \(y=12-x^2\), (which is already set up to be substituted into the optimizing function \(A\))
\(A(x)=2x(12-x^2)=24x-2x^3\)
The domain here is that \(x\) must put us into the first quadrant, so \(x\in [0,2\sqrt{3}]\)
Differentiating gives us \(A'(x)=24-6x^2\), which always exists.
So our only critical points can be when \(A'(x)=0 \longrightarrow x=\pm 2\)
Since our domain \([0,2\sqrt{3}]\) we can ignore \(x=-2\) and just plug in the remaining critical point and domain endpoints to find our maximum for \(A(x)\):
\(A(0)=24\cdot 0-2\cdot 0^3=0\)
\(A(2)=24\cdot 2-2\cdot 2^3=32\)
\(A(2\sqrt{3})=24\cdot 2\sqrt{3}-2\cdot (2\sqrt{3})^3=0\)
Therefore our maximum possible area of the rectangle is 32
(there no no units provided, so we don't need to use them in our answer)
This page titled 12.3: Optimization was last modified on Thu, 13 Mar 2025 20:04:49 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Kenn Huber.
The book could not be loaded just now.