Skip to main content

Section 2.20 Squeeze theorem and the calculus of trigonometric functions

Subsection Squeeze theorem

In order to derive continuity and derivative results for the trigonometric functions, we will need to make use of a somewhat technical limit rule called the squeeze theorem. We will often reach for this tool in situations where our basic limit rules might not suffice to compute a given limit is when the function \(f\) in question is unreasonably complicated, making its behavior near a point difficult to pin down. The squeeze theorem potentially gives a technique for getting around this issue. You can think of it as a means of replacing the complicated function \(f\text{,}\) whose behavior is a mystery to us, with two simpler “bounding” functions \(g\) and \(h\text{,}\) whose behavior we understand. It is called the squeeze theorem as the necessary inequality \(g(x)\leq f(x)\leq h(x)\) has \(f\) “squeezed” between the functions \(g\) and \(h\text{.}\)

Proof.

This theorem, like the other limit rules we have discussed, can be proved in a straightforward manner using Definition 1.14.1, the epsilon-delta definition of the limit.
Making use of the sandwich theorem requires carrying out a number of steps (with justification). The following procedure will be useful for doing this in an organized manner.

Remark 2.20.3. Sandwich theorem.

As the examples below will illustrate, the art of using Procedure 2.20.2 lies in being able to find useful bounding functions \(g\) and \(h\text{.}\) Use these examples as a model for your own use of Procedure 2.20.2. Note in particular how
  • the explanations make explicit the two conditions that the bounding functions must satisfy;
  • the explanations end with a concluding statement explicitly citing the sandwich theorem;
  • giving the bounding functions names (e.g., \(g\) and \(h\)), as opposed to just providing formulas (e.g., \(1-x^2/4\text{,}\) \(1+x^2/4\)), makes these explanations more concise.

Example 2.20.4. Sandwich theorem: easy.

Suppose the function \(f(x)\) satisfies
\begin{equation*} 1-\frac{x^2}{4}\leq f(x)\leq 1+\frac{x^2}{4} \end{equation*}
for all \(x\ne 0\) in the interval \((-1/3, 1/3)\text{.}\) Compute \(\lim_{x\to 0}f(x)\text{.}\)
Solution.
We follow the steps of Procedure 2.20.2. In this case our bounding functions \(g(x)=1-x^2/4\) and \(h(x)=1+x^2/4\) are provided for us, making life much easier. By assumption our mystery function \(f\) satisfies
\begin{equation} g(x)\leq f(x)\leq h(x)\tag{2.96} \end{equation}
for all \(x\ne 0\in (-1/3, 1/3)\text{.}\) Next we compute
\begin{align*} \lim_{x\to 0}g(x) \amp = 1-0^2/4 \amp \text{(poly. eval.)}\\ \amp =1\\ \lim_{x\to 0}h(x) \amp = 1+0^2/4 \amp \text{(poly. eval.)}\\ \amp =1\text{.} \end{align*}
Since (2.96) holds for all \(x\ne 0\in (-1/3,1/3)\text{,}\) and since
\begin{equation*} \lim_{x\to 0}g(x)=\lim_{x\to 0}h(x)=1\text{,} \end{equation*}
we conclude that \(\lim\limits_{x\to 0}f(x)=1\text{.}\)

Example 2.20.5. Sandwich theorem: less easy.

Use the sandwich theorem to compute \(\lim\limits_{x\to 0}x^2\cos(1/x)\text{.}\)
Solution.
Here we make use of a well-known and important inequality for the cosine function: namely, that
\begin{equation*} -1\leq \cos t\leq 1 \end{equation*}
for all \(t\in \R\text{.}\) It follows that
\begin{equation} -1\leq \cos(1/x)\leq 1\tag{2.97} \end{equation}
for all \(x\ne 0\text{.}\) Since \(x^2\geq 0\) for all \(x\text{,}\) the inequalities in (2.97) still hold after multiplying each expression by \(x^2\text{:}\) that is
\begin{equation*} -x^2\leq x^2\cos(1/x)\leq x^2 \end{equation*}
for all \(x\ne 0\text{.}\) Thus, letting \(g(x)=-x^2\) and \(h(x)=x^2\text{,}\) we have
\begin{equation} g(x)\leq f(x)\leq h(x)\tag{2.98} \end{equation}
for all \(x\ne 0\) in the open inteval \(\R=(-\infty,\infty)\text{.}\) Lastly, we compute
\begin{align*} \lim_{x\to 0}g(x) \amp = -0^2 \amp \text{(poly. eval.)}\\ \amp = 0\\ \lim_{x\to 0}h(x) \amp = 0^2 \amp \text{(poly. eval.)}\\ \amp = 0\text{.} \end{align*}
Since (2.98) holds for all \(x\ne 0\) in \(\R\text{,}\) and since
\begin{equation*} \lim_{x\to 0}g(x)=\lim_{x\to 0}h(x)=0\text{,} \end{equation*}
we conclude using the sandwich theorem that \(\lim\limits_{x\to 0}f(x)=0\text{.}\)
The next result is a useful consequence of the squeeze theorem that can be used in the special case where we want to show \(\lim\limits_{x\to a}f(x)=0\) for some function \(f\text{.}\)

