# Finding the Minima and Maxima of a Function

Calculus—specifically, derivatives—can be used to find the values of $$x$$ at which the function $$f(x)$$ is at either a minimum value or a maximum value. For example, suppose that we let $$x$$ denote the horizontal distance away from the beginning of a hiking trail near a mountain and we let $$f(x)$$ denote the altitude of the mountainous terrain at each $$x$$ value. $$f(x)$$ reaches a minimum value when the function "flattens out"—that is, when $$f'(x)$$ becomes equal to zero. These particular values of $$x$$ are associated with the bottom and top of the mountain. The condition that $$f'(x)=0$$ only tells us that $$f(x)$$ is at either a minimum or a maximum. To determine whether or not $$f(x)$$ is at a minimum or a maximum, we must use the concept of the second derivative. This will be the topic of discussion in this lesson.

# Maximizing the Area of a Rectangle

Given that the perimeter $$2x+2y$$ of any arbitrary rectangle must be constant, we can use calculus to find that particular rectangle with the greatest area. The solution to this problem has practical applications. For example, suppose that someone had only 30 meters of fencing to enclose their backyard and they wanted to know what fencing layout would maximize the size and total area of their backyard. Using calculus, we can answer such questions.

# Optimization Problem

If $$(x,y)$$ represents any point on the circle, if $$P$$ is a point fixed at the coordinate point $$(4,0)$$, and if $$d$$ represents the distance between those two points then, by using only calculus, we can find the point $$(x,y)$$ on the circle associated with the minimum distance $$d$$.

# Derivation of Snell's Law

The law of reflection had been well known as early as the first century; but it took longer than another millennium to discover Snell's law, the law of refraction. The law of reflection was readily observable and could be easily determined by making measurements; this law states that if a light ray strikes a surface at an angle $$θ_i$$ relative to the normal and gets reflected off of the surface, it will be reflected at an angle $$θ_r$$ relative to the normal such that $$θ_i=θ_r$$. The law of refraction, however, is a little less obvious and it required calculus to prove. The mathematician Pierre de Fermat postulated the principle of least time: that light travels along the path which gets it from one place to another such that the time $$t$$ required to traverse that path is shorter than the time required to take any other path. In this lesson, we shall use this principle to derive Snell's law.