% This is lecture no. 3 of MH1100/: Calculus I.

\chapter{Continuity}%
\label{cha:continuity}

\section{Precise Definitions}%
\label{sec:precise_definition}

\begin{definition}
	Continuous.
	A function $f$ is continuous at a number $a$ if:
	\[
		\lim_{x \to a}f(x) = f(a)
	.\]
\end{definition}

\noindent
The definition implicitly requires three things if $f$ is continuous at $a$ :
\begin{enumerate}
	\item $f(a)$ is defined (that is, $a$ is in the domain of $f$).
	\item $\lim_{x \to a}f(x)$ exists.
	\item $\lim_{x \to a}f(x) = f(a)$
\end{enumerate}

\begin{definition}
	One Sided Continuity.
	A function $f$ is continuous from the right at a number $a$ if:
	\[
		\lim_{x \to a^+}f(x) = f(a)
	.\]
	and $f$ is continuous from the left at $a$ if:
	\[
		\lim_{x \to a^-}f(x)=f(a)
	.\]
\end{definition}

\begin{definition}
	Continuous on an Interval.
	A function $f$ is continuous on an interval if it is continuous at every number in the interval.
\end{definition}

\begin{exmp}
	Show that the function $f(x)=1-\sqrt{1-x^2}$ is continuous on the interval $[-1,1]$
	\begin{sol}
		If $-1<a<1$, then using the limit laws, we have:
		\begin{align*}
			\lim_{x \to a}f(x) & = \lim_{x \to a}(1-\sqrt{1-x^2})\\
					   & = 1-\lim_{x \to a}\sqrt{1-x^2}\\
					   & = 1-\sqrt{\lim_{x \to a}(1-x^2)}\\
					   & = 1-\sqrt{1-a^2}\\
					   & = f(a)
		\end{align*}
		Thus by the definition of continuity, $f$ is continuous at $a$ if $-1<a<1$.
		We can also see that:
		\[
			\lim_{x \to 1^+}f(x) = 1 = f(-1)
			\quad
			\text{and}
			\quad
			\lim_{x \to 1^-}f(x) = 1 = f(1)
		.\]
		so $f$ is continuous from the right at -1 and continuous from the left at 1.
		Therefore we can see that $f$ is continuous on $[-1,1]$.
	\end{sol}
\end{exmp}

\section{Composition of Continuous Functions}%
\label{sec:composition_of_continuous_functions}


If $f$ and $g$ are continuous at $a$ and if $c$ is a constant, then the following functions are also continuous at $a$ :

\begin{center}
	\begin{tabular}{c c c c c}
		$f+g$ & & $f-g$ && $cf$ \\
	\end{tabular}

	\begin{tabular}{c c c}
		$fg$ & & $\frac{f}{g}$ if $g(a)\neq 0$ \\
	\end{tabular}
\end{center}

It follows that if $f$ and $g$ are continuous on an interval, then so are the functions stated above.

\begin{thrm}
	Direct Substitution Property.
	Any polynomial is continuous everywhere; that is, it is continuous on $\mathbb{R} = (-\infty, \infty)$.
	Any rational function is continuous wherever it is defined; that is, it is continuous on its domain.
\end{thrm}

The following types of functions are continuous at every number in their domains:
\begin{itemize}
	\item Polynomials
	\item Rational Functions
	\item Root Functions
	\item Trigonometric Functions
\end{itemize}

\begin{thrm}
	If $f$ is continuous at $b$ and $\lim_{x \to a}g(x)=b$, then:
	\[
	\lim_{x \to a}f(g(x)) = f(b)
	.\]
	In other words:
	\[
		\lim_{x \to a}f(g(x)) = f\left(\lim_{x \to a}g(x)\right)
	.\]
\end{thrm}

\section{Root Law}%
\label{sec:root_law}

Let $g$ be a function and let $a \in \mathbb{R}$.
Suppose that $n$ is a positive integer.
If the limit $\lim_{x \to a}g(x)$ exists, then $\lim_{x \to a}\sqrt[\leftroot{-2}\uproot{2}n]{g(x)}$ exists and:
\[
	\lim_{x \to a}\sqrt[\leftroot{-2}\uproot{2}n]{g(x)} = \sqrt[\leftroot{-2}\uproot{2}n]{\lim_{x \to a}g(x)}
.\]
If $n$ is even, we assume that $\lim_{x \to a}g(x) > 0$.

\section{Intermediate Value Theorem}%
\label{sec:intermediate_value_theorem}

\begin{thrm}
	Intermediate Value Theorem.
	If $f$ is continuous on the interval $[a,b]$ and $d$ is between $f(a)$ and $f(b)$, then there is a number $c$ in $[a,b]$ such that $f(c)=d$.
\end{thrm}