Proof.

First note the an “if and only if” statement like the given one is in fact a statement that two separate implications are true: namely,
  • if \(\lim\limits_{x\to a}f(x)=0\text{,}\) then \(\lim\limits_{x\to a}\abs{f(x)}=0\text{;}\)
  • if \(\lim\limits_{x\to a}\abs{f(x)}=0\text{,}\) then \(\lim\limits_{x\to a}f(x)=0\text{.}\)
Thus to prove the given theorem, we must prove each of these implications.
The first implication follows almost immediately from the epsilon-delta definition of the limit. If \(\lim\limits_{x\to a}f(x)=0\text{,}\) then for all \(\epsilon > 0\text{,}\) there is a \(\delta> 0\) such that
\begin{align*} \abs{f(x)-0} \amp =\abs{f(x)}< \epsilon \end{align*}
for all \(x\) satisfying \(0< \abs{x-a}< \delta\text{.}\) But since
\begin{align*} \abs{\abs{f}-0} \amp =\abs{f(x)}\text{,} \end{align*}
we see that the same is true for the function \(\abs{f}\text{,}\) showing that \(\lim\limits_{x\to a}\abs{f(x)}=0\text{.}\)
Now consider the second implication. We will assume \(\lim\limits_{x\to a}\abs{f(x)}=0\) and prove that \(\lim\limits_{x\to a}f(x)=0\) using the squeeze theorem. Recall that for any \(b\in \R\) we have \(-\abs{b}\leq b\leq \abs{b}\text{.}\) It follows that
\begin{equation*} -\abs{f(x)}\leq f(x)\leq \abs{f(x)} \end{equation*}
for all \(x\) in the domain of \(f\text{.}\) Thus, letting \(g(x)=-\abs{f(x)}\) and \(h(x)=\abs{f(x)}\text{,}\) we have
\begin{equation*} g(x)\leq f(x)\leq h(x) \end{equation*}
for all \(x\) in the domain of \(f\text{.}\) Using our assumption, we see that
\begin{align*} \lim_{x\to a}g(x) \amp = \lim_{x\to a}-\abs{f(x)}\\ \amp = -\lim_{x\to a}\abs{f(x)} \amp \text{(scal. mult.)}\\ \amp =0 \amp \text{(by assumption)}\\ \lim_{x\to a}h(x) \amp = \lim_{x\to a}\abs{f(x)}\\ \amp =0 \amp \text{(by assumption)}\text{.} \end{align*}
It now follows from the sandwich theorem that \(\lim\limits_{x\to a}f(x)=0\text{.}\)
Our final result uses the sandwich theorem to investigate the limits of sine and cosine at zero.

