When I was a little kid, I was really scared of the dark. But then I came to understand, okay, dark just means the absence of photons in the visible wavelength — 400 to 700 nanometers. Then I thought, well, it’s really silly to be afraid of a lack of photons. Then I wasn’t afraid of the dark anymore after that, Elon Musk.
The derivative of a function at a chosen input value, when it exists, is the slope of the tangent line to the graph of the function at that point. It is the instantaneous rate of change —the exact ratio of the instantaneous change in the dependent variable ($y$) to that of the independent variable ($x$).
Definition. A function $f(x)$ is differentiable at a point $a$ of its domain if its domain contains an open interval containing $a$, and the following limit exists: $\boxed{f'(a) = L = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}}$
Formal Definition: More rigorously, for every positive real number $\epsilon > 0$, there exists a positive real number $\delta > 0$, such that for every $h$ satisfying $0 < |h| < \delta$, the difference between the secant slopes at points sufficiently near a are guaranteed to be ε-close to the derivative: $\left| L - \frac{f(a+h) - f(a)}{h} \right| < \epsilon$
A critical point is a point in the domain of the function where the function is either not differentiable or the derivative is equal to zero ($f'(x) = 0$). The value of the function at a critical point (the $y$-value) is called a critical value.
The squeeze or sandwich theorem. If a function f lies between two functions g and h, and the limits of each of them at a particular point are both equal to L, then the limit of f at that particular point is also equal to L.
The Extreme Value Theorem. If f is a continuous function on an closed interval $[a, b]$, then f has both maximum and minimum values on $[a, b]$. It states that if a function is continuous on a closed bounded interval, then it is guaranteed to hit a highest point and a lowest point somewhere within that interval (either at a peak/valley or at the endpoints a or b).
Fermat’s Theorem. If a function $f(x)$ is defined on the interval $(a, b)$, has a local extremum (a relative maximum or minimum) at $x = c$, and $f'(c)$ exists, then $x = c$ is a critical point of $f(x)$ and $f'(c) = 0$.
The Problem: A wire of length $L$ is cut into two parts. One part is bent into a circle and the other into a square. Prove that the sum of the areas is minimized when the radius of the circle is exactly half the side of the square.
Note: Using a general length $L$ makes this proof universally true, rather than restricting it to 1 meter.
The diagram is shown in Figure 1.a.
Define the variables.
Let $x$ be the length of the wire used for the circle. Therefore, $L - x$ is the remaining length used for the square.
For the circle (circumference is $2\pi r$): $2\pi r = x \implies r = \frac{x}{2\pi}$
For the square (perimeter is $4s$): $4s = L - x \implies s = \frac{L - x}{4}$
Set up the area function.
The total area $A$ is the sum of the circle’s area ($\pi r^2$) and the square’s area ($s^2$): $A(x) = \pi\left(\frac{x}{2\pi}\right)^2 + \left(\frac{L - x}{4}\right)^2$
$A(x) = \frac{x^2}{4\pi} + \frac{(L - x)^2}{16}$
Minimize the area.
Take the derivative of $A$ with respect to $x$ using the chain rule: $A'(x) = \frac{2x}{4\pi} + \frac{2(L - x)(-1)}{16} = \frac{x}{2\pi} - \frac{L - x}{8}$
To find the minimum, set $A'(x) = 0$: $\boxed{\frac{x}{2\pi} = \frac{L - x}{8}} (\star)$
Suppose L = 1, $A = \pi \frac{x^{2}}{4\pi^{2}}+\frac{(1-x)^{2}}{4^{2}} = \frac{4x^{2}}{4^{2}\pi}+\frac{\pi (1-x)^{2}}{4^{2}\pi} = \frac{4x^{2}+\pi (1-x)^{2}}{4^{2}\pi}$
$A = \frac{4x^{2}+\pi(1-x)^{2}}{4^{2}\pi} = \frac{4x^{2}+ \pi -2\pi x +\pi x^{2}}{4^{2}π} = \frac{(\pi +4)x^{2} -2\pi x + \pi}{4^{2}\pi}$
Let’s take derivate of A with respect to x, $\frac{dA}{dx}=\frac{1}{4^{2}\pi}(2(\pi+4)x -2\pi)=\frac{1}{8\pi}((\pi+4)x -\pi).$
$\frac{dA}{dx}= 0 \implies x = \frac{\pi}{\pi+4}$ is the critical point.
$(0, \frac{\pi}{\pi + 4})$, $\frac{dA}{dx}$ < 0 ⇒ A is decreasing.
$(\frac{\pi}{\pi + 4}, 1)$, $\frac{dA}{dx}$ > 0 ⇒ A is increasing.
Therefore, $x = \frac{\pi}{\pi + 4}$ is a minimum.
Now, notice that $\frac{s}{r} = \frac{\frac{1-x}{4}}{\frac{x}{2\pi}} = \frac{(1-x)2\pi}{4x} = \frac{(1-x)\pi}{2x}= \frac{(1-\frac{\pi}{\pi +4})\pi}{2\frac{\pi}{\pi +4}} = \frac{(\frac{\pi +4 -\pi}{\pi +4})\pi}{2\frac{\pi}{\pi +4}}=\frac{1}{2}$
In other words, if the radius of the circle is half the side of the square, the sum of both areas is the least.
The elegant proof.
Look closely at the equation we just established for the critical point $(\star)$: $\frac{x}{2\pi} = \frac{L - x}{8}$
We already know from Step 2 that $x = 2\pi r$ and $L - x = 4s$. Let’s substitute those original expressions back into the numerators of this equation: $\frac{2\pi r}{2\pi} = \frac{4s}{8}$
Simplify both fractions: $r = \frac{s}{2}$
Conclusion: We have proven that to minimize the combined area, the radius of the circle must be exactly half the length of the square’s side.
The Problem: Find the dimensions of a rectangle with a perimeter of 20m whose area is as large as possible.
Draw a diagram to understand the problem (Figure iv) and set up the equations.
Let $l$ be the length and $b$ be the width of the rectangle.
The perimeter equation is: $2l + 2b = 20 \implies l + b = 10 \implies b = 10 - l$
The area we want to maximize is: $A = l \cdot b$
Create a single-variable function
Substitute the expression for $w$ into the area equation: $A(l) = l(10 - l) = 10l - l^2$
Find the critical points
Take the derivative of $A$ with respect to $l$: $A'(l) = 10 - 2l$
Set the derivative to zero to find the critical point: $10 - 2l = 0 \implies 2l = 10 \implies l = 5$
Verify the maximum
Using the First Derivative Test:
Interval $(0, 5)$: Test $l = 1 \implies A'(1) = 10 - 2(1) = 8 > 0$. Area is increasing.
Interval $(5, 10)$: Test $l = 6 \implies A'(6) = 10 - 2(6) = -2 < 0$. Area is decreasing.
Since the slope changes from positive to negative at $l = 5$, this point is a maximum.
Solution. If the length $l = 5$, then the width $b = 10 - 5 = 5$. The dimensions that maximize the area are 5m by 5m (it is indeed a square), and the maximum area is $25 \text{ m}^2$.
The Problem: A piece of wire of length 1 meter is to be divided into two parts. Each part is bent into a square. Find the largest area enclosed by the two squares.
Draw a diagram to understand the problem (Figure 1.b) and set up the variables
Let $x$ be the length of the wire used for the first square.
The remaining wire used for the second square is $1 - x$.
Since a square has four equal sides, the side length of the first square is $\frac{x}{4}$ and the side length of the second square is $\frac{1 - x}{4}$.
Create the area function
The total area $A$ is the sum of the areas of the two squares: $A(x) = \left(\frac{x}{4}\right)^2 + \left(\frac{1 - x}{4}\right)^2$
$A(x) = \frac{x^2}{16} + \frac{1 - 2x + x^2}{16} = \frac{2x^2 - 2x + 1}{16}$
Find the critical point
To optimize, we take the derivative with respect to $x$ and set it to zero: $A'(x) = \frac{4x - 2}{16}$
$0 = \frac{4x - 2}{16} \implies 4x = 2 \implies x = \frac{1}{2}$
Analyze the domain (The Trick)
By the First Derivative Test:
Interval $(0, \frac{1}{2})$: $A'(x) < 0 \implies$ Area is decreasing.
Interval $(\frac{1}{2}, 1)$: $A'(x) > 0 \implies$ Area is increasing.
This means $x = \frac{1}{2}$ is an absolute minimum, yielding an area of $\frac{1}{32}$.
To find the largest area on a closed interval $[0, 1]$, the Extreme Value Theorem dictates we must also check the boundaries:
If $x = 0$, $A(0) = \frac{1}{16}$. If $x = 1$, $A(1) = \frac{1}{16}$
Solution: The problem is a bit of a trick 🪄 (it is indeed quite misleading). To get the maximum area, you shouldn’t cut the wire at all! The maximum area is $\frac{1}{16} \text{ m}^2$, which is achieved by using the entire wire to form a single square.

The Problem: A farmer with 950 meters of fencing wants to enclose a rectangular area and divide it into four pens using fencing parallel to one side. What is the largest possible total area?
Draw a diagram to visualize the problem (Figure iii) and set up the equations
Let $y$ be the total length of the large rectangular enclosure, and $x$ be the width of the individual pens.
To divide the rectangle into four equal pens parallel to the width, the farmer needs:
$\star$ 2 long horizontal fences of length $y$
$\star$ 5 shorter vertical fences of length $x$ (the two outer borders + three internal dividers)
The perimeter constraint equation is: $5x + 2y = 950$
The objective function to maximize is the total area: $A = x \cdot y$
Create a single-variable function
Solve the constraint equation for $y$: $2y = 950 - 5x \implies y = 475 - \frac{5}{2}x$
Substitute this $y$ into the area equation: $A(x) = x\left(475 - \frac{5}{2}x\right) = 475x - \frac{5}{2}x^2$
Find the critical point
Take the derivative of $A$ with respect to $x$: $A'(x) = 475 - 5x$
Set the derivative to zero: $475 - 5x = 0 \implies 5x = 475 \implies x = 95$
Verify the maximum
Using the First Derivative Test:
Interval $(0, 95)$: Test $x = 1 \implies A'(1) = 475 - 5 = 470 > 0$. Area is increasing.
Interval $(95, \infty)$: Test $x = 100 \implies A'(100) = 475 - 500 = -25 < 0$. Area is decreasing.
Since the derivative changes from positive to negative, $x = 95$ yields a maximum.
Solution. The ideal width for the pens is $x = 95$ meters. Plugging this back into our area equation:
$A(95) = 475(95) - \frac{5}{2}(95)^2 = 45,125 - 22,562.5 = 22,562.5$
The largest possible total area for the four pens is $22,562.5 \text{ m}^2$.
