The Sandwich Theorem is a theorem that is used to solve limits that would otherwise be considered undefined. It works on the principle that if a function is ‘sandwiched’ between two other functions for a period, the value it converges (i.e. the limit) will also between the limits of the two functions.
It also uses a similar principle to finding the average big-O time of an algorithm.
Definition
Let all be real-valued functions that operate over a domain of x, where :
In other words, if f(x) is strictly bound between g(x) and h(x) over a domain and both limits of g(x) and h(x) exist and are equal, then the limit of f(x) is equal to the limits of g(x) and h(x).
Examples
The trig functions sin and cos are a godsend here, as they are always bound between [-1,1] so any function multiplied by them can be used as g(x) and h(x):
Example - Trig Function
Let . Evaluate
Solution is always bounded between -1 and 1, we can use it's domain to determine an upper and lower bound function: Since |x| and -|x| are defined to be upper and lower bound functions, and their limits exist and are equal at 0, trivially, then using the Sandwich Theorem:
Since
Hence,
Example - Inverse Functions