Proof.

  1. We use the sandwich theorem to prove this limit formula. Our choice of bounding functions will rely on an important inequality involving the sine function: namely
    \begin{equation} -\abs{\theta}\leq \sin \theta\leq \abs{\theta}\tag{2.100} \end{equation}
    for all \(\theta\in \R\text{.}\) The proof of this inequality (given at the end of this section) is nontrivial, but also instructive: it appeals to some of the unit circle geometry that goes into the definition of the trigonometric functions. In any case, we will simply assume (2.100) holds for the purpose of this proof. With that in place, our result is an easy consequence of the sandwich theorem. Indeed, setting \(g(\theta)=-\abs{\theta}\) and \(h(\theta)=\abs{\theta}\text{,}\) we have
    \begin{equation*} g(\theta)\leq \sin \theta\leq h(\theta) \end{equation*}
    for all \(\theta\text{,}\) by inequality (2.100), and
    \begin{equation*} \lim_{\theta\to 0}g(\theta)=\lim_{\theta\to 0}h(\theta)=0\text{,} \end{equation*}
    since \(\lim_{\theta\to 0}\abs{\theta}=0\text{.}\) The sandwich theorem now implies \(\lim\limits_{\theta\to 0}\sin \theta=0\text{.}\)
  2. First note that for all \(\theta\in (-\pi/2, \pi/2)\text{,}\) we have \(\cos \theta\geq 0\text{,}\) and hence
    \begin{align*} \cos \theta \amp = \abs{\cos \theta} \amp (\cos \theta\geq 0) \\ \amp = \sqrt{\cos^2\theta} \amp (\ans{a}=\sqrt{a^2})\\ \amp = \sqrt{1-\sin^2\theta} \amp (\cos^2\theta+\sin^2\theta=1) \end{align*}
    for all \(\theta\in (-\pi/2, \pi,2)\text{.}\) We then have
    \begin{align*} \lim_{\theta\to 0}\cos\theta \amp = \lim_{\theta\to 0}\sqrt{1-\sin^2\theta} \amp (\text{repl. rule})\\ \amp = \sqrt{\lim_{\theta\to 0}1-(\lim_{\theta\to 0}\sin\theta)^2} \amp \text{(root, sum,power)}\\ \amp = \sqrt{1-0^2} \amp \text{(sine eval.)}\\ \amp = 1\text{.} \end{align*}
As promised in the proof of Theorem 2.20.7, we provide a proof of the inequality \(-\abs{\theta}\leq \sin \theta\leq \abs{\theta}\text{,}\) or equivalently, \(\abs{\sin \theta}\leq \abs{\theta}\) for all \(\theta\in \R\text{.}\) You are not responsible for understanding this proof, but you might find the argument instructive nonetheless.

Proof of \(\abs{\sin\theta}\leq \abs{\theta}\).

We will prove that
\begin{equation} \abs{\sin \theta}\leq \abs{\theta}\tag{2.101} \end{equation}
for all \(\theta\in \R\text{.}\) First, observe that since \(\sin(-\theta)=-\sin\theta\text{,}\) we have
\begin{equation*} \abs{\sin (-\theta)}=\abs{-\sin \theta}=\abs{\sin \theta}\text{.} \end{equation*}
Thus the function \(f(\theta)=\abs{\sin \theta}\) is even. Since \(g(\theta)=\abs{\theta}\) is also even, it suffices to prove (2.101) for all \(\theta\geq 0\text{.}\) Furthermore, since
\begin{equation*} \theta\geq \pi/2\implies \sin\theta\leq 1 \leq \pi/2 \leq \theta\text{,} \end{equation*}
and since \(\sin(0)=0\text{,}\) it suffices to show (2.101) for all \(\theta\in (0,\pi/2)\text{.}\) To this end, take any \(\theta\in (0,\pi/2)\) and consider the usual reference triangle \(T\) for the central angle \(\theta\text{.}\) As shown below \(T\) lies completely within the interior \(S\) of the angle \(\theta\text{.}\)
Reference triangle within interior of angle theta
Elementary trigonometry tells us that \(\operatorname{area} T=\frac{1}{2}\sin \theta\text{;}\) elementary geometry tells us that \(\operatorname{area} S=\pi\cdot \frac{\theta}{2\pi}=\frac{\theta}{2}\text{.}\) We conclude that
\begin{align*} \frac{1}{2}\sin \theta \amp= \operatorname{area} T\\ \amp \leq \operatorname{area} S\\ \amp =\frac{\theta}{2}\text{,} \end{align*}
or equivalently,
\begin{equation*} \sin\theta\leq \theta \end{equation*}
for all \(\theta\in (0,\pi/2)\text{.}\) Since furthermore \(\sin\theta\geq 0\) and \(\theta\geq 0\) for \(\theta\in (0,\pi/2)\text{,}\) we see that
\begin{equation*} \abs{\sin\theta}\leq \abs{\theta} \end{equation*}
for all \(\theta\in (0,\pi/2)\text{,}\) as desired.

