\documentclass[addpoints, 11pt]{exam}
\setlength{\headsep}{0.125in}
\setlength{\unitlength}{1in}
%
\pagestyle{head}
%
\usepackage{psfrag}
%
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
%
\newcommand{\myCourseNumber}{Math 142B}
\newcommand{\myAssignmentDueDate}{11:00pm Thursday, January 18, 2024}
\newcommand{\myAssignmentTitle}{Homework Assignment 1}
%
%
\begin{document}
%
\firstpageheader{\bfseries \myCourseNumber \enspace \myAssignmentTitle \\ Due \myAssignmentDueDate }{}{}
%
\runningheader{{\bfseries (page \textit{\thepage}\ of \textit{\numpages})}}{}{}
%
%\firstpagefooter{}{}{(This exam is worth {\numpoints} points.)}
%

\begin{questions}

%% Ross 28.4
\question Let $\displaystyle f(x) = x^2 \sin\left(\frac1{x}\right)$ for $x \not= 0$ and $f(0) = 0$.
\begin{parts}
\part Show that $f$ is differentiable at each $x \not= 0$. (Use without proof the fact that $\sin(x)$ is differentiable and $\sin'(x) = \cos(x)$.)

\part Use the definition of derivative to show that $f$ is differentiable at $x = 0$ and that $f'(0) = 0$.

\part Show that $f'$ is not continuous at $x = 0$.
\end{parts}

%% Ross 28.5
\question Let $\displaystyle f(x) = x^2 \sin\left(\frac1{x}\right)$ for $x \not= 0$, $f(0) = 0$, and $g(x) = x$ for $x \in \mathbb{R}$.
\begin{parts}
\part Calculate $f\left( \frac1{n \, \pi} \right)$ for $n = \pm 1, \pm 2, \pm 3, \ldots$

\part Explain why \ $\displaystyle \lim_{x \to 0} \frac{g\left(f\left(x\right)\right) - g\left(f\left(0\right)\right)}{f(x) - f(0)}$ \ is meaningless; that is, fails to exist.
\end{parts}

%% Ross 28.8
\question Let $f(x) = \begin{cases} x^2 & \text{if} \ x \in \mathbb{Q}, \\ 0 & \text{if} \ x \in \mathbb{R} \setminus \mathbb{Q}. \end{cases}$
\begin{parts}
\part Show that $f$ is continuous at $x = 0$.

\part Show that $f$ is discontinuous at all $x \not= 0$.

\part Show that $f$ is differentiable at $x = 0$.  Note that the formula $f'(x) = 2 x$ does \emph{not} apply to this function $f$.
\end{parts}

%% Ross 28.14
\question Suppose $f$ is differentiable at $x = x_0$.
\begin{parts}
\part Show that \ $\displaystyle \lim_{h \to 0} \frac{f(x_0 + h) - f(x_0)}{h} = f'(x_0)$.

\part Show that \ $\displaystyle \lim_{h \to 0} \frac{f(x_0 + h) - f(x_0 - h)}{2 h} = f'(x_0)$.
\end{parts}

%% Fitzpatric 4.2.6
\question Suppose that the function $f : (0, \infty) \to \mathbb{R}$ is differentiable and let $c > 0$.  Define $g : (0, \infty) \to \mathbb{R}$ by $g(x) = f(c \, x)$.
Using only the definition of derivative (without appealing to the chain rule), show that $g'(x) = c f'(c \, x)$ for $x > 0$.

%% Fitzpatrick 4.3.18
\question Let $g$ be a function that is differentiable on an open interval $I$ containing $x_0$.

Define $h(x) = \begin{cases} \frac{g(x) - g(x_0)}{x - x_0} & \text{if} \ x \not= x_0 , \\ g'(x_0) & \text{if} \ x = x_0 . \end{cases}$
\begin{parts}
\part Show that $h$ is continuous on $I$.

\part Show that if $g'(x_0) > 0$, then there is a $\delta > 0$ such that $\frac{g(x) - g(x_0)}{x - x_0} > 0$ for $0 < |x - x_0| < \delta$. 
\end{parts}

%% Ross 29.2
\question Show that \ $|\cos(x) - \cos(y)| \leq |x - y|$ \ for all $x,y \in \mathbb{R}$.

%% Ross 29.5
\question Let $f$ be a function defined on $\mathbb{R}$ with the property that \ $|f(x) - f(y)| \leq (x - y)^2$. \ Show that $f$ is a constant function.

%% Ross 29.4
\question Let $f$ and $g$ be differentiable functions defined on an open interval $I$.  Suppose $a < b \in I$ with $f(a) = f(b) = 0$. Show that $f'(x) + f(x)g'(x) = 0$ for some $x \in (a,b)$.  [Hint: Consider $h(x) = f(x) \, e^{g(x)}$.]

%% Ross 29.9
\question Show that \ $e \, x \leq e^x$ \ for all $x \in \mathbb{R}$.


\end{questions}

\end{document}
