Midterm 1: problems and solutions
- (10 points) Compute the following limits using the limit laws and any limits we have already covered (the last two require the squeeze theorem)
- $\lim\limits_{x\rightarrow 0}\frac{\sin x \cos x}{x}$
Answer:
Recall that $\lim\limits_{x\rightarrow 0}\frac{\sin x}{x}=1$, and since $\cos x$ is continuous, $\lim\limits_{x\rightarrow 0}\cos x=\cos 0=1$, thus by the limit laws,
\[\lim_{x\rightarrow 0}\frac{\sin x\cos x}{x}
=\lim_{x\rightarrow 0}\left(\frac{\sin x}{x}\cos x\right)
=\left(\lim_{x\rightarrow 0}\frac{\sin x}{x}\right)\left(\lim_{x\rightarrow 0}\cos x\right) = 1\cdot 1=1.\]
- $\lim\limits_{x\rightarrow 0} x^{2}\cos \frac{1}{x}$
Answer: Since
\[-1\leq \cos \frac{1}{x}\leq 1,\]
for all $x\neq 0$, we have
\[-x^{2}\leq x^{2}\cos \frac{1}{x}\leq x^{2},\]
and since $\lim\limits_{x\rightarrow 0}(-x^{2})=\lim\limits_{x\rightarrow 0}x^{2}=0$, by the squeeze theorem, $\lim\limits_{x\rightarrow 0} x^{2}\cos\frac{1}{x}=0$.
- $\lim\limits_{x\rightarrow\infty}\frac{2x^{2}}{x^{2}+\cos x}$.
Answer:
Dividing out by $x^{2}$ from the top and bottom, we get
\[\lim_{x\rightarrow \infty}\frac{2x^{2}}{x^{2}+\cos x}\cdot \frac{\frac{1}{x^{2}}}{\frac{1}{x^{2}}}
=\lim_{x\rightarrow \infty}\frac{2}{1+\frac{\cos x}{x^{2}}}.\]
Hence, if we show that $\lim\limits_{x\rightarrow \infty} \frac{\cos x}{x^{2}}=0$, then this limit above is equal to
\[\frac{\lim_{x\rightarrow} 2}{\lim_{x\rightarrow\infty}(1+\frac{\cos x}{x^{2}})} = \frac{2}{1+0}=2.\]
So let us compute $\lim\limits_{x\rightarrow \infty} \frac{\cos x}{x^{2}}=0$. Note that since
\[-1\leq \cos x\leq 1,\]
multiplying this inequality by $\frac{1}{x^{2}}$, we get
\[-\frac{1}{x^{2}}\leq\frac{\cos x}{x^{2}}\leq \frac{1}{x^{2}},\]
and since both $\frac{1}{x^{2}}$ and $-\frac{1}{x^{2}}$ go to zero as $x\rightarrow\infty$, we may deduce by the squeeze theorem that the middle function also goes to zero, and we're done.
- Let
\[f(x)=x+\cos x.\]
Use the intermediate value theorem to show that $f(x)=0$ for some $x\in [-\frac{\pi}{2},\frac{\pi}{2}]$.
Answer:
Note that
\[f(-\frac{\pi}{2})=-\frac{\pi}{2}+\cos(-\frac{\pi}{2})=-\frac{\pi}{2}+0=-\frac{\pi}{2}\]
and
\[f(\frac{\pi}{2})=\frac{\pi}{2}+\cos(\frac{\pi}{2})=\frac{\pi}{2}+0=\frac{\pi}{2}.\]
Since $f(-\frac{\pi}{2})\leq 0 \leq f(\frac{\pi}{2})$, by the intermediate value theorem, there is an $x\in [-\frac{\pi}{2},\frac{\pi}{2}]$ such that $f(x)=0$.
- (10 points) Let
\[f(x)=\left\{ \begin{array}{cc} \frac{x^{2}-6x+5}{x-5} & x\neq 5 \\ a & x= 5\end{array} \right..\]
Solve for $a$ so that $f$ is continuous at $x=5$, justify your answer.
Answer:
For $f$ to be continuous at $x=5$, we need $\lim_{x\rightarrow 5}f(x)=f(5)=a$, so we need only set $a$ equal to this limit. The limit is
\[\lim_{x\rightarrow 5} f(x)=\lim_{x\rightarrow 5}\frac{x^{2}-6x+5}{x-5}
=\lim_{x\rightarrow 5}\frac{(x-1)(x-5)}{x-5}=\lim_{x\rightarrow 5} (x-1)=5-1=4,\]
hence if we set $a=4$, the function $f$ is continuous.
- (10 points) For $x\neq 0$, compute the derivative of $\frac{1}{x^{2}}$ using the formal definition of a derivative.
Answer:
To solve, we write out the limit for the derivative of $\frac{1}{x^{2}}$ and simplify it until we can just plug in $h=0$, as follows,
\begin{align*}
\lim_{h\rightarrow 0} \frac{\frac{1}{(x+h)^{2}}-\frac{1}{x^{2}}}{h} & = \lim_{h\rightarrow 0}\frac{\frac{x^{2}}{(x+h)^{2}h^{2}}-\frac{(x+h)^{2}}{(x+h)^{2}x^{2}}}{h}
=\lim_{h\rightarrow 0} \frac{x^{2}-(x^{2}+2hx+h^{2})}{h(x+h)^{2}x^{2}}\\
& = \lim_{h\rightarrow 0} \frac{-2hx-h^{2}}{h(x+h)^{2}x^{2}}
=\lim_{h\rightarrow 0} \frac{-2x-h}{(x+h)^{2}x^{2}} \\
& = \lim_{h\rightarrow 0}\frac{-2x-0}{(x+0)^{2}x^{2}}=\frac{-2x}{x^{4}}=-\frac{2}{x^{3}}.
\end{align*}
- (10 Points) Let
\[f(x)=\left\{ \begin{array}{cc} \cos x & x\geq 0 \\ 1+ x & x<0 \end{array}\right. .\]
where $\alpha$ is some number. Show that $f$ is continuous at $x=0$.
Answer:
To show that $f$ is continuous at $0$, we show $\lim\limits_{x\rightarrow 0} f(x)=f(0)$, which we can show by computing the left and right hand limits and showing that they both agree and equal $f(0)=1+0=1$.
\[
\lim_{x\rightarrow 0^{+}}f(x)=\lim_{x\rightarrow 0^{+}}\cos x=\cos 0=1.\]
The first equality follows from the fact that, when $x\rightarrow 0^{+}$, it approaches $0$ from the right, so $x$ is positive, and by the definition of $f$, $f(x)=\cos x$ whenever $x$ is positive. The second to last equality follows since $\cos x$ is continuous everywhere, so we can just plug in $x=0$.
For the left hand limit,
\[\lim_{x\rightarrow 0^{-}}f(x)=\lim_{x\rightarrow 0^{-}}(1+x)=1+0=1.\]
Again, if $x\rightarrow 0^{-}$, then $x<0$, and for negative $x$, we have $f(x)=1+x$ by its definition, and since $1+x$ is continuous, we can just plug in $x=0$. Since both the left and right limits agree, the limit of $f$ as $x$ goes to zero exists and equals 1, that is,
\[\lim_{x\rightarrow 0}f(x)=1=f(0),\]
thus $f$ is continuous at $0$.