Subsection Continuity of trigonometric functions

Since \(\sin(0)=0\) and \(\cos(0)=1\text{,}\) the limit equalities of Theorem 2.20.7 can be reinterpreted as follows:
\begin{align*} \lim\limits_{x\to 0}\sin x \amp =\sin(0) \\ \lim\limits_{x\to 0}\cos x \amp = \cos(0) \text{.} \end{align*}
In other words, \(\sin\) and \(\cos\) are both continuous at \(x=0\text{.}\) Amazingly, with the help of the sum and difference identities stated below, we will be able to deduce that \(\sin\) and \(\cos\) are continuous at all inputs \(a\text{.}\)
With these identities in hand we will prove that \(\lim_{x\to a}\sin x=\sin(a)\) and \(\lim\limits_{x\to a}\cos(x)=\cos(a)\) using the following trick: for any function \(f\text{,}\) we have \(\lim\limits_{x\to a}f(x)=\lim\limits_{x\to 0}f(x+a)\text{.}\) We now compute our two limits simultaneously:
\begin{align*} \lim\limits_{x\to a}\sin x \amp = \lim\limits_{x\to 0}\sin(x+a) \amp \lim\limits_{x\to a}\cos x \amp = \lim\limits_{x\to 0}\cos(x+a)\\ \amp = \lim\limits_{x\to 0}\sin x\cos a + \cos x\sin a \amp \amp = \lim\limits_{x\to 0}\cos x\cos a - \sin x\sin a \\ \amp = \sin(0)\cos(a)+\cos(0)\sin(a) \amp \amp = \cos(0)\cos(a)-\sin(0)\sin(a) \\ \amp = \sin(a) \amp \amp = \cos(a) \text{.} \end{align*}
We have thus shown that \(\cos\) and \(\sin\) are continuous on their entire domain. Since the remaining trigonometric functions are defined as quotients and reciprocals of these two functions, we see that all of the trigonometric functions are continuous.

Subsection Trigonometric derivatives

Lastly, we treat differentiability of the trigonometric functions. Not surprisingly, the situation here is as good as could be hoped for: the trigonometric functions are differentiable everywhere on their domain. We begin with \(\cos\) and \(\sin\text{.}\)

Proof.

We prove the derivative formula for \(\sin\text{;}\) the argument for \(\cos\) is very similar. Using the limit definition of the derivative, we have
\begin{align*} \frac{d}{dx}(\sin x) \amp = \lim\limits_{h\to 0}\frac{\sin(x+h)-\sin x}{h}\\ \amp \lim\limits_{h\to 0}\frac{\sin x\cos h+\cos x\sin h-\sin x}{h}\\ \amp = \lim\limits_{h\to 0}\frac{\sin x(\cos h-1)}{h}+\frac{\cos x\sin h}{h}\\ \amp = \sin x\lim\limits_{h\to 0}\frac{\cos h-1}{h}+\cos x \lim\limits_{h\to 0}\frac{\sin h}{h} \\ \amp = \sin x\cdot 0 +\cos x\cdot 1\\ \amp = \cos x\text{,} \end{align*}
where the penultimate step makes use of our previously discussed limits
\begin{align*} \lim\limits_{t\to 0}\frac{\sin t}{t} \amp =1 \amp \lim\limits_{t\to 0}\frac{\cos t-1}{t}=0 \text{.} \end{align*}

Example 2.20.11. Tangent lines: sinusoidal.

Let \(f(x)=\cos x-\sin x\text{.}\)
  1. Find an equation for the tangent line to the graph of \(f\) at \(x=\pi/3\text{.}\)
  2. Find all points on the graph of \(f\) where the tangent line is horizontal.
Solution.
  1. The tangent line to the graph of \(f\) at \(x=\pi/3\text{,}\) passes through the point
    \begin{equation*} P=(\pi/3, f(\pi/3))=(\pi/3, \cos(\pi/3)-\sin(\pi/3))=(\pi/3, 1/2-\sqrt{3}/2). \end{equation*}
    The slope of the tangent line here is given by \(f'(\pi/3)\text{.}\) We first compute
    \begin{align*} f'(x) \amp = (\cos x)'-(\sin x)' \amp \text{(lin. comb.)}\\ \amp = -\sin x-\cos x\text{.} \end{align*}
    Thus the slope of the tangent line is
    \begin{equation*} f'(\pi/3)=-\sin(\pi/3)-\cos(\pi/3)=-(\frac{\sqrt{3}+1}{2})\text{,} \end{equation*}
    We conclude that an equation for the tangent line here is
    \begin{equation*} y-\frac{1-\sqrt{3}}{2}=-\frac{1+\sqrt{3}}{2}(x-\frac{\pi}{3})\text{.} \end{equation*}
  2. The tangent line to a point \(P=(x,f(x))\) on the graph of \(f\) is horizontal when its slope \(f'(x)=0\text{.}\) Thus we need to find all \(x\) such that
    \begin{equation*} f'(x)=-\sin x-\cos x=0\text{,} \end{equation*}
    or equivalently,
    \begin{equation*} \tan x=-1\text{.} \end{equation*}
    The solutions to this trig equation are
    \begin{equation*} x=\frac{3\pi}{4}+\pi n, \end{equation*}
    where \(n\) is an integer. The corresponding points on the graph are
    \begin{equation*} P=\left(\frac{3\pi}{4}+\pi n, f\left(\frac{3\pi}{4}+\pi n\right)\right) = \begin{cases} \left(\frac{3\pi}{4}+\pi n, -\sqrt{2}\right) \amp \text{if } n \text{ is even}\\ \left(\frac{3\pi}{4}+\pi n, \sqrt{2}\right) \amp \text{if } n \text{ is odd}\\ \text{.}\end{cases} \end{equation*}
The differentiability of the remaining trigonometric functions now follows from the quotient and chain rules. For example, we have
\begin{align*} \frac{d}{dx}(\tan x) \amp =\frac{d}{dx}(\sin x/\cos x)\\ \amp = \frac{(\sin x)'\cos x-\sin x(\cos x)'}{\cos^2 x}\\ \amp = \frac{\cos^2 x+\sin^2x}{\cos^2 x}\\ \amp = \frac{1}{\cos^2 x}\\ \amp = (1/\cos x)^2\\ \amp = \sec^2 x\text{,} \end{align*}
and
\begin{align*} \frac{d}{dx}\sec x \amp =\frac{d}{dx}(\cos x)^{-1}\\ \amp =-1(\cos x)^{-2}(\cos x)'\\ \amp =\frac{\sin x}{\cos^2 x}\\ \amp = \frac{\sin x}{\cos x}\cdot \frac{1}{\cos x}\\ \amp = \tan x\sec x\text{.} \end{align*}
The other derivative formulas below follow in a similar vein.

Example 2.20.13. Curve sketching with trigonometric functions.

Let \(f(x)=2\cos x+\sqrt{2}\cos^2 x\) and let \(I=[\pi/2, 3\pi/2]\text{.}\)
  1. Find all critical points of \(f\text{,}\) and for each critical point \(a\) classify \(f(a)\) as a local maximum value of \(f\text{,}\) a local minimum value of \(f\text{,}\) or neither.
  2. Apply Procedure 2.4.5 to find the intervals of monotonicity of \(f\) within \(I\text{.}\)
Solution.
We first compute
\begin{align*} f'(x) \amp = -2\sin x-\sqrt{2}\cos x\sin x=-2\sin x(1+\sqrt{2}\cos x) \text{.} \end{align*}
Since \(f\) is differentiable everywhere, critical points of \(f\) are solutions to \(f'(x)=0\text{.}\) We thus solve:
\begin{align*} f'(x) \amp =0\\ -2\sin x(1+\sqrt{2}\cos x) \amp = 0\\ \sin x =0 \amp\text{ or } 1+\sqrt{2}\cos x=0 \\ \sin x =0 \amp \text{ or } \cos x=-\frac{1}{\sqrt{2}} \text{.} \end{align*}
We have \(\sin x=0\) if and only if \(x=\pi n\) for some integer \(n\in \Z\text{.}\) Only one of these solutions lies in \(I=[\pi/2,3\pi /2]\text{:}\) namely, \(x=\pi\text{.}\) Next, observing that \(1/\sqrt{2}=\sqrt{2}/2\text{,}\) and recalling facts about the unit circle, we see that \(x\) solves \(\cos x=-1/\sqrt{2}=-\sqrt{2}/2\) if and only if
\begin{equation*} x=\frac{3\pi }{4}+2\pi n \text{ or } x=\frac{5\pi }{4}+2\pi n \end{equation*}
for some integer \(n\in \Z\text{.}\) There are exactly two such solutions lying in \([\pi/2, 3\pi/2]\text{:}\) namely, \(x=3\pi/4\) and \(x=5\pi /4\text{.}\) In conclusion, the critical points of \(f\) are \(3\pi/4, \pi, 5\pi/4\text{.}\)
To finish the problem essentially all we have to do is produce the sign diagram of \(f'\text{.}\)
Sign diagram of derivative of trig function
Figure 2.20.14. Sign diagram for \(f'(x)\)
This was produced by performing the following test point evaluations:
\begin{align*} f'(2\pi/3) \amp = -2(\sqrt{3}/2)(1-\sqrt{2}/2)< 0 \\ f'(5\pi/6) \amp = -2(1/2)(1-\sqrt{6}/2)> 0 \amp (\sqrt{6}> 2)\\ f'(7\pi/6) \amp = -2(-1/2)(1-\sqrt{2}/2)< 0 \amp (\sqrt{6}> 2)\\ f'(4\pi/3) \amp = -2(-\sqrt{3}/2)(1-\sqrt{2}/2)> 0 \text{.} \end{align*}
It follows that \(f(3\pi/4)\) is a local minimum value, \(f(\pi)\) is a local maximum value, and \(f(5\pi/4)\) is a local minimum value of \(f\text{.}\)
Furthermore, we see that within the interval \([\pi,3\pi/2]\) the function \(f\) is increasing on \([\pi,3\pi/4]\) and \([\pi, 5\pi /4]\text{,}\) and decreasing on \([3\pi/4, \pi]\) and \([5\pi/4, 3\pi /2]\text{.}\)
We verify our conclusions below with the actual graph of \(f\) on \([\pi, 3\pi/2]\text{.}\)
Graph of the trig function of the example
Figure 2.20.15. Graph of \(f(x)=2\cos x+\sqrt{2}\cos^2 x\)

Example 2.20.16. Extreme value theorem with trigonometric function.

Let \(f(x)=x+2\cos x\text{.}\) Find the absolute maximum and minimum values of \(f\) on the interval \(I=[0,2\pi]\text{.}\)
Solution.
The function \(f\) is easily seen to be differentiable everywhere, with \(f'(x)=1-2\sin x\text{.}\) To find critical points, we solve:
\begin{align*} f'(x) \amp =0\\ 1-2\sin x \amp = 0\\ \sin x \amp = \frac{1}{2}\text{.} \end{align*}
Reactivating our trig expertise, we realize that the solutions to the last equation come in two infinite lists:
\begin{align*} x \amp = \frac{\pi}{6}+2\pi n, \hspace{10pt} n \in \Z\\ x \amp= \frac{5\pi}{6}+2\pi n, \hspace{10pt} n \in \Z \text{.} \end{align*}
Thus the solutions lying in the interior \((0,2\pi)\) of the given interval are
\begin{equation*} x=\frac{\pi}{6}, \frac{5\pi}{6}\text{.} \end{equation*}
Now evaluate \(f\) at our candidates, the two critical points and the two endpoints:
\begin{align*} f(0) \amp = 2\\ f(\pi/6) \amp =\frac{\pi}{6}+2\cos(\pi/6)=\frac{\pi}{6}+\sqrt{3}\\ f(5\pi/6) \amp = 5\pi/6+2\cos(5\pi/6)=5\pi/6-\sqrt{3}\\ f(2\pi) \amp = 2\pi+2=2(\pi+1)\text{.} \end{align*}
Admittedly, comparing these values is somewhat challenging without the use of technology. It turns out that
\begin{equation*} f(5\pi/6)\leq f(2)\leq f(\pi/6)\leq f(2\pi)\text{,} \end{equation*}
and thus that \(f(5\pi/6)=5\pi/6-\sqrt{3}\) is the absolute minimum value of \(f\) on \(I\text{,}\) and \(f(2\pi)=2\pi+2\) is the absolute maximum value of \(f\) on \(I\text{.}\) Below you find a graph of \(f\) that bears out our analysis.
Graph of example function revealing the extreme values.