\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,amsfonts, amsthm, amscd} % standard math packages
\usepackage{geometry} % to specify the size of the document
\usepackage{latexsym} %for the blacksquare
\usepackage{eucal} %curly C's
\usepackage{graphicx}
\usepackage{coordsys}
\usepackage{enumerate, framed, float, caption, subcaption}
\usepackage{multicol,color,polynom, multido}
\geometry{body={7in,9in}, top=1in, left=.5in, nohead}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathreplacing}
\def\R{\mathbb{ R}}
\def\N{\mathbb{ N}}
\def\Z{\mathbb{ Z}}
\def\Q{\mathbb{ Q}}
\def\D{\mathbb{ D}}
\def\A{\mathcal{ A}}
\def\B{\mathcal{ B}}
\def\C{\mathcal{ C}}
\def\L{\mathcal{ L}}
\def\V{\mathcal{ V}}
\def\F{\mathcal{ F}}
\def\P{\mathcal{ P}}
\def\d{\displaystyle}
\def\a{\overline{ a}}
\def\w{\overline{ w}}
\def\epsilon{\varepsilon}
\def\sp{\text{ }}
\pagestyle{plain}
\newcommand{\sgn}{\text{sgn}}
\newtheorem{thm}{Theorem}
\newtheorem{cry}{Corollary}
\newtheorem{lemma}{Lemma}
\newtheorem*{thm*}{Theorem}
\begin{document}
\tableofcontents
\newpage
\section{Preface} \label{preface}
This work is based on lectures I give as an instructor in MATH 205, Calculus I, at Kapi`olani Community College (KCC) in Honolulu, Hawai`i. The course is a requirement of all STEM (Science, Technology, Engineering, and Mathematics) degree pathways at KCC, and lasts one semester. This work was supported in part by the National Science Foundation, Hawaii's Pre-Engineering Education Collaboration, Award no. 1037827. Thank you to Sunyeen Pai, who proofread, Thor Christensen, my first calculus teacher, and Herve Collin for suggesting the project.
\vskip10pt
\begin{flushright}
-Austin Anderson, PhD
February 8, 2016
\end{flushright}
\newpage
\section{Introduction to Calculus} \label{intro}
I have heard two descriptions of calculus that stuck with me through the years. If someone asks you ``what is calculus?" at a party, tell them one of these:
1) Calculus is the mathematics of change. (you know, velocity)
2) Calculus is finding areas of weird shapes. (like under a parabola)
In truth, I think calculus is both of these and their connection. The math of change pretty much describes \textit{derivatives}, and finding areas of weird shapes is the main application of \textit{integrals}. Calculus is understanding both derivatives and integrals, and learning \textit{The Fundamental Theorem of Calculus}, which says derivatives and integrals are inverses (like how addition and subtraction are inverses, or multiplication and division are inverses). The ancient Greeks knew something about derivatives and areas, but they did not know the Fundamental Theorem of Calculus. Isaac Newton and Gottfried Wilhelm von Leibniz independently figured out ``the calculus" (that is what they used to call it) at the end of the 1600s. Newton used ``the calculus" to explain gravity, as in why apples falling off trees and the moon going around the earth are the same phenomenon. Newton's paper (more like a huge book with volumes I guess) \textit{Principia Mathematica} is sometimes thought of as the greatest scientific achievement of humankind.
We want to learn about derivatives first, and integrals later. Derivatives are a special case of something called a \textit{limit}, so most textbooks start with limits and then go to derivatives. Here we will do an example of a derivative. It is ok if it seems difficult to you, because we will spend a lot more time going into a lot more detail and seeing many more examples in the next two chapters. We do it here to motivate what follows, and hope that this seems easy by the end of the class.
If there is only one thing you remember from this class, it should be ``\textbf{the derivative is the slope of the tangent line}" (or ``the derivative is the instantaneous rate of change" but we will save that for later).
\vskip20pt
\textit{Example.} Find the slope of the tangent line to $\d y = \frac12 x^3$ at the point $\left( 1, \frac12 \right)$.
The picture is this:
\includegraphics[width=5in]{205lecture21tangentline.pdf}
The black curve is the cubic function $f(x) = \frac12 x^3$, and the red line is the \textit{tangent line}. This word ``tangent line" comes from the same root as the word ``tangible," and it touches the curve at a single point. The salient trait of the tangent line is that it goes in the same direction as the curve. The curve and line intersect at the point $\left( 1, \frac12 \right)$. Geometrically (visually), tangent lines are easy to understand, but analytically (with equations) they require a solid precalculus background and the big idea of this chapter: \textit{limits}. Without limits, we cannot get tangent lines, but we can still get \textit{secant lines}. A secant (same root as ``intersect") line crosses the curve at two
points, and precalculus teaches us all about this. The slope of the line through $(x_1,y_1)$ and $(x_2,y_2)$ is $\d m = \frac{y_2-y_1}{x_2-x_1}$. Think about using $x$ instead of $x_1$, $x+h$ instead of $x_2$, and $f(x)$ instead of $y$. The slope formula becomes $\d m = \frac{f(x+h) - f(x)}{h}$, which is the most convenient form for us here, and is commonly called a \textit{difference quotient.} Since $h$ is the distance between the two points on the secant line, if we shrink $h$ to 0 we get a tangent line at $x$, as the following diagram attempts to illustrate.
\begin{tikzpicture}
\draw (-1,0) -- (6,0) node[anchor=north]{$$};
\filldraw (1,0.7) circle (3pt);
\draw (1,-0.25) node[anchor=north]{$x$} --(1,0.25);
\draw (5,-0.25) node[anchor=north]{$ \leftarrow (x+h)$} --(5,0.25);
\draw[ultra thick](0.5,0.7) .. controls (1,0.7) and (5,1) .. (5.1, 4.4);
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\filldraw[thick] (0.5,0.3) -- (1,0.7) -- (5.1,4.2) circle (3pt) -- (5.3,4.4);
\filldraw[thick] (0.5,0.4) -- (1,0.7) -- (4.8,3) circle (3pt) -- (5.1,3.2);
\filldraw[thick] (0.5,0.5) -- (1,0.7) -- (4,2) circle (3pt) -- (5,2.4);
\draw (2.5,-1) node[anchor=north]{\text{ secant lines }};
\end{tikzpicture}
\begin{tikzpicture}
\draw (-1,0) -- (6,0) node[anchor=north]{$$};
\filldraw (1,0.7) circle (3pt);
\draw (1,-0.25) node[anchor=north]{$x$} --(1,0.25);
\draw[ultra thick](0.5,0.7) .. controls (1,0.7) and (5,1) .. (5.1, 4.4);
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\draw[ultra thick][red] (0.5,0.6) -- (1,0.7) -- (5,1) ;
\draw (2.5,-1) node[anchor=north]{\text{ tangent line }};
\end{tikzpicture}
\vskip20pt
The above diagram is a big deal. I still remember when my calculus teacher drew that on the board; he made us put down our pencils and just watch, something which he only did for that one moment in the entire class. The idea is that a tangent line is a \textit{limit} of secant lines as $h$ goes to 0. We have not really learned what a limit is yet, so its ok to be wondering as we begin using the language of calculus.
Back to $f(x) = \frac 12 x^3$, we are going to calculate the slope of the secant lines. Your precalculus training should enable you to follow the next display. (It often takes a long time, thinking and checking with scratch paper, to follow a calculation. You may need to fill in steps on your own. If you are stuck after spending a long time on it, ask for help.)
\begin{align}
\frac{f(x+h) - f(x)}{h} &= \frac{ \frac 12 (x+h)^3 - \frac 12 x^3}{h}\\
&= \frac{\frac12 (x^3 + 3x^2h + 3xh^2 + h^3) - \frac 12 x^3}{h}\\
&= \frac{\frac12 x^3 + \frac32 x^2h + \frac32 xh^2 + \frac12 h^3 - \frac 12 x^3}{h}\\
&= \frac{ \frac 32 x^2h + \frac32 xh^2 + \frac12 h^3}{h}\\
&= \frac{ h \left( \frac 32 x^2 + \frac 32 xh + \frac12 h^2\right)}{h}\\
&= \frac 32 x^2 + \frac 32 xh + \frac12 h^2 \quad \text{ for } h \neq 0.
\end{align}
The first step is using the given function. (2) is an algebra exercise, like the FOIL method. (5) comes from simple factoring. In (6), it is important to note that you cannot cancel the $h$ unless $h \neq 0$, because $\frac 00$ is undefined.
So, $ \frac 32 x^2 + \frac 32 xh + \frac12 h^2$ is the slope of a secant line to $y = \frac 12 x^3$. To find the tangent line in the first picture, we let $x = 1$ and we take a limit as $h \to 0$. It amounts to simply plugging in $x = 1$, $h = 0$, giving the slope
$ \frac 32 (1)^2 + \frac 32 (1)(0) + \frac12 (0)^2 = \frac32$.
PAU. The answer is $\frac32$. Look carefully at the first picture, and try to measure the rise over the run (slope) of the red line, a.k.a. the tangent line. The slope should look like $\frac32$. Later, we will say the \textit{derivative} of $f(x)= \frac12 x^3$ at 1 is $\frac32$, and learn a very quick way to calculate it.
\vskip20pt
\section{Limits} \label{limits}
Our main goal is to understand how to find tangent lines to graphs of functions. When we look at the slope formula
$\d \frac{f(x+h) - f(x)}{h}$ for a secant line, and then let $h$ shrink to 0, we are taking a limit. This is probably the most important limit, but it is not the easiest to understand. Some limits are easier, and limits are important in and of themselves. In this section we look at some examples of limits.
\begin{framed}
$\d \lim_{x \to a} f(x) = L$ means $f(x)$ \textit{approaches} $L$ as $x$ \textit{approaches, but does not equal,} $a$.
\end{framed}
The notation $\d \lim_{x \to a} f(x) = L$ is standard and every detail matters; we will use it frequently in all that follows. The word \textit{approaches} is the best we can do here, but is not really satisfactory to a rigorous mathematician. I will often say ``gets infinitely close to" in place of ``approaches." In calculus, we need to talk about infinity a lot. Infinitely large things are just called ``infinite," and infinitely small (technically ``infinitesimally small") things are called ``infinitesimal." When $x$ approaches a number $a$, the distance $|x-a|$ becomes infinitesimally small, and the function values (the $y$-values) must get infinitely close (so the distance $|f(x) - L|$ gets infinitesimally small) to $L$ for the limit to exist. This is what makes calculus conceptually difficult and what gave the Greeks trouble (google Zeno's paradoxes). In fact, even Isaac Newton did not do a great job at explaining limits. Newton used an idea that he called \textit{fluxions}, which we do not use today because we have found something better. Modern calculus usually uses the $\epsilon$-$\delta$ (epsilon-delta) definition of a limit attributed to the mathematician Karl Weierstrass in the 1800s. The $\epsilon$-$\delta$ definition is covered in section \ref{epsilondelta}. For now, we will continue without probing the matter too deeply, and be content with vocabulary like ``approaches," ``gets close to," and ``goes to," or just an arrow, $\to$.
\vskip10pt
\textit{Example.} $\d \lim_{x \to 3} \frac{x-3}{x-3}$
First, focus on the function $f(x) = \d \frac{x-3}{x-3}$. The domain is all real numbers except 3. If you plug in any number in the domain, the top and bottom cancel, giving 1. I.e.,
\begin{equation}\label{xnot3}
f(x) = \d \frac{x-3}{x-3} = 1 \quad \text{for } x \neq 3.
\end{equation}
It is important to emphasize that the equality is only true when $x \neq 3$, because $0/0$ is undefined. The graph of $f$ looks like this:
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,5);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3);
\draw (-0.5,4)--(0.5,4) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,<->](-3,1) -> (5 , 1);
\filldraw[fill=white] (3,1) circle (3pt) node[anchor=south]{$(3,1)$};
\end{tikzpicture}
Note the puka (hole) at $(3,1)$. The function is undefined at $x=3$, so we can't plot a point there.
The limit $\d \lim_{x \to 3} \frac{x-3}{x-3}$ describes the $y$-value of the graph as $x$ \textit{approaches, but does not equal}, 3. Since the $y$-values near $x=3$ are all 1, we write $ \d \lim_{x \to 3} \frac{x-3}{x-3} = 1$, and say ``the limit of $\d \frac{x-3}{x-3}$ as $x$ goes to 3 is 1."
\vskip20pt
\textit{Example.} $\d \lim_{x \to 1}\frac{x^4 -1}{x-1}$
We will try to figure out this limit without a graph. Our goal is to determine what the $y$-values of the function $y = f(x) = \frac{x^4 -1}{x-1}$ approach as $x$ approaches 1. Note that $f(1)$ is undefined, but that does not mean we can't find the limit. Since 1 is the only $x$ value we cannot plug in to $f(x)$, we try to get infinitely close to 1 without touching it. Of course, we can't really do anything infinite in our finite lifetime, so we just go for a little while and hope to see a pattern. The table of values here is nothing more than plugging in $x$ values, using a calculator to get the $y$ values, and rounding to a few decimal places.
\begin{tabular}{c|c|c|c|c|c|c|}
\hline
$x$ & 0.9 & 0.99 & 0.999 & 1.001 & 1.01 & 1.1\\
\hline
$f(x)$ & 3.439 & 3.9404 & 3.994 & 4.006 & 4.0604 & 4.641\\
\hline
\end{tabular}
Note that $0.9$, $0.99$, $0.999$ is chosen to approach 1, and we figure that $3.439$, $3.9404$, $3.994$ is approaching 4. Therefore,
$\d \lim_{x \to 1}\frac{x^4 -1}{x-1} = 4.$
We have evaluated the limit and gotten the correct answer, but we are going to do it again, a different way. Tables are good for understanding, but bad for taking a lot of time and not always working. With some algebra and logic we can do a faster, better job evaluating limits. The key for $\lim_{x \to 1}\frac{x^4 -1}{x-1}$ is to factor the numerator. Although there is more than one way to do this, the following works and can be checked by multiplying:
\begin{equation*}
\frac{x^4 -1}{x-1} = \frac{(x-1)(x^3 + x^2 + x + 1)}{x-1} = x^3 + x^2 + x + 1 \quad \text{ for } x \neq 1.
\end{equation*}
(Be careful; it is incorrect to leave out ``for $x \neq 1$".) We deduce that $f(x)$ is the same as $x^3+x^2+x+1$ everywhere except 1, and in making our table of values we could have used the simpler formula. It is obvious$^*$ that $x^3+x^2+x+1$ is going to get closer to $1^3+1^2+1+1=4$ as $x$ gets closer to 1, so we know that $\d \lim_{x \to 1}(x^3+x^2+x+1) = 4$. Putting it all together, here is what we write to evaluate the limit:
\begin{align*}
\lim_{x \to 1}\frac{x^4 -1}{x-1} &= \lim_{x \to 1}\frac{(x-1)(x^3 + x^2 + x + 1)}{x-1} \\
&= \lim_{x \to 1} (x^3+x^2+x+1) \\
&= 1^3+1^2+1+1\\
&=4.
\end{align*}
Note carefully that we need the limit notation in the first 3 expressions, and it goes away when we plug in 1. Doing this incorrectly can lose you points on the test, because the correct notation demonstrates understanding.
CORRECT: $\d \lim_{x \to 1}\frac{(x-1)(x^3 + x^2 + x + 1)}{x-1}
= \lim_{x \to 1} (x^3+x^2+x+1)$
WRONG: $\d \frac{(x-1)(x^3 + x^2 + x + 1)}{x-1}
= (x^3+x^2+x+1)$
The latter is wrong because those two expressions are not always equal, which is shown by plugging in $x =1$ to each expression and getting a false statement. (Undefined = 4 is false.) However, when we have the limit notation out front it is ok, because the limit notation indicates $x$ approaches but \textit{does not equal} 1.
\vskip20pt
$*$ ``Obvious" is a risky word to use in math. Used here, we are glossing over a big part of understanding limits, namely, the \textbf{limit laws}:
\vskip10pt
\textbf{The limit of a constant is the constant:} $$\d \lim_{x \to a} k = k, \quad \text{ for a constant $k$.}$$
\textbf{As $x$ approaches $a$, $x$ approaches $a$ :} $$\d \lim_{x \to a} x = a \quad \text{ (duh, sorta)}.$$
\textbf{Constant Multiple Law:} $$\d \lim_{x \to a} [k f(x)] = k \lim_{x \to a} f(x), \quad \text{ for a constant $k$}.$$
\textbf{Sum Law:} $$\d \lim_{x \to a} [f(x) + g(x)] = \lim_{x \to a} f(x) + \lim_{x \to a} g(x), \quad \text{ provided the limits exist.} $$
\textbf{Product Law:} $$\d \lim_{x \to a} [f(x) g(x)] = \left( \lim_{x \to a} f(x) \right) \left( \lim_{x \to a} g(x) \right), \quad \text{ provided the limits exist.}$$
There are more, including the Difference Law, Quotient Law, and Power Law. The limit laws are especially important in proofs, but teaching a rigorous understanding of proofs is typically postponed until a student has completed their first calculus courses. (My favorite class in which to learn and use proofs is linear algebra, which at UH M\=anoa is MATH 311.)
\section{The $\epsilon ,\delta$ Definition of a Limit} \label{epsilondelta}
In the previous section, we used the word ``approach" in defining a limit. In advanced mathematics, this doesn't cut it. In this section, we will go into more detail about the definition of a limit. However, some calculus classes will skip this section because it is conceptually difficult. By skipping it, the beginning student loses little, and can still understand everything that follows. When I was a student, I didn't really learn the ideas in this section until a 300 level math class, long after I had finished my first calculus series (at UH the first calculus series is Calc I - IV). In that 300 level class, called \textit{Real Analysis}, one typically learns the definition of a real number as an equivalence class of Cauchy sequences. It addresses problems that can pretty much be avoided in beginning calculus. If one focuses on the details of real numbers, slightly strange things happen, such as the fact that a real number does not have a unique decimal expansion. $0.999999999.... = 1$ (woah). In my experience, that is the first place in a mathematics education where the $\epsilon ,\delta$ (say ``epsilon, delta") definition of a limit is truly necessary. Also, once a student has learned quite a bit about mathematical proof, they appreciate the usefulness of the $\epsilon ,\delta$ definition of a limit, and can work with the quantifiers more easily.
Thus, I personally prefer to learn about proofs, quantifiers, and the definition of a real number before the $\epsilon ,\delta$ definition of a limit. However, Calc I books typically include it, and at M\=anoa you might be expected to cover it in Calc I. When I was a teaching assistant in graduate school, a M\=anoa professor told me that the main reason he insisted on covering the $\epsilon ,\delta$ definition in Calc I was so students could learn to use \textit{quantifiers}, so let's start with that.
``Quantify" means count, or measure with a number. If you ``quantify" your success, you give a number for how much money you have, your G.P.A., how many years of school you finished, or something like that. Clearly a \textit{quantifier} quantifies something. Some examples of quantifiers you see in the language of mathematics are:
\textit{for all}; It means none are left out.
\textit{there exists some;} It means there is at least one.
\textit{there exists a unique;} It means there is one and only one.
You might see simple quantifiers in MATH 100 or a philosophy class that covers logic. For example:
``All girls are people."
``Some people are girls."
``One person is typing this sentence."
``There exists no person who is not a person." (The quantity is 0.)
These are logically valid statements, silly or obvious as they may sound. Math is all about logic validity, and it's not always obvious. Careful language is important. Another important idea in logic and proof is that of \textit{implication}.
You are a girl \textbf{implies} you are a person.
You are a person \textbf{does not imply} you are a girl. (Because you could be a boy or, you know, a non-girl person.)
ANYWAY, below is the most popular definition of a limit in modern math (there are others less popular), attributed to Karl Weierstrass
in the 1800s.
\begin{framed}
$$\lim_{x \to a} f(x) = L$$
means that for all $\epsilon > 0$, there exists some $\delta > 0$ such that
$$0 < |x-a| < \delta \quad \textbf{implies} \quad |f(x) - L| < \epsilon.$$
\end{framed}
Let's attempt to dissect the definition and put it in layman's terms. (Don't get your hopes up, though; it's written as well as it can be--that's why we use it. The layman's terms were already in section \ref{limits}.) In section \ref{limits} we said ``as $x$ approaches, but does not equal, $a$." This is represented by the $0 < |x-a| < \delta$ above. Think of $\epsilon$ and $\delta$ as very small numbers. The expression $|x-a|$ is the distance between $x$ and $a$, so $|x-a| < \delta$ means $x$ and $a$ are very close. If $|x-a| = 0$ then $x = a$, but we don't allow that in a limit, so $0 < |x-a|$ is required. The expression $|f(x) - L| < \epsilon$ means the $y$-values $f(x)$ are very close to the limit $L$. How close? Within $\epsilon$, an arbitrarily tiny distance. We say $\epsilon$ is arbitrary because the statement holds \textit{for all} $\epsilon > 0$. That's a strong statement. It needs to be true for $\epsilon = 0.1$, $\epsilon = 0.00000000000001$, ..., anything! (positive, not 0) So $\lim_{x \to a} f(x) = L$ means given \textit{any} $\epsilon > 0$, we can choose a nonzero $\delta$ that ensures $f(x)$ is within $\epsilon$ of $L$ whenever $x \neq a$ is within $\delta$ of $a$.
\vskip10pt
\textbf{Example:} Suppose $f(x) = 2x + 1$, $a = 3$, and $\epsilon = 0.1$.
Show that there exists some $\delta > 0$ such that $0 < |x - a| < \delta$ implies $|f(x) - 7| < \epsilon$.
\vskip10pt
We know by common sense (section \ref{limits}) that $$\lim_{x \to 3} f(x) = 2(3) + 1 = 7.$$ So the limit $L = 7$, and in this example we are working on verifying the statement $\lim_{x \to 3} f(x) = 7$ using the formal definition of a limit. For this function and $\epsilon = 0.1$, we can choose $\delta = 0.05$ (or anything smaller) to make the implication in the definition true.
\setcounter{equation}{0}
\begin{align}
&0 < |x - 3| < \delta\\
&\Rightarrow 0 < |x-3| < 0.05\\
&\Rightarrow |x-3| < 0.05\\
&\Rightarrow -0.05 < x - 3 < 0.05\\
&\Rightarrow -0.1 < 2(x-3) < 0.1\\
&\Rightarrow -0.1 < 2x+1 - 7 < 0.1\\
&\Rightarrow |2x+1 - 7| < 0.1\\
&\Rightarrow |f(x) - 7| < \epsilon
\end{align}
The chain of implications ($\Rightarrow$ means ``implies") can be summarized by the statement that we want: there exists some $\delta > 0$ such that $0 < |x-3| < \delta \Rightarrow |f(x) - 7| < \epsilon.$ Let's talk about each step. (1) is the assumption we are starting with, and (2) is identical with $\delta$ plugged in. We chose $\delta = 0.05$ but there are others that work. ``There exists some" is the quantifier, so one is enough. (3) is not needed, but in this case the function is defined at 3, so $x=a$ is not a problem. The reason I included (3) is that (3) $\Rightarrow$ (4) is an exact statement that I teach in College Algebra, MATH 103: if $|b| < c$ for some positive constant $c$, then $-c < b < c$. (5) comes from multiplying by 2. (6) is basic algebra since $2(x-3) = 2x-6 = 2x+1-7$, but it is done with (8) in mind specifically, because (7) is the MATH 103 fact again and (8) is plugging in the given $f$ and $\epsilon.$
\vskip10pt
\textbf{Example: } Prove that $\lim_{x \to 3} (2x+1) = 7$ using the $\epsilon ,\delta$ definition of a limit.
\vskip10pt
Now we have to do it \textit{for all} $\epsilon$. The $\delta$ that we choose depends on $\epsilon.$ For this function, we will see that $\delta = \frac{\epsilon}{2}$ works.
\begin{proof}
Given $\epsilon > 0$, let $\d \delta = \frac{\epsilon}{2}$. Then
\setcounter{equation}{0}
\begin{align}
&0 < |x - 3| < \delta\\
&\Rightarrow 0 < |x-3| < \frac{\epsilon}{2}\\
&\Rightarrow |x-3| < \frac{\epsilon}{2}\\
&\Rightarrow -\frac{\epsilon}{2} < x - 3 < \frac{\epsilon}{2}\\
&\Rightarrow -\epsilon < 2(x-3) < \epsilon\\
&\Rightarrow -\epsilon < 2x+1 - 7 < \epsilon\\
&\Rightarrow |2x+1 - 7| < \epsilon\\
&\Rightarrow |(2x+1) - 7| < \epsilon.
\end{align}
(Same steps as the first example, but now with arbitrary $\epsilon$.)
Therefore, $\d \lim_{x \to 3} (2x+1) = 7$.
\end{proof}
\section{One-sided Limits}
\begin{tabular}{c|c|c|c|c|c|c|}
\hline
$x$ & 0.9 & 0.99 & 0.999 & 1.001 & 1.01 & 1.1\\
\hline
$f(x)$ & 3.439 & 3.9404 & 3.994 & 4.006 & 4.0604 & 4.641\\
\hline
\end{tabular}
The above table, from section \ref{limits}, shows values of a function $f$ such that $\lim_{x \to 1} f(x) = 4$. The values 3.439, 3.9404, 3.994 are $y$-values at points where $x < 1$, and pertain to a one-sided limit, namely the \textit{left-hand limit.} For the left-hand limit, we use a little minus sign superscript in our limit notation, and write $\d \lim_{x \to 1^-} f(x) = 4$.
\begin{framed}
$\d \lim_{x \to a^-} f(x) = L$ means $f(x) \to L$ as $x \to a$ for $x < a.$
$\d \lim_{x \to a^+} f(x) = L$ means $f(x) \to L$ as $x \to a$ for $x > a.$
\end{framed}
The way I remember it is that $1^-$ is for $x$-values like 0.9, 0.99, 0.999, etc.... The $x$ values for $1^-$ are 1 minus a tiny number. On the other side of 1 in the table, the $y$-values 4.641, 4.0604, and 4.006 are approaching the \textit{right-hand limit,} $\lim_{x \to 1^+} f(x) = 4.$ In this case, both one-sided limits are 4, so the ``regular" limit is 4. Sometimes one or both of the one-sided limits do not exist. Sometimes they both exist, but are not equal, in which case the regular limit does not exist.
\textit{Example.}$y = \d \frac{x-3}{|x-3|}$.
Below is a graph of $f(x) = \d \frac{x-3}{|x-3|}$. Plot points carefully to verify that you understand the graph--you might be expected to draw it on your own on a test.
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,4);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,->](3,1) -> (5 , 1);
\draw[ultra thick,->](3,-1) -> (-3 , -1);
\filldraw[fill=white] (3,1) circle (3pt) node[anchor=south]{$(3,1)$};
\filldraw[fill=white] (3,-1) circle (3pt) node[anchor=south]{$(3,-1)$};
\end{tikzpicture}
The $y$-values are 1 for $x > 3$ and $-1$ for $x < 3$. We can see from the picture that the right-hand limit is 1 and the left-hand limit is $-1$. We write
$\d \lim_{x \to 3^+} f(x) = 1$, for the right-hand limit, and
$\d \lim_{x \to 3^-} f(x) = -1$, for the left-hand limit.
Since the one-sided limits are not equal, $\d \lim_{x \to 3} f(x)$ does not exist. Make sure you remember that the superscript $+$ is for the right-hand limit, and it means \textit{from the right} (``from" not ``to").
\textit{Example.} Graph of $y = f(x)$ below.
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,4);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,->](3,0) -> (5 , 2);
\draw[ultra thick,->](3,-1) .. controls (3,1) and (-2,1) .. (-3 , 1);
\filldraw(3,0) circle (3pt) node[anchor=south]{$$};
\filldraw[fill=white] (3,-1) circle (3pt) node[anchor=north]{$(3,-1)$};
\end{tikzpicture}
The limits are $\d \lim_{x \to 3^+}f(x) = 0$, $\d \lim_{x \to 3^-} f(x) = -1$, and $\d \lim_{x \to 3} f(x)$ d.n.e..
Students need to learn the importance of ``from" in the concept of one-sided limits. If you look at limits ``to" the right and left, you are looking at something different, called
\textit{limits at infinity.}
\section{Limits at infinity (horizontal asymptotes)} \label{limatinf}
As we head off a graph \textit{to} the right, $x$ goes to infinity. To the left, $x$ goes to $-\infty$.
\begin{framed}
$\d \lim_{x \to \infty} f(x) = L$ means $f(x) \to L$ as $x$ increases without bound.
$\d \lim_{x \to -\infty} f(x) = L$ means $f(x) \to L$ as $x$ decreases without bound.
\end{framed}
When the $y$-values approach a limit as $x \to \pm \infty$, the graph has a horizontal asymptote. Limits at infinity and horizontal asymptotes are basically the same concept, so review the following examples from precalculus.
\textit{Examples.}\begin{enumerate}[(a)]
\item $\d y = \frac{3}{x^2+1}$.
The degree of the numerator is 0, and the degree of the denominator is 2. The horizontal asymptote is y = 0 (the $x$-axis). Try to remember ``big bottom goes to 0." Therefore $\d \lim_{x \to \infty} \frac{3}{x^2+1} = 0$. A table of values confirms this; the graph also.
\begin{tabular}{c|c|c|c|c|c|c|}
\hline
$x$ & 1 & 10 & 100 & 1000 & 10000 & \text{ to } $\infty$\\
\hline
$y$ & 1.5 & 0.029703 & 0.00029997 & 0.000003 & 0.00000003 &\text{ to }0\\
\hline
\end{tabular}
\vskip20pt
\begin{figure}[h!]
\centering
\includegraphics[width=3in]{205lecture24ha.pdf}
\caption{$y = \d \frac{3}{x^2+1}$}
\end{figure}
\item $\d y = \frac{3x - 3}{2x+2}$.
When the top and bottom have the same degree, the lead coefficients determine the horizontal asymptote. This function has $y = \d \frac32 $ as its horizontal asymptote. For rational functions, the asymptote goes both left and right, so here
$$\lim_{x \to \infty}\frac{3x - 3}{2x+2} =\frac32 \quad \text{ and } \quad \lim_{x \to - \infty} \frac{3x - 3}{2x+2} = \frac32,$$
as the graph demonstrates.
\begin{figure*}[h]
\centering
\includegraphics[width=3in]{205lecture24ha2.pdf}
\caption{$y=1.5$ asymptote}
\end{figure*}
\item $\d y = \frac{-x^2+4}{x+1}$.
The top is bigger, and there is no horizontal asymptote. In precalculus you learn to use division to find oblique asymptotes when the degree of the numerator is only 1 greater than the degree of the denominator, but the most we can say about limits in this case is
$$\lim_{x \to \infty} \frac{-x^2+4}{x+1} = -\infty \quad \text{ and } \quad \lim_{x \to -\infty} \frac{-x^2+4}{x+1} = \infty.$$
\begin{figure*}[h]
\centering
\includegraphics[width=3in]{205lecture24ha3.pdf}
\caption{no horizontal asymptote}
\end{figure*}
\end{enumerate}
The 3 examples above demonstrate the 3 possibilities for limits at infinity of rational functions, which are functions of the form $p/q$ where $p$ and $q$ are polynomials. Rational functions are the most common functions with asymptotes that you study. However, there are other interesting functions with horizontal asymptotes. Some of these other functions have a different horizontal asymptote to the left than to the right. My favorite one of these is the inverse tangent function, a.k.a. $f(x) = \arctan x$, whose graph is here:
\begin{figure*}[h]
\centering
\includegraphics[width=3in]{205lecture24ha4.pdf}
\caption{$y = \arctan x$}
\end{figure*}
$$\lim_{x \to \infty} \arctan x = \frac{\pi}{2} \qquad \text{and} \qquad \lim_{x \to -\infty} \arctan x = -\frac{\pi}{2}.$$
\section{Infinite limits (vertical asymptotes)}
You shouldn't be surprised, since we just reviewed horizontal asymptotes (h.a.s), that now you should review vertical asymptotes (v.a.s). For horizontal, $x \to \pm \infty$, and for vertical, $y \to \pm \infty$. Here is an example from trigonometry, $y = \tan x$, whose inverse we just talked about in the last section.
\begin{figure*}[here]
\centering
\includegraphics[width=3in]{205lecture25va.pdf}
\caption{$y = \tan x$}
\end{figure*}
$$\text{Here } \qquad \lim_{x \to \frac{\pi}{2}^-} \tan x = \infty \qquad \text{and} \qquad \lim_{x \to \frac{\pi}{2}^+} \tan x = -\infty.$$
The graph above has vertical asymptotes $x = \pi/2 + \pi k$ for $k = 0, \pm 1, \pm 2, ...,$ which are also the zeroes of $\cos x$. Note that $x = \frac{\pi}{2}$ is the equation of a vertical line, and you need to write the ``$x=$" part in your work for indicating v.a.s, as well as ``$y=$" when indicating h.a.s. Draw the vertical line $x = \pi/2 \approx 1.6$ on the graph above. Your eye should follow the graph up at $x = \pi/2$ from the left to get $\lim_{x \to \frac{\pi}{2}^-} \tan x = \infty$, and down from the right to get $ \lim_{x \to \frac{\pi}{2}^+} \tan x = -\infty.$ Since the one-sided limits are not equal, all we can say about the regular limit is $\lim_{x \to \frac{\pi}{2}} \tan x$ d.n.e..
Usually, when a function is a quotient, like a rational function or $\tan x = \frac{\sin x}{\cos x}$, the vertical asymptotes happen where the denominator is 0. I say ``usually", not always, because of examples like $f(x) = \frac{x-3}{x-3}$, where the bottom is 0 at $x=3$, but the graph has no vertical asymptote.
\begin{framed}
When the bottom goes to 0 and the top does not, you get an infinite limit, vertical asymptote.
\end{framed}
A more precise theorem than the framed statement is typically included in calculus textbooks, but I wrote it colloquially so it is easier to remember. It is the final piece of the flow chart for evaluating limits of elementary functions I will include later.
Technically it is correct to say ``does not exist" for all infinite limits, because $y \to \infty$ means $y$ does not approach a real number. However, it is best to indicate the sign if you can.
\textit{Examples.}\begin{enumerate}[(a)]
\item $\d y = \frac{3}{x^2+1}$.
There is no vertical asymptote, because the bottom is never 0 in the real numbers. This function has no infinite limits, which is different from saying ``no limits at infinity."
\item $\d y = \frac{3x - 3}{2x+2}$.
The vertical asymptote is $x = -1$, since for $x=-1$ the bottom is 0 and the top is not.
\begin{figure*}[here]
\centering
\includegraphics[width=3in]{205lecture24ha2.pdf}
\caption{$x=-1$ asymptote}
\end{figure*}
The infinite limits are $\d \lim_{x \to -1^-} \frac{3x - 3}{2x+2} = \infty$ and $\d \lim_{x \to -1^+} \frac{3x - 3}{2x+2} = -\infty$. You can get this by the graph, or by a table of values. I would say the quickest way to figure out a problem like this is to think of a table of values, and you can almost do it in your head. For the left limit as $x \to -1^-$, I imagine plugging in $-1.1$. The factored form $\frac{3(x - 1)}{2(x+1)}$ is clearly a negative divided by a negative which is positive, so we get positive infinity as the limit, $\d \lim_{x \to -1^-} \frac{3x - 3}{2x+2} = \infty$.
\vskip10pt
Recap: $\d \lim_{x \to -1^-} \frac{3x - 3}{2x+2} = \infty$.
Once I see that the bottom is 0 and the top \textit{isn't}, I know we are dealing with an infinite limit. The work I might show is
$$\frac{3x - 3}{2x+2} = \frac{3(x - 1)}{2(x+1)}. \text{ Think } \frac{3(-1.1 - 1)}{2(-1.1+1)}=\frac{(-)}{(-)}= + \Rightarrow \infty :)$$
Of course, it is not standard to have minus signs by themselves in a mathematical expression, but it makes sense here, because the sign is all you care about once you know it is an infinite limit.
For the right-hand limit $\d \lim_{x \to -1^+} \frac{3x - 3}{2x+2},$ think $ \d \frac{3(-0.9 - 1)}{2(-0.9+1)}=\frac{-}{+}= - \Rightarrow -\infty$, so
$\d \lim_{x \to -1^+} \frac{3x - 3}{2x+2} = -\infty$.
\end{enumerate}
\section{Trigonometric limits} \label{triglimits}
The most important trig function is $f(x) = \sin x$, and the most important aspect of $\sin x$ in terms of calculus is the cyclical nature of its derivatives. It's too soon to learn that the derivative of $\sin x$ is $\cos x$ (whoops, spoiler!), but we will need the following limits to prove it later.
\begin{framed}
\textbf{The two important trig limit facts:} $$ \lim_{\theta \to 0} \frac{\sin \theta}{\theta} = 1 \qquad \text{ and } \qquad \lim_{\theta \to 0} \frac{1 - \cos \theta}{\theta} = 0. \qquad (\theta \text{ in radians})$$
\end{framed}
These are facts I will not explain here. Understanding these limits requires a solid geometric understanding of the definition of the sine and cosine functions. A proof uses geometry and the Squeeze Theorem for limits. You should look up the proof if you are interested. Engineering and physics students use the sine enough to make it worthwhile, but business and life science students will probably be fine in their fields without it. Be careful with trigonometric limits, because somehow their nature allows students to trick themselves into thinking they understand when they actually do not. I think its the notation. Review things like $\sin^2 x$ means $(\sin x)^2$ which is NOT $\sin (x^2)$, and $\tan^{-1} x = \arctan x$ which is NOT $\cot x = \frac{1}{\tan x}$.
\vskip10pt
Example: $ \d \lim_{ x \to 0} \frac{ \sin 8x}{x}.$
Lucky Larry gets this limit right for the wrong reasons. Note that $\sin 8x$ means $\sin (8x)$, and the order of operations for evaluation are multiply by 8, then take the sine. That is totally different from taking the sine then multiplying by 8 (check $\sin(8\cdot 30^{\circ}) \neq 8 \sin(30^{\circ})$). You CANNOT ``factor out" an 8 from inside a function, especially the sine function. To evaluate the limit, you need to write something like the following:
\setcounter{equation}{0}
\begin{align}
\lim_{ x \to 0} \frac{ \sin 8x}{x} &= \lim_{x \to 0} \left( \frac{ \sin 8x}{x} \cdot \frac88 \right) \\
&= \lim_{ x \to 0} \frac{8 \sin 8x }{8x} \\
&= \lim_{u \to 0} \frac{ 8 \sin u}{u}\\
&= \lim_{u \to 0} \left( 8 \cdot \frac{\sin u}{u} \right)\\
&= 8 \left( \lim_{u \to 0} \frac{\sin u }{u} \right)\\
&= 8 \cdot 1 = 8.
\end{align}
You can convince me you understand this without writing quite as much as I did above, but I want to be clear about the rules. (1) is merely multiplying the given function by 1, which is a classic algebra technique. (2) is arithmetic; multiply the fractions and put the constants in front. (3) is a substitution, $u = 8x$, which emphasizes the form in the important trig limit fact that you will use. In the important trig limit fact $\d \lim_{\theta \to 0} \frac{\sin \theta}{\theta} = 1$, the angle inside the sine and the denominator must match exactly. Of course, $\theta$ is a dummy variable, and the fact is just as true if $\theta$ is a $u$ instead. That is how we got (6). The substitution in (3) is also tricky because you have to understand that if $x \to 0$, then $8x \to 0$ also. Note that (5) comes from the constant multiple limit law.
\section{Continuity}
The idea of a continuous function is pretty intuitive. A continuous function has no holes or breaks. You can draw it without lifting your pencil off the page. However, modern functions can be impossible to draw (google the Dirichlet function or Thomae's function), so the intuition breaks down sometimes. The mathematical definition of continuity is simple and clear.
\begin{framed}
\textbf{Definition.} A function $f(x)$ is \textit{continuous} at $x = c$ if $\d \lim_{x \to c} f(x) = f(c)$.
\end{framed}
Note that the equation in the definition is false if either $f(c)$ does not exist or the limit does not exist, so in those cases the function is not continuous at $c$. Pictures are valuable for the concept of continuity.
\begin{figure}[here]
\includegraphics[width=3in]{205lecture261.pdf}
\includegraphics[width=3in]{205lecture262.pdf}
\caption{Polynomials and sine waves are continuous at all $x$.}
\end{figure}
\begin{figure}[here]
\centering
\begin{tikzpicture}[scale=0.8]
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,5);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3);
\draw (-0.5,4)--(0.5,4) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,<->](-3,1) -> (5 , 1);
\filldraw[fill=white] (3,1) circle (3pt) node[anchor=south]{$(3,1)$};
\end{tikzpicture}
\caption{Here $f(3)$ is undefined, so $f$ is not continuous at $x=3$.}
\end{figure}
\begin{figure}[here]
\centering
\begin{tikzpicture}[scale=0.8]
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,5);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3);
\draw (-0.5,4)--(0.5,4) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,<->](-3,1) -> (5 , 1);
\filldraw[fill=white] (3,1) circle (3pt) node[anchor=south]{$(3,1)$};
\filldraw (3,2) circle (3pt);
\end{tikzpicture}
\caption{Here, $f(3) = 2 \neq 1 = \d \lim_{x\to3} f(x)$, so $f$ is not continuous at $x=3$.}
\end{figure}
\newpage
\begin{figure}[here!]
\centering
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,4);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,->](3,0) -> (5 , 2);
\draw[ultra thick,->](3,-1) .. controls (3,1) and (-2,1) .. (-3 , 1);
\filldraw(3,0) circle (3pt) node[anchor=south]{$$};
\filldraw[fill=white] (3,-1) circle (3pt) node[anchor=north]{$(3,-1)$};
\end{tikzpicture}
\caption{Here $\d \lim_{x \to 3} f(x)$ d.n.e. (the one-sided limits are not equal), so $f$ is not continuous at 3.}
\end{figure}
\vskip10pt
For the most part, STEM majors will be dealing with everywhere-continuous functions, or at least functions that are continuous on their domains. Continuity becomes increasingly important in math classes beyond Calc 1, because it plays a big role in the theoretical framework of calculus and the real numbers. However, all of the basic functions you learn about in precalculus are continuous on their domains, except piecewise functions, which are specifically designed to explore the concept of continuity. Rational functions are not continuous at vertical asymptotes, and radicals like $\sqrt x$ are continuous at every point interior to their domain and have one-sided continuity at points on the boundary of their domain. When I say ``if you can plug in, do it" when evaluating a limit, it is because the functions involved are continuous. In fact, that is exactly what continuity tells us, i.e., it tells us when you can plug in to find a limit. Once again, by definition, $f$ is continuous at $x=c$ if $\d \lim_{x \to c}f(x) = f(c)$.
When you replace regular limits with one-sided limits in the definition of continuity, you get \textit{one-sided continuity.}
\begin{figure}[here!]
\centering
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,4);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick,->](3,0) -> (5 , 2);
\draw[ultra thick,->](3,-1) .. controls (3,1) and (-2,1) .. (-3 , 1);
\filldraw(3,0) circle (3pt) node[anchor=south]{$$};
\filldraw[fill=white] (3,-1) circle (3pt) node[anchor=north]{$(3,-1)$};
\end{tikzpicture}
\caption{Here $f$ is continuous from the right at 3.}
\end{figure}
In the figure above, $\d \lim_{x \to 3^-} f(x) = -1$ and $\d \lim_{x \to 3^+}f(x) = 0$. Note that $f(3) =0$. Therefore, $\d \lim_{x \to 3^+}f(x) = f(3)$, meaning $f(x)$ is \textit{continuous from the right} at $x=3$. Since $-1 \neq 0$, we know $\d \lim_{x \to 3^-} f(x) \neq f(3)$, so $f$ is \textbf{not} continuous from the left at $x=3$. The only discontinuity is at $x = 3$, so we can list intervals where $f$ is continuous. We write ``$f$ is continuous on $(-\infty, 3)$ and on $[3, \infty)$." Note the bracket vs parenthesis. Writing ``$f$ is continuous on $[3, \infty)$" does not mean that $f$ is continuous at 3. This confuses students, because 3 is in that interval. We do this because we want to indicate one-sided continuity, and the notation is convenient. When we write ``$f$ is continuous on $[a,b]$," we do not mean \textit{at} $a$ or \text{at} $b.$ Rather, we mean that $f$ is continuous at every point in the open interval $(a,b)$, $f$ is continuous from the left at $b$, and $f$ is continuous from the right at $a$.
\section{The Derivative at a Point} \label{dpoint}
Finally, we get to the main reason we learned about limits in the first place. This brings us full circle, so look back at section \ref{intro} before reading this.
\begin{framed}
\textbf{Definition:} The \textit{derivative} of a function $f(x)$ at $x = x_0$ is denoted $f'(x_0)$ and defined by the limit
$$\d \lim_{h \to 0} \frac{f(x_0+h)-f(x_0)}{h} = f'(x_0).$$
\end{framed}
Once again, if you only remember one thing from this class, it should be that \textit{the derivative is the slope of the tangent line to a curve at a point.} The idea is that the tangent line slope is a limit of secant line slopes. This section focuses on using the definition of the derivative to find tangent lines. Now that we are good at evaluating limits, we can do this more easily than we did in section \ref{intro}. In the next chapter, we are going to learn rules that make it easier still (yay!). Students who have taken calculus before probably remember that the derivative of $x^3$ is $3x^2$ (and the easy trick to deduce that, called the ``power rule"), but right now we are calculating derivatives from first principles, i.e., the definition.
\textit{Example.} Find the derivative of $f(x) = x^2+x$ at $x_0 = 1$.
Note that this example could have said ``find the slope of the tangent to $y = x^2+x$ at $x_0 = 1$," which means the same thing. We simply plug everything in to the definition. Evaluating these derivatives is one of the main goals for which precalculus classes are preparing you, so you need to rely heavily on algebra and function notation skills, in addition to your newly learned understanding of limits. We get
\setcounter{equation}{0}
\begin{align}
f'(x_0) &= \lim_{h \to 0} \frac{f(x_0+h)-f(x_0)}{h} \\
&= \lim_{h \to 0} \frac{f(1+h)-f(1)}{h} \\
&= \lim_{h \to 0} \frac{ (1+h)^2 + (1+h) - (1^2+1)}{h}\\
&= \lim_{h \to 0} \frac{ 1+2h+h^2 + 1 + h - 2}{h}\\
&= \lim_{h \to 0} \frac{ 3h + h^2}{h}\\
&= \lim_{h \to 0} \frac{ h (3+h)}{h}\\
&= \lim_{h \to 0} (3+h)\\
&= 3+0
= 3.
\end{align}
In the above display, (2) comes from plugging in the given $x_0$. Use function notation for the given function to get (3), which may be the hardest step for students who are not strong in precalculus. (4)-(6) are from elementary algebra (FOIL out $(1+h)^2 = (1+h)(1+h)$ so you do not fall for the Freshman's Dream!), and (7) is where we need limit notation to emphasize $h \to 0$ but $h \neq 0$. (8) is evaluating the limit; hence the limit notation goes away, and the answer is 3.
\begin{figure}[here]
\centering
\includegraphics[width=4in]{lecture27tangent.pdf}
\caption{$y = x^2 + x$ and its tangent line at $x_0 = 1$}
\end{figure}
The graph shows the tangent line, and you can see that the slope is 3. The equation of the tangent line in point slope form is
$$y - 2 = 3(x-1).$$ 3 is the slope, the 1 comes from $x_0$ and the 2 comes from the given function $f$, since $f(1) = 1^2 + 1 = 2$.
\section{The Derivative as a Function} \label{dfunction}
All we do in this section is replace the fixed number $x_0$ in section \ref{dpoint} by the variable $x$. It seems simple, but it is such a key step toward our goals that we devote an entire section to it.
\begin{framed}
\textbf{Definition:} The \textit{derivative} of a function $f(x)$ is another function, and is denoted $f'(x)$ and defined by the limit
$$\d \lim_{h \to 0} \frac{f(x+h)-f(x)}{h} = f'(x),$$
provided the limit exists.
\end{framed}
\textit{Example} $f(x) = -x^2$. Find $f'(x)$ and $f'(1), f'(2), f'(-2), f'(-0.5), f'(0), f'(\pi), f'(e),$ and $f'(3.14)$.
\vskip10pt
The silly list of $f'$ values is just to scare students away from plugging in numbers too early. In section \ref{dpoint} we plugged in $x_0$ whenever we wanted, but from now on we won't do it until the very end. It emphasizes that $f'$ is a function of $x$. Once you calculate $f'(x)$, you can find the slope of the tangent line at loads of different points just by plugging into the formula for $f'$. Other than that, the calculations are exactly the same as in section \ref{dpoint}. We once again reinforce our algebra and precalculus skills by working out
\setcounter{equation}{0}
\begin{align}
f'(x) &= \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}\\
&= \lim_{h \to 0} \frac{-(x+h)^2 - (-x^2)}{h}\\
&= \lim_{h \to 0} \frac{ -(x^2+2xh+h^2) + x^2}{h}\\
&= \lim_{h \to 0} \frac{ -2xh-h^2}{h}\\
&= \lim_{h \to 0} \frac{ h(-2x-h)}{h}\\
&= \lim_{h \to 0} (-2x-h) \\
&= -2x-0 = -2x.
\end{align}
So $f(x) = -2x$. So $f'(1) = -2$, $f'(2)=-4$, $f'(-2) = 4$, $f'(-0.5)=1$, $f'(0) = 0$, $f'(\pi) = -2\pi$, $f'(e) = -2e$, and $f'(3.14) = -6.28$.
Below is a graph of $f$ and all the tangent lines whose slopes we just calculated.
\includegraphics[width=7in]{205lecture31wformulas.pdf}
\vskip20pt
Suppose we wanted to graph $y = f'(x)$. First off, don't get $y = f(x)$ confused with $y = f'(x)$, because it's not the same $y$. We will practice sketching $f'$ based on the graph of $f$ without even knowing the formula for $f$. The key is that \textit{the slopes of $f$ are the $y$-values of $f'$.} You have to be able to judge a lines slope just by ``eyeballing" it. Steep decreasing slopes are negative numbers less than $-1$, shallow decreasing slopes are between $-1$ and 0, horizontal slopes are 0, and increasing slopes are positive. When we talk about decreasing and increasing, we always \textbf{read the graph left to right.} Look at the graph of $f$ below, and try to plot the slopes as $y$-values at each $x$, thereby graphing $f'$. (Don't look at the next page until you have tried to sketch $f'$.)
\begin{tikzpicture}[scale=0.7]
\draw (-5,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-3)--(0,5) node[anchor=west]{$y$};
\draw[ultra thick] (-5,5) -- (-2,2)--(0,2);
\draw[ultra thick] (0,2) .. controls(1,4) and (2,5) .. (2.5,5);
\draw[ultra thick] (2.5,5) .. controls (4,5) and (4,2) .. (5,2);
\end{tikzpicture}
\newpage
What we want to do is sketch little tangent lines on the graph of $f$, and then plot the slopes as $y$-values for $f'$. The function $f$ graphed above is decreasing at first, then constant, then becomes curved. The tangent line to a line is the line, so for the straight parts of $f$ the $y$-values of $f'$ are constant, and $f'$ is a flat line. Note the discontinuities of $f'$ at the $x$-coordinates where $f$ has a corner. The derivative is always undefined at a corner of the function. For the curved part, it is hard to graph $f'$ accurately, but we plot some slope values and then connect the dots.
\begin{figure}[here!]
\centering
\begin{tikzpicture}[scale=0.7]
\draw (-5,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-3)--(0,5) node[anchor=west]{$y$};
\draw[ultra thick] (-5,5) -- (-2,2)--(0,2);
\draw[ultra thick] (0,2) .. controls(1,4) and (2,5) .. (2.5,5);
\draw[ultra thick] (2.5,5) .. controls (4,5) and (4,2) .. (5,2);
\draw[red] (0.5,3.2) -- (1.5,4.5);
\draw[red] (1.5,5) -- (3.5,5);
\draw[red] (3.4,4.8) -- (4.2,3.2);
\draw[red] (4,2.2) -- (5.3,1.8);
\end{tikzpicture}
\caption{slopes (on the graph of $f$)}
\end{figure}
\begin{figure}[here!]
\centering
\begin{tikzpicture}[scale=0.7]
\draw (-5,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-5)--(0,5) node[anchor=west]{$y$};
\draw[ultra thick] (-5,-2) -- (-2,-2);
\draw[ultra thick] (-2,-0) -- (0,0);
\draw[ultra thick] (0,2) .. controls (1,3.5) and (2.5,-2) .. (4,-2);
\draw[ultra thick] (4,-2) .. controls (5,-2) and (4.9,-1) .. (5, -0.5);
\filldraw[fill=white] (-2,-2) circle (3pt);
\filldraw[fill=white] (-2,0) circle (3pt);
\filldraw[fill=white] (-0,0) circle (3pt);
\filldraw[fill=white] (-0,2) circle (3pt);
\filldraw[red] (0.8,2) circle (3pt);
\filldraw[red] (2.2,0) circle (3pt);
\filldraw[red] (3.4,-1.7) circle (3pt);
\filldraw[red] (4.9,-0.6) circle (3pt);
\end{tikzpicture}
\caption{$y$-values (on the graph of $f'$)}
\label{fprime}
\end{figure}
Is the graph in figure \ref{fprime} what you expected when you tried to graph $f'$ on the previous page? If not, try again without looking;)
\newpage
\section{Differentiation Rules} \label{drules}
Ok, so we know the definition of the derivative by heart and are good at finding limits of difference quotients, i.e., derivatives. Still, the limit and difference quotient take a lot of time to work out for each function, and once we have done it many times we start to see patterns. Crazily, the patterns are very strong, and it does not take too much effort to write down some rules that will make \textit{differentiation} (the process of taking the derivative) waaaaay easier. The differentiation operator is denoted $\d \frac{d}{dx}$, and $\d \frac{d}{dx}f(x) = f'(x)$. We will use both notations (the prime and the $ \frac{d}{dx}$) frequently from now on. Why both? One reason is that a little $'$ is not emphatic enough sometimes. Another reason is that $ \frac{d}{dx}$ has the advantage of making the variable $x$ obvious, and there are even other reasons that we will see as we go on (there is a reason the differentiation operator looks like a fraction). For example, if $f(x) = x$, then $f'(x) = 1$. However, we never write $x' = 1$. (Never!) The prime is only for functions, and sometimes we want a variable besides $x$. Instead, we write $\d \frac{d}{dx} x = 1.$ Here, the $x$ is a \textit{dummy variable}, so we could also write $\d \frac{d}{dy} y = 1$, $\d \frac{d}{du} u = 1$, $\d \frac{d}{d\theta} \theta = 1$, or even
\includegraphics[width=1in]{princed.pdf}. Believe it or not, the concept of dummy variables is important, and we will see it a lot. Note that the variable in the differentiation operator might not be same as the variable in the expression that follows, in which case you have to worry about whether the expression is a constant or a nonconstant function. The derivative of a constant is 0, and the derivative of a function depends, of course, on the function. The following rules come from the definition of the derivative, and we tend to memorize these. If we ever forget the rules or run into something new, we go back to the definition (boxed in lecture 3.1).
\begin{framed}
\textbf{Differentiation Rules} Here $f$ and $g$ are differentiable functions (i.e., their derivatives exist) of $x$.
$\d \frac{d}{dx} c = 0. \qquad \text{ The derivative of a constant is 0.}$
\vskip5pt
$\d \frac{d}{dx} (mx + b) = m. \qquad \text{ The derivative of a line is its slope.}$
\vskip5pt
$\d \frac{d}{dx} \left[cf(x))\right] = c \frac{d}{dx} f(x) = cf'(x). \qquad \text{ This is the Constant Multiple Rule.}$
\vskip5pt
$\d \frac{d}{dx} x^n = nx^{n-1}; \qquad \text{ the Power Rule (everyone's favorite).}$
\vskip5pt
$\d \frac{d}{dx} \left[ f(x)+ g(x)\right] = \frac{d}{dx}f(x) + \frac{d}{dx}g(x) = f'(x) + g'(x); \qquad \text{ the Sum Rule.}$
\vskip5pt
$\d \frac{d}{dx} \left[f(x)g(x)\right] = f'(x)g(x) + g'(x)f(x); \qquad \text{ the Product Rule.}$
\vskip5pt
$\d \frac{d}{dx} \left[ \frac{f(x)}{g(x)} \right] = \frac{f'(x)g(x) - g'(x)f(x)}{g^2(x)}; \qquad \text{ the Quotient Rule.}$
\vskip5pt
$\d \frac{d}{dx} (f\circ g)(x) = \frac{d}{dx} \left[f(g(x)) \right] = f'(g(x))g'(x); \qquad \text{ the Chain Rule.}$
\end{framed}
Note that the second rule supersedes the first, because constant functions are just lines with slope 0. Combining the Constant Multiple Rule for $c = -1$ with the Sum Rule gives the Difference Rule $\frac{d}{dx}[f(x) - g(x)] = f'(x) - g'(x)$. Note that the Product Rule and Quotient Rule are far from obvious, as they are not the natural thing for a newbie to expect. Review function composition from precalculus before you try to learn the Chain Rule. The main goal of this chapter is to be able to differentiate any function you can write down. You will become fluent in the language of differentiation, and these rules are the grammar.
\vskip20pt
Examples: To gain learning from these examples, you need to work them all out on your own. Try to do each one before looking at the answer. You may need to fill in steps or check the algebra with scratch work, so go get a pencil and paper before you read what follows!
\textit{Differentiate the given functions.}
\begin{enumerate}
\item $s(t) = t^9 - 8t^2+t-70$
Finding the derivative of a polynomial is amazingly easy because of the Power Rule (the Power Rule is powerful!). Students will be able to jump straight to the answer with practice, but here I will show some work to point out the rules we use.
\begin{align*} s'(t) &= \frac{d}{dt} ( t^9 - 8t^2+t-70) \\
&= \frac{d}{dt}t^9 - \frac{d}{dt}8t^2+\frac{d}{dt}t-\frac{d}{dt}70 \qquad &\text{ (Sum/Diff. Rules)}\\
&= \frac{d}{dt}t^9 - 8\frac{d}{dt}t^2+\frac{d}{dt}t-\frac{d}{dt}70 \qquad &\text{ (Const. Mult. Rule)}\\
&= 9t^8 - 8(2t) + 2(1) - 0 \qquad &\text{ (Power Rule)}\\
&= 9t^8 - 16t + 2. &\\
\end{align*}
\newline
\item $\d f(t) = \sqrt t - \frac{1}{\sqrt[3] t}$
Even more amazing than its simplicity, the Power Rule works for fractional and negative exponents! You will appreciate this more if you did several calculations of derivatives of rational and radical functions using the definition in section \ref{dfunction}. Review the algebra rules for exponents, and be very comfortable with the facts $x^{1/n} = \sqrt[n] x$ and $x^{-n} = \frac{1}{x^n}$. First rewrite $f$ using these rules.
$$\sqrt t - \frac{1}{\sqrt[3] t} = t^{1/2} - \frac{1}{t^{1/3}} = t^{1/2} - t^{-1/3}.$$
Then
\begin{align*}
f'(t) &= \frac{d}{dt} \left( t^{1/2} - t^{-1/3} \right) \quad &\text{ (We rewrote $f$.)}\\
& = (1/2)t^{-1/2} - (-1/3)t^{-4/3} \quad &\text{ (Bring the powers down and subtract 1 per the Power Rule.)}\\
&= \frac12 \cdot \frac{1}{t^{1/2}} + \frac13 \cdot \frac{1}{t^{4/3}}\quad &\text{ (We use algebra rules for exponents.)}\\
&= \frac{1}{2\sqrt t} + \frac{1}{3\sqrt[3] t^4}.&\\
\end{align*}
\item $y = \d \frac{5}{x^2}$.
Rewrite as $y = 5x^{-2}$. Then
$$\frac{dy}{dx} =
5(-2)x^{-3}
= \frac{-10}{x^3}.$$
\newline
\item $\d f(x) = \frac{x}{2x+1}$
Use the Quotient Rule. We get
\begin{align*}
f'(x) &= \frac{\left[\frac{d}{dx}(x) \right](2x+1) - \left[\frac{d}{dx}(2x+1) \right](x)}{(2x+1)^2}\\
&= \frac{(1)(2x+1)-(2)(x)}{(2x+1)^2}\\
&= \frac{1}{(2x+1)^2}.
\end{align*}
\item $\d s = \sqrt t (t^3 + 1)$.
We use the Product Rule. I only show the first step and the answer here, so work out the algebra on your own! (Ask for help if you get stuck.) The derivative is
$\d \frac{ds}{dt} = (1/2)t^{-1/2}(t^3 + 1) + t^{1/2}(3t^2 +0
) = \frac{t^3+1}{2t^{1/2}} + 3t^{5/2}.$
Personally I don't care whether you write the final answer with $\sqrt{\, } $ symbols or not. Note that you could distribute the $\sqrt t$ to simplify $s$ before differentiating, which obviates the need for the Product Rule, and gives you the same answer. Wow!
\end{enumerate}
\section{Rates of Change}
If you only remember one thing from this class, it should be that ``the derivative is the slope of the tangent line," \textit {or} ``the derivative is the instantaneous rate of change." In fact, they are two different ways to say the same thing.
\begin{framed}
For a function $s(t)$ of time, the \textit{average rate of change} on the interval $a \leq t \leq b$ is
$$\frac{\Delta s}{\Delta t} = \frac{s(b) - s(a)}{b-a}.$$
The \textit{instantaneous rate of change} of $s$ at time $t$ is $s'(t)$.
\end{framed}
The average rate of change is exactly the same as the slope of the line through $(x,y) = (a,s(a))$ and $(b,s(b))$. Note how all the notation is starting to fit together (thanks to Leibniz), because
$$s'(t) = \frac{ds}{dt} = \lim_{\Delta t \to 0} \frac{\Delta s}{\Delta t}.$$
A derivative is a limit of an average rate of change. It makes sense that if you calculate average rate of change on an infinitesimally small interval ($\Delta t \to 0$) you get instantaneous change. That's pretty much why calculus was discovered. It allows the concepts of \textit{velocity} and \textit{acceleration} from physics to be put in a nice mathematical language, and the math teaches us new things about physics. Calculus applies to every field of modern science however, so we talk about ``rates of change" rather than just velocity. Most of applied math involves \textit{differential equations}, which are equations that relate quantities and their rates of change (a.k.a. derivatives). Chemical reaction rates, population growth, and marginal profit are examples from chemistry, biology, and finance that are commonly studied and explained with calculus. I would love to start working through some major applications right now, but most of the ones I can think of involve understanding the derivative of the exponential function $y = e^x$. Such courses would be ``early transcendentals" courses, which are not this course. We have good reasons to do it our way, but life science and economics majors might consider special calculus courses for their interests (M\=anoa has MATH 215 for bio majors and 203 for econ). Our course is geared toward covering \textit{everyone's} needs, so we can't skip over the physics and engineering majors, who need the most technical detail. The bio folks who mainly need the exponential function will be appeased finally in calc 2 at KCC.
\vskip20pt
Example: Galileo throws rocks off of the leaning tower of Pisa and measures their fall over time. If $s(t)$ is the height in feet of a rock after $t$ seconds, he figured out that $$s(t) = -16t^2 + v_0 t + s_0.$$
This is the equation of a free-falling object near Earth's surface. The velocity $v = s'$ is the derivative of position (or displacement) and $a = v' = s''$ is the acceleration. Note that $v_0 = v(0)$, a constant representing the \textit{initial velocity}, and $s_0 = s(0)$ is the \textit{initial position.} We can use the rules from section 3.2 to easily find
$$v(t) = -32 t + v_0$$
and $a(t) = -32$. The acceleration of Galileo's rocks due to gravity is constant. Newton used calculus to explain his Laws of Motion and Law of Universal Gravitation, which was one of the greatest scientific achievements of humankind.
Spoiler alert:
Bio folks, what you will need the most in your field is solutions to differential equations like $y' = ky$, for some constant $k$, which says the rate of change of $y$ is proportional to its size. If $y$ is the number of organisms in a population, then this is a reasonable model for unrestricted population growth (no predators, disease, or lack of food). The solution to this differential equation is $y=e^{kt}$, where $t$ is time and $e$ is the transcental number $e \approx 2.7$. In Calc 2 you will learn that $y = e^x$ is its own derivative (woah!) which is what gives \textit{exponential growth} in this situation. Throw in predators or disease and the differential equation changes, and so does the population function. We learn calculus in hopes to solve any differential equation that arises in the science that we love, allowing us to analyze data and give a sound logical basis for our hypotheses.
\section{Trigonometric Derivatives}
In this section we harvest the fruit from the seeds that were planted in section \ref{triglimits}. Mixing trigonometry and calculus can actually be quite nice, and the nicest fact is that $\frac{d}{dx} \sin x = \cos x$. Here is a proof of the fact, using the definition of the derivative:
\setcounter{equation}{0}
\begin{align}
\frac{d}{dx} \sin x &= \lim_{h \to 0} \frac{ \sin (x+h) - \sin x}{h} \\
&= \lim_{h \to 0} \frac{ \sin x \cos h + \sin h \cos x - \sin x}{h}\\
&= \lim_{h \to 0} \frac{ \sin x \cos h - \sin x+ \sin h \cos x}{h}\\
&= \lim_{h \to 0}\left( \frac{ \sin x \cos h - \sin x}{h}+ \frac{\sin h \cos x}{h}\right)\\
&= \lim_{h \to 0} \frac{ \sin x \cos h - \sin x}{h}+ \lim_{h \to 0} \frac{\sin h \cos x}{h}\\
&= \lim_{h \to 0} \frac{ \sin x (\cos h - 1)}{h}+ \lim_{h \to 0} \frac{\sin h }{h}(\cos x)\\
&= (\sin x) \lim_{h \to 0} \frac{(\cos h - 1)}{h}+(\cos x) \lim_{h \to 0} \frac{\sin h }{h}\\
&= (\sin x) (0) + (\cos x) (1) \\
&= \cos x.
\end{align}
Line (1) is the definition of the derivative, and line (2) comes from the trig identity for summed angles. Lines (3)-(4) come from simple algebra. Line (5) comes from the sum law for limits. Line (6) is simple factoring. Line (7) is the constant multiple rule for limits; note that $h$ is the variable in the limit so $x$ is constant. Line (8) is the trig limits from section \ref{triglimits}.
We just gave the analytic proof that $\frac{d}{dx} \sin x = \cos x$. The geometry behind it is beautiful, since the slopes of a sine wave make another sine wave (a cosine graph is just a shift of a sine graph).
\begin{tikzpicture}
\draw (-5,0) -- (5,0) node[anchor=west]{\textcolor{red}{slopes of $f$}};
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)node[anchor=north]{$\pi$}--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5);
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5) --(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5);
\draw (0,-2) -- (0,2);
\draw (-0.5,1) node[anchor=east]{1}--(0.5,1);
\draw (-0.5,-1)--(0.5,-1);
\draw[ultra thick](-5,-1)cos(-4,0) sin(-3,1) node [anchor=south]{$$} cos (-2,0) sin (-1,-1) cos (0,0) sin (1,1) cos (2,0) sin(3,-1) cos (4,0) sin (5,1);
\draw[ultra thick,red] (-0.35,-0.5)--(0.35,0.5);
\draw[ultra thick,red] (0.5,1)--(1.5,1);
\draw[ultra thick,red] (1.65,0.5)--(2.35,-0.5);
\draw[ultra thick,red] (2.5,-1)--(3.5,-1);
\end{tikzpicture}
\begin{tikzpicture}
\draw (-5,0) -- (5,0) node[anchor=west]{\textcolor{red}{$y$-values of $f'$}};
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)node[anchor=north]{$\pi$}--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5);
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5);
\draw (0,-2) -- (0,2);
\draw (-0.5,1) node[anchor=east]{1}--(0.5,1);
\draw (-0.5,-1)--(0.5,-1);
\draw[ultra thick](-5,0) sin(-4,1) node [anchor=south]{$$} cos (-3,0) sin (-2,-1) cos (-1,0) sin (0,1) cos (1,0) sin(2,-1) cos (3,0) sin (4,1) cos (5,0);
\filldraw[red] (0,1) circle (3pt);
\filldraw[red] (1,0) circle (3pt);
\filldraw[red] (2,-1) circle (3pt);
\filldraw[red] (3,0) circle (3pt);
\end{tikzpicture}
Although the $x$ and $y$ axis are not quite to scale in the diagram above (which affects slope), it looks indeed like $f'(x) = \cos x$ is the derivative of $f(x) =\sin x$. From this, you can understand that $\frac{d}{dx}\cos x = -\sin x.$ Check that the fourth derivative of $\sin x$ is $\sin x$. Nice, right? This repetitive (periodic) behavior of trig functions under differentiation makes them useful in solving differential equations, so even bio folks like to know that $\frac{d}{dx} \sin x = \cos x$. In fact, with Euler's formula $e^{i\theta} = \cos \theta + i \sin \theta$, we see a connection between trig and the most important function in biology, $f(x) = e^x$ (actually the most important function in pretty much everything). The other trig functions' derivatives are easy to derive from the sine and cosine. For example,
\begin{align}
\frac{d}{dx} \tan x &= \frac{d}{dx} \frac{\sin x}{\cos x} \\
&= \frac{ \left( \frac{d}{dx} \sin x \right) \cos x - \left( \frac{d}{dx} \cos x \right) \sin x}{\cos^2 x}\\
&= \frac{ \left( \cos x \right) \cos x - \left( - \sin x \right) \sin x}{\cos^2 x}\\
&= \frac{ \cos^2 x + \sin^2 x}{\cos^2 x}\\
&= \frac{1}{\cos^2 x} = \sec^2x.
\end{align}
Line (11) is the quotient rule, and (14) comes from the Pythagorean trig identity. You should derive the rest of these for practice:
\begin{align*}
\frac{d}{dx} \sin x &= \cos x & \frac{d}{dx} \cos x &= -\sin x\\
\frac{d}{dx} \tan x &= \sec^2 x &\frac{d}{dx} \cot x &= -\csc^2 x\\
\frac{d}{dx} \sec x &= \sec x \tan x&\frac{d}{dx} \csc x &= -\csc x \cot x
\end{align*}
\section{The Chain Rule}
The Chain Rule is listed in section \ref{drules}, but here we will go into more detail and examples. It tends to be something students don't understand, so there are lots of cute applications people have thought up. Gears of different sizes turning each other, Americans driving cars
in Canada (so they have to convert to km) and party balloons all involve situations where the chain rule can be experienced in real life. However, most students are still wrapping their heads around derivatives as rates of change, so most people learn the computational aspect of the chain rule before they understand the applications.
Review \textit{function composition} from precalculus. When one function is composed with another, it gets ``plugged into" the other. I.e., $(f\circ g)(x) = f(g(x)).$ The little $\circ$ indicates composition, and we say ``$f$ composed with $g$" or ``$f$ of $g$ of $x$".
\begin{framed}
\textbf{The Chain Rule}
If $y = f(u)$ and $u = g(x)$ are differentiable functions, then
\vskip10pt
$\d \frac{d}{dx} f(g(x)) = f'(g(x))\cdot g'(x)\qquad \text{ and } \qquad \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}.$
\end{framed}
Leibniz's differential notation works extremely well upon consideration of the chain rule (it's sort of like the $du$s cancel; wow!). In practice, students might get stumped by the notation, but there is a decent way to describe the chain rule in our vernacular: \textit{Take the derivative of the outside, leaving the inside alone, then multiply by the derivative of the inside.}
\vskip20pt
Examples.
$\d \frac{d}{dx} (x^2)^5 = 5(x^2)^4 \cdot (2x) = 10x^9.$
\vskip10pt
$\d \frac{d}{dx} \sin (3x) = \cos (3x) \cdot 3 = 3 \cos 3x.$
\vskip10pt
$\d
\frac{d}{dx} \sqrt{\tan^4(x^7)} = \frac12 \left(\tan^4(x^7)\right)^{-1/2} \cdot (4 \tan^3(x^7)) \cdot (\sec^2(x^7)) \cdot 7x^6 $\\
$\hspace{1in} = 14x^6\tan(x^7)\sec^2(x^7).$
\vskip10pt
The first example above is evidence that the Chain Rule works. Note that $(x^2)^5 = x^{10}$, so if we simplify first we can use the Power Rule. When there are parentheses in a function's formula, the chain rule comes into play. Students who start using the Chain Rule sometimes don't know ``when to stop" differentiating. The number of parentheses indicates the number of factors in the result. Note that in the last example, there are 3 sets of parentheses because two are hidden: $\left(\tan^4(x^7)\right)^{1/2} = \left( \left(\tan(x^7)\right)^4\right)^{1/2}$. The number of pairs of parentheses in the function is the number of multiplication dots in the derivative (before simplifying) per the Chain Rule. We could have simplified the last example before differentiating, since $\left( \left(\tan(x^7)\right)^4\right)^{1/2} = \tan^2(x^7)$.
Just in case you want a deeper understanding of the chain rule, the following is an analytic argument for it. Assume $g$ is differentiable (hence continuous) but not constant near $a$, and use the (alternate) definition of the derivative.
\begin{align*}
\frac{d}{da} f(g(a)) &= \lim_{x \to a} \frac{f(g(x)) - f(g(a))}{x-a}\\
&= \lim_{x \to a} \frac{f(g(x)) - f(g(a))}{x-a}\cdot \frac{g(x)-g(a)}{g(x)-g(a)}\\
&= \lim_{g(x) \to g(a)} \frac{f(g(x)) - f(g(a))}{g(x) - g(a)} \cdot \lim_{x \to a} \frac{g(x) - g(a)}{x-a} \\
&= f'(g(a)) \cdot g'(a),
\end{align*}
provided the limits exist.
\section{Implicit Differentiation}
In precalculus we learn that a set of points is a \textit{relation}, and a \text{function} is a relation that passes the vertical line test (v.l.t.). For example, the points $(x,y)$ that satisfy $x^2 + y^2 = 1$ are a relation that fails the v.l.t.. It turns out that there is a nice way to find slopes $\frac{dy}{dx}$ to this relation anyway. We have only defined differentiation for functions, so to extend our definition to relations that are not functions, we carefully examine small neighborhoods on a graph, where (hopefully) the relation passes the v.l.t. and defines a function \textit{implicitly}. I won't go into the technicalities of the vocabulary and worry about implicit vs. explicit here. It suffices to say you need the Chain Rule, and things work out neatly.
\begin{framed}
\textbf{Implicit Differentiation}
\vskip5pt
Differentiate both sides of the equation with respect to $x$, treating $y$ as a differentiable function of $x$. From the Chain Rule, a factor of $\d \frac{dy}{dx}$ appears in every expression with $y$ in it.
\end{framed}
Example: $x^2 + y^2 = 1$. The graph of this relation is the unit circle. We will find its slope at any point $(x,y)$ using implicit differentiation.
\setcounter{equation}{0}
\begin{align}
x^2 + y^2 &= 1\\
\frac{d}{dx} (x^2+y^2) &= \frac{d}{dx} 1\\
\frac{d}{dx}x^2 + \frac{d}{dx} y^2 &= 0\\
2x + 2y \cdot\frac{dy}{dx} &= 0\\
2y \frac{dy}{dx} &= -2x\\
\frac{dy}{dx} &= \frac{-2x}{2y} \\
\frac{dy}{dx} &= \frac{-x}{y}
\end{align}
The most difficult step for most students to grasp is (4). Since $y^2$ is a composite function, we need the Chain Rule. However, we don't need it for $x^2$, although technically writing $\d 2x \frac{dx}{dx}$ as the first term in (4) is correct (but silly because $\frac{dx}{dx} = 1$). In $y^2$, the outside function is the squaring function, and the inside function is $y$. The cool outcome is that $\d \frac{dy}{dx} = \frac{-x}{y}$ gives us the slope at any point on the unit circle.
\begin{tikzpicture}[scale=2]
\draw (-2,0) -- (2,0) node[anchor=south]{$x$};
\draw (0,-2) node[anchor=west]{\textcolor{red}{slopes $\frac{dy}{dx} = -\frac{x}{y}$}}-- (0,2) node[anchor=west]{$y$};
\draw (1,0) arc (360:0:1);
\filldraw (0.7,0.7) circle (1pt) node[anchor=south west]{$\left( \frac{\sqrt 2}{2}, \frac{\sqrt 2}{2} \right)$};
\filldraw (-1,0) circle (1pt) node[anchor=south west]{$(-1,0)$};
\draw[red] (0.4,1) -- (1,0.4);
\draw[red] (-1,-0.5) -- (-1,0.5);
\end{tikzpicture}
The slope at $(x,y) = \left( \frac{\sqrt 2}{2}, \frac{\sqrt 2}{2} \right)$ is $\d \frac{dy}{dx} = \frac{-x}{y} = -\frac{\frac{\sqrt2}{2}}{\frac{\sqrt2}{2}} = -1$, which is obvious in the picture. Wow! And at $(-1,0)$ the slope $\d \frac{dy}{dx} = -\frac{x}{y} = \frac10$ is undefined, which matches the picture since there is a vertical tangent line there.
\vskip10pt
Example: $xy = 1$. This relation is actually a function because its graph passes the v.l.t.. If you solve for $y$ you see $\d y = f(x) = \frac{1}{x}.$ Therefore, by the Power Rule, $\d y' = \frac{-1}{x^2}$. However, we can also use implicit differentiation. We use the product rule in the following:
\begin{align*}
xy &= 1\\
\frac{d}{dx} ( xy ) &= \frac{d}{dx}1\\
\left(\frac{d}{dx} x\right)(y) + \left(\frac{d}{dx} y\right)(x)&= 0 & \qquad \qquad \text{ (Product Rule)}\\
\left( 1 \right) (y) + (y' )(x) &= 0\\
y + y' x &= 0\\
y' &= \frac{-y}{x}\\
\end{align*}
In fact this is the same answer we got by solving for $y$ first, because
$$y' = \frac{-y}{x} = \frac{-\left(\frac{1}{x}\right)}{x} = -\left(\frac{1}{x}\right) \cdot \frac{1}{x} = \frac{-1}{x^2}.$$
Wow!
\section{Related Rates}
Check out this cistern for catching drinkable rain water (from the College of Tropical Agriculture and Human Resources at M\=anoa).
\includegraphics[width=4in]{cistern.png}
If two quantities are related, such as volume and height of a cylinder, then the \textit{rates of change} of the quantities are related. An equation determines the relation, and differentiating gives a relationship between the derivatives, a.k.a. rates of change. Once again, if there is only one thing you remember from this class, it should be that \textit{derivatives are instantaneous rates of change.}
\begin{framed}
\textbf{Related Rates}
\vskip5pt
Differentiate both sides of the relation with respect to $t$ (time), using the Chain Rule for composite functions. Understand that if $A$ represents a quantity, then $\d \frac{dA}{dt}$ represents the rate of change of that quantity.
\end{framed}
Getting an equation with derivatives in it allows us to solve interesting problems. (Oh boy! Word problems! Now we can use the math in real life!;)) These 6 steps are the same steps I give all my students in all my classes, and I give partial credit based on following the steps. Of course, step 4 is special for related rates problems.
\begin{enumerate}
\item Read the problem at least 3 times.
\item Label the variables. (Write down what's what. Easy partial credit!)
\item Write an equation relating the variables.
\item Solve: Differentiate both sides of the relation with respect to time $t$, using the Chain Rule for composite functions. Understand that if $A$ represents a quantity, then $\d \frac{dA}{dt}$ represents the rate of change of that quantity. Plug in the given information and solve for the unknown.
\item State your answer in a sentence.
\item Check for reasonableness.
\end{enumerate}
\vskip5pt
\textbf{Example.}
The cistern in the photo is 3m in diameter. Rain is falling at 3cm/hr straight into the cistern (not how they really work, more below). How fast is the volume of water in the cistern increasing? \vskip5pt
\textbf{Step by step solution.}
\begin{enumerate}
\item Read it three times. The quantities mentioned are diameter and volume. Diameter is constant, so we don't have to label it a variable. However, the height of water is changing at 3cm/hr, so height should be a variable. The question we need to answer is about the rate of change of volume.
\item Let $h$ be the height of the water in the cistern, and let $V$ be the volume of water in the cistern. (Write this on a test for easy partial credit.) Since rain is falling at 3cm/hr, the height $h$ is increasing 0.03m/hr, \textit{which means} $\d\frac{dh}{dt} = 0.03$. Since we want to find the rate of change of volume, the unknown is $\d \frac{dV}{dt}$.
\item We can tell from the picture that the cistern is a right circular cylinder (or close, but on a test it would be stated explicitly) so
from our knowledge of geometry $V = \pi r^2 h$ where $r = 3/2 = 1.5$, giving $r^2 = 2.25$ (square meters). Hence,
$$V = 2.25\pi h.$$
\item Differentiate w.r.t. $t$:
\begin{align}
V &= 2.25\pi h\\
\frac{d}{dt} V &= \frac{d}{dt} (2.25\pi h)\\
\frac{dV}{dt} &= 2.25\pi \frac{dh}{dt}.
\end{align}
All we used to get (3) is the Constant Multiple Rule for derivatives. This example is so simple that we do not need the Chain Rule. However, if the equation were more complicated, like if $h$ was raised to a power other than 1, eg., we would need the Chain Rule.
Now plug in $\d\frac{dh}{dt} = 0.03$ and solve for $\d \frac{dV}{dt}$.
$$ \frac{dV}{dt} = 2.25\pi (0.03) \approx 0.212.$$
\item The volume is increasing at about $0.212$ m$^3$/hr. PAU. (That's the answer.)
\item Let's think about it. If the height of the cistern (max height of the water) is 1m (a reasonable estimate), the total volume of the container is $\pi(1.5)^2(1) \approx 7$ m$^3$. It is going to take a couple days to fill up (if the rain keeps coming), which is reasonable.
The truth is, we could probably solve this problem without calculus, since the relationship between volume and height is linear (a.k.a. direct variation). Calculus will be needed for more complicated equations though, like when the Chain Rule comes into play. Also, cisterns aren't just buckets open to the rain, they collect water through pipes from the roof of a building. So another related rate problem is to compare the area of the roof to the change in volume in the tank. This one is just as easy mathematically, so we will do a different one instead.
\vskip10pt
\textbf{Example:} A 16m ladder is leaning against a building, and being pulled up. A worker is pulling the top of the ladder up at 0.5m/sec. How fast is the bottom of the ladder moving along the ground at the moment when its distance from the building is 8m?
\vskip10pt
\begin{tikzpicture}
\draw (0,0) -- (0,5);
\draw( 0,2.5) node[anchor=east]{building};
\draw(0,5) -- (-1,5);
\draw (0,4) -- (3,0);
\draw (1.5,2) node[anchor=west]{ladder};
\draw (-1,0) -- (5,0);
\draw[ultra thick,->] (0.5,4)-- (0.5,5) node[anchor=north west]{0.5m/s};
\draw[ultra thick, ->] (3,-0.5)--(2,-0.5) node[anchor=north west]{$\d \frac{dr}{dt}$};
\end{tikzpicture}
The picture is a right triangle with hypotenuse 16, bottom leg $r$, and let's call
the side leg $x$. The Pythagorean Theorem gives
$r^2 + x^2 = 16^2.$
Then $$2r \frac{dr}{dt} + 2x \frac{dx}{dt} = 0.$$
Since the worker is pulling up, $\frac{dx}{dt} = 0.5$ m/sec. We are given $r = 8$
so we need to find $x$. Using the Pythagorean Formula, $x^2 = 16^2 - 8^2$,
so $x = \sqrt{192} = 8\sqrt3$. Plugging it all in,
\begin{align*}
2(8)\frac{dr}{dt} + 2(0.5)(8\sqrt 3) &= 0\\
\frac{dr}{dt} &= \frac{-8\sqrt3}{16} \\
\frac{dr}{dt} & = -\frac{\sqrt3}{2}
\end{align*}
The rate $\frac{dr}{dt}$ is negative because the distance $r$ is decreasing. The ladder
is sliding along the ground at $\frac{\sqrt3}{2} \approx 0.866$ m/sec.
\vskip20pt
\end{enumerate}
\section{Linear Approximation and Differentials}
So far in this chapter, each section has depended on or been related to the previous one. This section does not depend on the previous section, so it will seem a bit random (miscellaneous).
\textit{Linear approximation} is simply approximating functions by their tangent lines.
\begin{framed}
The linear approximation of $f(x)$ at $x = a$ is
$$L(x) = f'(a)(x-a) + f(a).$$
\end{framed}
The function $L$ is literally the tangent line to $f(x)$ at $a$. We found tangent lines earlier (as far back as section \ref{intro}) with point slope form $y - y_0 = m(x-x_0)$, and in the framed equation above we are just rewriting this while setting $x_0 = a$ (so $y_0 = f(x_0) = f(a)$), $y = L(x)$, and $m = f'(a)$.
\vskip10pt
\textbf{Example:} The linear approximation to $f(x) = \sqrt[3]{x}$ at $x = 1$ is
$$L(x) = \frac13 (x-1) + 1.$$
All we did was plug in $a = 1$, $f'(a) = \frac13(a)^{-2/3} = \frac13(1)^{-2/3} = \frac13$, and $f(a) = \sqrt[3]{1} = 1$. Suppose you were stranded on a desert island without a calculator (the kind of thing that happens all the time on television), and you had to figure out the cube root of 1006 (for some engineering problem involving opening a coconut or something). Suppose also that you have just learned about linear approximation. It's not that difficult to do the following calculation in the sand (or even your head):
$$\sqrt[3]{1006} = 10\sqrt[3]{1.006} = 10f(1.006) \approx 10L(1.006) = 10\left[ \frac13 (1.006-1) + 1\right] = 10[0.002+1] = 10.02.$$
Watching you on TV, the audience is wowed when they check with their calculators, $\sqrt[3]{1006} = 10.0199601328...$. Your mental calculation is accurate within 0.00004, and the coconut slingshot works amazingly well.
All jokes aside, linear approximation is a handy tool. It works best when you are approximating near the base point $a$. The idea is that the tangent line is close to the function there, as we see in this graph of $y = \sqrt[3]{x}$ and its tangent line at $a=1$.
\includegraphics[width=4in]{lecture38plot.pdf}
The change in $f$ from its base point to its value at $x$ is close to the change in the tangent line, which is the slope times the change in $x$. Look back at the definition of the derivative, but let's put $\Delta x$ as the change in $x$, instead of $h$.
$$f'(x) = \lim_{\Delta x \to 0}\frac{f(x+\Delta x) - f(x)}{\Delta x}.$$
Then since $\Delta y = f(x + \Delta x) - f(x)$, we can write
$$f'(x) = \lim_{\Delta x \to 0}\frac{\Delta y}{\Delta x} = \frac{dy}{dx}.$$
This explains Leibniz's notation $f'(x) = \frac{dy}{dx}$. For certain purposes, it helps to ``separate the fraction," but this will confuse students because a derivative $\d \frac{dy}{dx}$ is not a fraction in the usual sense.
\begin{framed}
\noindent \textbf{Differentials}
\noindent If $y = f(x)$ is a differentiable function and $dx$ is a real number, the \textit{differential}, $dy$, is defined as
$$dy = f'(x) dx.$$
\end{framed}
The idea is that $dy \approx \Delta y$. Note that $dy$ is NOT the derivative $y'$. (Quick vocab review: ``derivative" $\neq$ ``differential", but
``the derivative of $f$ exists" $=$ ``$f$ is differentiable".) The confusing thing for students is that we are talking about infinitesimally small things here, so limits are behind the scenes. We have to use a real number as $dx$ when we define the differential $dy$, but we are intending to let $dx$ approach 0 when we use differentials. This stuff will come up again in Chapter 5, but for the Chapter 3 test all I ask is that you know how to do easy problems like this:
\vskip10pt
\textbf{Example:} For $y = f(x) = x^4+x$ and a real number $dx$, find the differential $dy$.
Differentiate, writing $\d \frac{dy}{dx} = 4x^3 + 1$, and the answer is then
$$dy = (4x^3+1)dx.$$
\section{The Extreme Value Theorem}
Chapter 4, this chapter, is a collection of powerful tools that come from advanced use of derivatives. We already learned about them as slopes or rates of change. Now, we apply these ideas to help us graph functions and find \textit{extrema}. The word \textit{extremum} (the plural is \textit{extrema}) means \textit{maximum} or \textit{minimum}. We will talk about maxima and minima a lot in this chapter. I will probably abbreviate with ``max" or ``min" often.
\begin{framed}
\textbf{The Extreme Value Theorem}
If $f$ is continuous on $[a,b]$, then $f$ has a maximum value and a minimum value on $[a,b]$.
\end{framed}
When we say ``value" we mean $y$-value. The Extreme Value Theorem is important to the theoretical framework of calculus. It is interesting to see examples of functions that \textit{do not} have maxima or minima, and note that none of them are continuous.
\begin{figure}[here!]
\centering
\begin{subfigure}{.4\textwidth}
\begin{tikzpicture}[scale=0.8]
\draw (-2,0) -- (5,0) node[anchor=north east]{$x$};
\draw (0,-2) -- (0,5) node[anchor = north west]{$y$};
\draw (1,-0.5) node[anchor=north]{$a$} -- (1,0.5);
\draw (4,-0.5) node[anchor=north]{$b$} -- (4,0.5);
\draw[ultra thick] (1,1) -- (4,4);
\filldraw[fill=white] (1,1) circle (3pt);
\filldraw[fill=white] (4,4) circle (3pt);
\end{tikzpicture}
\caption*{No max or min.}
\end{subfigure}%
\begin{subfigure}{.4\textwidth}
\centering
\begin{tikzpicture}[scale=0.8]
\draw (-2,0) -- (5,0) node[anchor=north east]{$x$};
\draw (0,-2) -- (0,5) node[anchor = north west]{$y$};
\draw (1,-0.5) node[anchor=north]{$a$} -- (1,0.5);
\draw (4,-0.5) node[anchor=north]{$b$} -- (4,0.5);
\draw[ultra thick](2.5,1) parabola (1,4);
\draw[ultra thick](2.5,1) parabola (4,4);
\filldraw[fill=white] (2.5,1) circle (3pt);
\filldraw(4,4) circle (3pt);
\filldraw(1,4) circle (3pt);
\end{tikzpicture}
\caption*{Two maxima, no mininmum.}
\end{subfigure}%
\end{figure}
It is imperative to understand the meaning of the open dot. The function values get infinitely close to the $y$-value of the dot, but never reach it. Hence, maxes or mins can fail to be achieved. Asymptotes can also ruin a function's chance to have extreme values, but functions are never continuous at their vertical asymptotes.
Anyway, continuous functions on closed intervals always have a max and a min, and we want to find them. Think about it; our life goals are to MAXIMIZE AWESOMENESS, MINIMIZE LAMENESS. That is what this chapter is all about. The key idea is that extrema occur at either corners or horizontal tangents. We call these \textit{critical points.}
\begin{framed}
\textbf{The Critical Point Theorem}
A \textit{critical point} is an $x$-value $x = c$ in the domain of $f$ such that $f'(c) = 0$ or $f'(c)$ is undefined.
The function $f(x)$ can only have extreme values at critical points or endpoints.
\end{framed}
We have to include the endpoints $x = a$ and $x = b$ when we look at functions on $[a,b]$.
\vskip10pt
\textbf{Example.} Find the extreme values of $f(x) = x^2 - x$ on $[-1,3]$.
The candidates for locations of a max or min are the endpoints $-1$ and $3$, and the critical points. Since $f'(x) = 2x-1$, the only critical point is when $2x-1 = 0$, so $x = \frac12.$ Plug each candidate $x$-value into the function $y = f(x)$, and the $y$-values will determine the max and min.
$f(-1) = (-1)^2 - (-1) = 2$
$f\left(\frac12\right) = \left(\frac12\right)^2 - \frac12 = \frac14-\frac12 = -\frac14$
$f(3) = 9-3 = 6$
\textbf{Answer:} The max is 6 and the min is $-\frac14$.
Crucial to understanding the Critical Point Theorem is the visual
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=north east]{$x$};
\draw (0,-2) -- (0,5) node[anchor = north west]{$y$};
\draw[ultra thick] (1/2,-1/4)parabola(-1,2) ;
\filldraw (-1,2) circle (3pt);
\draw[ultra thick] (1/2,-1/4)parabola(3,6) ;
\filldraw (3,6) circle (3pt);
\draw[thick, red] (-1/2,-1/4) node[anchor= north west]{horizontal tangent line at critical point, min} -- (3/2,-1/4);
\end{tikzpicture}
which shows the min at the vertex of this parabola where the tangent line is horizontal. In this chapter, I will frequently say ``set the derivative to 0," and this is why.
\vskip20pt
\textbf{More on extrema:}
We did not give the technical definition of a maximum or minimum above. The idea is usually quite intuitive, but there are some situations in which we must know the technical definition, as follows:
\emph{
For a function $f(x)$, the point $(a, f(a))$ is an \textbf{absolute maximum} if $f(a) \geq f(x)$ for every $x$ in the domain of $f$. The point $(a,f(a))$ is a \textbf{local maximum} if $f(a) \geq f(x)$ for all $x$ in some neighborhood (like a small open interval) of $a$.
}
\emph{
For a function $f(x)$, the point $(a, f(a))$ is an \textbf{absolute minimum} if $f(a) \leq f(x)$ for every $x$ in the domain of $f$. The point $(a,f(a))$ is a \textbf{local minimum} if $f(a) \leq f(x)$ for all $x$ in some neighborhood of $a$.
}
First, note the inequality is not strict, i.e., if $f(a) = f(x)$ for all $x$, then $f$ has a maximum at $a$. So for a constant function, every single point on the graph is both a max and min! As for the difference between ``absolute" and ``local" (a.k.a. ``relative"), a picture (below) is helpful. The word ``neighborhood" is actually a profound word in mathematics, and we will not get into it in this class (a starting point would be section 2.3). Some textbooks differ slightly on the definition of a local extremum, especially regarding whether endpoints of a function's domain can be the location of local extrema. In math, you can define things however you want as long as you are consistent throughout, but I will avoid the local-max-at-endpoint issue here. The important thing is to understand the following picture.
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=north east]{$x$};
\draw (0,-2) -- (0,5) node[anchor = north west]{$y$};
\draw[ultra thick,->] plot [smooth] coordinates { (-1,-1) (0,1) (2,2) (3,1) (4,3)};
\filldraw (-1,-1) circle (3pt) node[anchor=north]{min};
\filldraw (2,2) circle (3pt) node[anchor=south]{local max};
\filldraw (3,1) circle (3pt) node[anchor=north]{local min};
\draw (6,3) node{no absolute max};
\end{tikzpicture}
Understand that an \textit{absolute max} can just be called a \textit{max}, but if a point is a local max, and not absolute, the word \textit{local} must be emphasized. The word \textit{relative} is also used, interchangeably with \textit{local}.
\section{The Mean Value Theorem}
The Mean Value Theorem (MVT) is a big part of the theoretical framework of calculus. Many proofs of subsequent theorems rely on the Mean Value Theorem, including facts about increasing/decreasing functions and the Fundamental Theorem of Calculus. In advanced calculus where rigorous proofs are done (like MATH 331 at M\=anoa), the MVT saves the day time and time again. At this level, beginning calculus, it is difficult to appreciate the MVT, but I ask that you try to understand the picture. If nothing else yet, the MVT exercises are good for practicing the language of calculus, and solidify your understanding of other concepts as well.
\begin{framed}
\textbf{The Mean Value Theorem}
If $f$ is continuous on $[a,b]$ and differentiable on the interval $(a,b)$, then there exists a number $c$ in $(a,b)$ such that
$$f'(c) = \frac{f(b) - f(a)}{b-a}.$$
\end{framed}
In less formal terms, the MVT says ``there is a place where the tangent line is parallel to the secant line," because $f'(c)$ is the tangent slope and $\d \frac{f(b) - f(a)}{b-a} $ is the secant slope. Here's the picture:
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=north east]{$x$};
\draw (-1,-2) -- (-1,5) node[anchor = north west]{$y$};
\draw (0,-0.5) node[anchor = north]{$a$} -- (0,0.5);
\draw (2,-0.5) node[anchor = north]{$b$} -- (2,0.5);
\draw (1,-0.5) node[anchor = north]{$c$} -- (1,0.5);
\draw[ultra thick] (0,0) parabola (2,4) node[anchor = west]{$f$};
\draw[thick,red] (0.5,0) -- (2,3) node[anchor = west]{tangent};
\draw[thick,blue] (0,0) -- (2,4) node[anchor = north east]{secant};
\end{tikzpicture}
\textbf{Example.} Explain why the Mean Value Theorem applies to $f(x) = \sqrt x$ on [0,9], and find the number $c$ guaranteed by the Theorem.
SOLUTION: The function $f(x)$ is continous on $[0,9]$ and differentiable on $(0,9)$, so the Mean Value Theorem applies. It says we can find $c$ such that
$$f'(c) = \frac{f(9) - f(0)}{9-0} = \frac{\sqrt 9 - \sqrt 0}{9-0} = \frac13.$$
Since $f'(x) = \frac12 x^{-1/2},$ we solve
$$\frac12 x^{-1/2} = \frac13.$$
Multiply both sides by 2 to get
$$x^{-1/2} = \frac23,$$
and raise both sides to the $-2$ to get
$$x = \left( \frac23 \right)^{-2} = \left( \frac32 \right)^2 = \frac{9}{4}.$$
So $c = \frac94$.
\section{Increasing and Decreasing Functions and the First Derivative Test}
In MATH 135 at KCC we learn how to tell when a function is increasing, decreasing or constant by its graph. The keys are to read left to right, and to only give intervals on the $x$-axis.
For example, consider the graph of $y = f(x)$ below.
\begin{tikzpicture}
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,5);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3);
\draw (-0.5,4)--(0.5,4) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\draw[ultra thick, <-] (-5,-1) -- (-2,1) node[anchor=south]{$(-2,1)$};
\draw[ultra thick,->] (-2,-1) -- (0,2) -- (2,2) -- (5,-1);
\filldraw (-2,1) circle (3pt);
\filldraw[fill=white] (-2,-1) circle (3pt);
\end{tikzpicture}
This function $f$ is increasing on $(-\infty, -2]$, $(-2,0]$, decreasing on $[2, \infty)$, and constant on $[0,2]$.
Note that we don't give any $y$-values when we talk about increasing and decreasing, and we do not use $\cup$ signs. The formal definition of ``increasing" is that $f(x_2) > f(x_1)$ whenever $x_2 > x_1$. The graph above suddenly jumps down at $x = -2$, so it would be wrong to say that $f$ increases on $(-\infty , 0]$.
WRONG: $f$ is increasing on $(-\infty,-2] \cup (-2,0]$.
CORRECT: $f$ is increasing on $(-\infty, -2], (-2,0]$.
The experienced student will know that a line with negative slope is decreasing, and a line with positive slope is increasing. Hence, the relationship with the derivative $f'$ is not surprising:
\begin{framed}
If $f'(x) > 0$ on the interval $(a,b)$, then $f(x)$ is increasing on $(a,b)$.
If $f'(x) < 0$ on $(a,b)$, then $f(x)$ is decreasing on $(a,b)$.
If $f'(x) = 0$ on $(a,b)$, then $f(x)$ is constant on $(a,b)$.
\end{framed}
Like I say, the framed result above is not surprising. A rigorous proof, however, is one of the first places where the Mean Value Theorem saves the day. Here is what that looks like:
\begin{thm*}
If $f'(x) > 0$ on the interval $(a,b)$, then $f$ is increasing on $(a,b)$.
\end{thm*}
\begin{proof}
Suppose $f'(c) > 0$ at every point $c$ in between $a$ and $b$. Given $x_2 > x_1$ in the interval, we can apply the Mean Value Theorem to find $c$ such that
$$f'(c) = \frac{f(x_2) - f(x_1)}{x_2 - x_1}.$$
Hence
$$\frac{f(x_2) - f(x_1)}{x_2 - x_1} > 0.$$
Multiplying both sides of the inequality by $x_2 - x_1$ gives
$$f(x_2) - f(x_1) > 0,$$
which means $f(x_2) > f(x_1)$. Hence $f$ is increasing.
\end{proof}
Now, recall that the major goal of this chapter (and life) is to MAXIMIZE AWESOMENESS, MINIMIZE LAMENESS. How do the ideas of increasing/decreasing functions do this? The answer is the First Derivative Test.
\begin{framed}
\textbf{The First Derivative Test}
Let $x = c$ be a critical point of $f$.
If $f'(x)$ changes from $+$ to $-$ at $c$, then $f$ has a local max at $c$.
If $f'(x)$ changes from $-$ to $+$ at $c$, then $f$ has a local min at $c$.
\end{framed}
\textbf{Example:} Find the intervals of inc/dec and local extrema of $f(x) = x^3 - 3x$.
Apply the test-point method or a sign chart (precalculus skills) to find the sign of
the derivative $f'(x) = 3x^2 - 3 = 3(x-1)(x+1)$.
\vskip10pt
\begin{tikzpicture}[scale=1.2]
\draw[<->] (-3,0) -- (3,0);
\draw (-1,-0.5)node[anchor=north]{$-1$} -- (-1,0.5);
\draw (1,-0.5)node[anchor=north]{$1$} -- (1,0.5);
\draw (-4,2)node{$f(x)$};
\draw (-2,2)node{inc};
\draw (2,2)node{inc};
\draw (0,2)node{dec};
\draw (-4,1)node{$f'(x)$};
\draw (-2,1)node{$+++$};
\draw (2,1)node{$+++$};
\draw (0,1)node{$---$};
\end{tikzpicture}
Thus, $f(x)$ is increasing on $(-\infty, -1)$, $(1,\infty)$, and decreasing on $(-1,1)$. (You could use some brackets if you know how; different teachers may specify the forms of intervals they want you to write.)
There is a local max at $x = -1$ and a local min at $x = 1$, by the First Derivative Test. Personally, I take points off if you omit the ``at" because the max value is a $y$-value, not $-1$. To be safe, you could plug the values into the original function, and write
``the point $(-1,2)$ is a local max of $f$, and $(1,-2)$ is a local min."
\includegraphics[width=3in]{incdeccubic.pdf}
\section{Concavity }
Look at this picture of a concave up function, where we estimate slopes from left to right.
\vskip10pt
\begin{tikzpicture}
\draw[ultra thick, <->] (-4,1) .. controls (-4,-0.5) and (-1,-1) .. (0,-1) .. controls (1,-1) and (4,-0.5) .. (4,1);
\draw[thick,red] (-4.1,1) -- (-3.8,0);
\draw[thick,red] (-3, -0.45) -- (-2,-.8);
\draw[thick,red] (-.7,-1.1) -- (.7,-1.1);
\draw[thick,red] ( 3, -0.45) -- (2,-.8);
\draw[thick,red] (4.1,1) -- (3.8,0);
\draw (-5,-2) node[anchor = east,red]{slope $\approx$};
\draw (-4,-2) node[red]{$-3$};
\draw (-2.5,-2) node[red]{$-\frac13$};
\draw (0,-2) node[red]{$0$};
\draw (2.5,-2) node[red]{$\frac13$};
\draw (4,-2) node[red]{$3$};
\draw (6,-2) node[red]{increasing};
\end{tikzpicture}
This is the visual idea behind concavity. If the slopes of $f$ are increasing, then $f'$ is increasing. Since $f'$ is increasing, its derivative is positive. The derivative of $f'$ is the second derivative of $f$.
\begin{framed}
If $f''(x) > 0$ on some interval $(a,b)$, then $f(x)$ is \textbf{concave up} on $(a,b)$.
If $f''(x) < 0$ on $(a,b)$, then $f(x)$ is \textbf{concave down} on $(a,b)$.
A number $x = c$ where $f''(c) = 0$ and $f''$ changes sign is called an \textbf{inflection point.}
\end{framed}
Note: Technically $f''$ may be undefined at an inflection point, but $f'$ has to be defined.
Students will learn to understand that the concavity of $f$ is not related to whether $f$ is increasing or decreasing. The following table shows four types of functions. The abbreviations ccu and ccd mean concave up and concave down, respectively.
\vskip10pt
\begin{tikzpicture}
\draw (0,0) rectangle (10,10);
\draw (5,0) -- (5,10);
\draw (0,5) -- (10,5);
\draw (-1,7.5) node{inc};
\draw (-1,2.5) node{dec};
\draw (2.5,11) node{ccu};
\draw (7.5,11) node{ccd};
\draw[ultra thick] (9,1) arc (0:90:3);
\draw[ultra thick] (1,4) arc (180:270:3);
\draw[ultra thick] (1,6) arc (-90:0:3);
\draw[ultra thick] (6,6) arc (180:90:3);
\end{tikzpicture}
In precalculus, you learn tools and techniques for graphing, like how to plot points, find intercepts and asymptotes, and determine end behavior. With the ideas of increasing/decreasing and concave up/down, calculus gives us new tools to add to our ability to graph. It is hard to overestimate how important graphing is in science and technology. Obviously the human brain processes pictures differently than equations, but graphing connects them. A picture is worth a bazillion words.
\section{Optimization}
This is a section that students tend to fear, because it consists of word problems. We are going to make it easy and friendly. The examples will all follow the same pattern, and the key step will always be the same: ``set the derivative to 0."
Rigorous mathematics texts will emphasize the other ways that maxima and minima arise (at corners where $f'$ is undefined, at endpoints of the domain, and at points other than where you find $f'$ is 0), but for our purposes, in the context of the examples here, setting the derivative to 0 is enough. The magic of optimization is prettiest when $f'$ is 0, and that is also the most common way optimization is used. So sit back, relax, and get ready to set some derivatives to 0.
\begin{framed}
\textbf{Optimization}
Plug the constraint into the objective, to get a function of one variable. Find the critical point by setting the derivative to 0. Answer the question.
\end{framed}
The examples will all have an \textit{objective} function and a \textit{constraint} equation. The \textit{objective} is the thing that needs to be maximized or minimized (optimized). The \textit{constraint} relates two variables.
\vskip10pt
\textbf{Example:} Find the maximum product of two numbers whose sum is 110.
\vskip10pt
Let $x$ and $y$ be the two numbers. The objective is the product $P = xy$. The constraint is $x + y = 110$. Plug the constraint $x + y = 110 \Rightarrow y = 110 - x$ into the objective
$$P = x ( 110 - x) = 110 x - x^2.$$
Then set the derivative to 0.
$$P' = 110 - 2 x = 0 \Rightarrow 110 = 2x \Rightarrow x = 55.$$
The product is maximized when $x = 55$ and $y = 110 - x = 110 - 55 = 55.$ The maximum product is $(55)(55) = 3025.$
\vskip20pt
\textbf{Example:} You want to enclose your cows next to a cliff. Maximize the area inside a 3-sided rectangular fence (see picture) with 600 total meters of fence.
\vskip10pt
\begin{tikzpicture}[scale=0.5]
\draw[thick] (0,0) -- (3,0) node[anchor=north]{$x$} -- (6,0) -- (6,4) node[anchor=west]{$y$} -- (6,8) -- (0,8);
\draw ( 3,4)node{cows in here};
\draw (3,-2)node{overhead view};
\end{tikzpicture}
The constraint is $2x + y = 600,$ which is the perimeter of 3 sides of the rectangle. The objective is the area $A = xy$. Plug the constraint
$2x + y = 600 \Rightarrow y = 600 - 2x$ into the objective
$$A = xy = x(600-2x) = 600x - 2x^2.$$
Then set the derivative to 0.
$$A' = 600 - 4x = 0 \Rightarrow 600 = 4x \Rightarrow 150 = x.$$
The area is maximized when $x = 150$ and $y = 600 - 2(150) = 300$. The max area is $(150)(300) = 45000$ square meters.
\vskip20pt
\textbf{Example:} You are selling $x$ bento lunches at price $p$. It costs you $\$5$ to make one. By supply and demand $x = 20 - p$ (if you raise the price, you sell less). What price should you charge to maximize the profit $P = xp - 5x$?
\vskip10pt
This is a standard business math problem. The objective is profit $P = xp - 5x$, which comes from revenue $xp$ minus cost $5x$. The constraint is $x = 20 - p$. Plug the constraint into the objective
$$P = (20-p)p - 5(20 - p) = 20p - p^2 - 100 + 5p = -p^2 + 25 p - 100.$$
Then set the derivative to 0.
$$P' = -2p + 25 = 0 \Rightarrow 25 = 2p \Rightarrow 12.5 = p.$$
The price you should charge is \$12.50.
\vskip20pt
Notes: One thing that makes these examples easy is that they all have only one critical point. Sometimes there are two or more, and then you have to figure out which one(s) answer the question. The gnarly optimization problems just take cleverness to figure out what the constraint and objective are, and which critical point answers the question (if it even has an answer).
\section{Newton's Method }
Newton's Method is a way to approximate roots of functions. Recall that a \textit{root} of $f(x)$ is a number such that $f(r) = 0$. In precalculus you learn the quadratic formula to find roots of quadratics and synthetic division to search for roots of high degree polynomials, but in general it is not easy to find roots. Nowadays, we use calculators and computers. In Newton's time, any method that made calculations easier was a big deal, and today we still need people who know how to program the calculators we use. Newton's method boils down to a straightforward formula, but a calculus student will benefit their overall understanding if they can derive the formula themselves, rather than memorize it. It is simply a tangent line approximation. Since a root $r$ gives an $x$-intercept of the graph of $f(x)$, Newton's Method is: find the $x$-intercept of a tangent line to $f$ near its root.
You start by picking a number $x_0$ that is (already) an approximation of $r$. Then you find the tangent line at $x_0$, and its $x$-intercept is $x_1$.
\begin{tikzpicture}
\draw (-2,0) -- (5,0);
\draw[thick] (0,-0.5) parabola (4,4) node[anchor=east]{$f$} ;
\draw (1.36,-0.2) node[anchor=north]{$r$}-- (1.36,0.2);
\draw (3, -0.2) node[anchor=north]{$x_0$} -- (3, 0.2);
\draw[red] (4.14,4) -- (1.8,-0.2);
\filldraw[red] (3,2) node[anchor=west]{$(x_0, f(x_0))$} circle (3pt);
\draw[red] (1.9,-0.2) node[anchor=north]{$x_1$} -- (1.9, 0.2);
\end{tikzpicture}
The derivation of the formula for $x_1$ is something a good calculus student will know how to do. You start with the point-slope form of the tangent line at $x_0$, which is
$$y - f(x_0) = f'(x_0)(x - x_0).$$
Then you find the $x$-intercept by setting $y = 0$ and solving for $x$:
\begin{align*}
0 - f(x_0) &= f'(x_0)(x - x_0) \\
-f(x_0) &= f'(x_0)x - f'(x_0)x_0\\
f'(x_0)x_0 -f(x_0) &= f'(x_0) x\\
\frac{ f'(x_0)x_0-f(x_0)}{f'(x_0)} &= x\\
x_0 - \frac{f(x_0)}{f'(x_0)} &= x = x_1.
\end{align*}
Then you \textit{iterate}. \textit{Iteration} is a big idea in mathematics. It means ``repeat the formula," or ``run it through the function again," in layman's terms. You take the
$x_1$ value and find a new tangent line at $x_1$ whose $x$-intercept $x_2$ is an even better (hopefully) approximation of $r$:
$$ x_1 - \frac{f(x_1)}{f'(x_1)} = x_2.$$
The process can be repeated until your approximation is as close as you need. Most students will simply memorize the formula for the test.
\begin{framed}
$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$$
\end{framed}
\vskip10pt
\textbf{Example:} Use two iterations of Newton's Method to approximate the positive root of $f(x) = x^2 - 2$ starting with $x_0 = 2$.
\vskip10pt
I advise you have scratch paper to write the derivative $f'(x) = 2x$ and calculate function values on the side. Then just plug and chug, getting
$\d x_1 = 2 - \frac{f(2)}{f'(2)} = 2 - \frac{2}{4} = \frac 32,$ and
$\d x_2 = \frac32 - \frac{ f(\frac32)}{f'(\frac32)} = \frac 32 - \frac{ \frac14}{3} = \frac32 - \frac{1}{12} = \frac{17}{12}.$
That's two iterations. Our answer $\frac{17}{12} \approx 1.41667$ is a decent approximation of the actual root $r = \sqrt 2 \approx 1.41421$.
\vskip20pt
That's about it. The last thing that should be mentioned is that Newton's Method is no guarantee. If you choose a bad $x_0$ or if the function $f$ is badly behaved, then Newton's Method will not work. Try to picture a function so ugly that the tangent line never gives a good approximation. Something like a fractal can behave that way. Here's a graph of $f(x) = x + x^2\sin(\frac{2}{x})$, a naughty function near the $x$-axis.
\includegraphics[width=4in]{fractalsine.pdf}
\section{Antiderivatives} \label{antid}
In building mathematics, it's all about going backwards. Children learn to add, and then learn how to go backwards, i.e., subtract. Multiply, then reverse it with division. Reversing a function gives the inverse function, an important topic in precalculus.
So what happens in calculus? We learn to differentiate, then reverse it with \textit{antidifferentiation.}
\begin{framed}
An \textit{antiderivative} of $f(x)$ is a function $F(x)$ such that $F'(x) = f(x)$. The \textit{indefinite integral}
$$\int f(x) \, dx = F(x) + C$$
is the general antiderivative of $f$.
\end{framed}
For example, suppose you were on Jeopardy!, the trivia show where Alex Trebec gives answers and contestants say the questions.
Alec: It's derivative is $2x$.
You: What is $x^2$?
Alec: Correct.
Your mom: What is $x^2 + 3$?
Alec: Correct also, but it wasn't your turn.
Glossing over the fact that your mother is on Jeopardy! with you speaking out of turn, an important point arises. There are many different antiderivatives of a given function, but they only vary by additive constants.
\begin{thm*}
If $F'(x) = G'(x)$, then $F(x) = G(x) + C$ for some constant $C$.
\end{thm*}
The proof of this Theorem uses the Mean Value Theorem, which once again crops up in a key place. You can look up the proof elsewhere.
The upshot is that we always put a $+ C$ on our indefinite integrals, and the next chapter (and almost all of Calculus II) is devoted to mastering the techniques and applications of antidifferentiation. For now, we will stick to easy ones. You should never get an antiderivative wrong, because you can always check by taking the derivative.
\textbf{Examples:}
\begin{enumerate}[(a)]
\item
$\d \int 2x \, dx = x^2 + C$
\vskip10pt
Check $\d \frac{d}{dx} (x^2 + C) = 2x + 0 = 2x$.
\vskip20pt
\item $ \d \int 0 \, dx = C$
\vskip20pt
\item $\d \int \, dx = x + C$.
\vskip10pt
Note: The integrand is 1.
\vskip20pt
\item
$\d \int x\, dx = \frac{x^2}{2} + C$
\item
$\d \int x^2 \, dx = \frac{x^3}{3} + C$
\item
$\d \int x^3 \, dx = \frac{x^4}{4} + C$
\item
$\d \int \frac1{x^4} \, dx = \int x^{-4} \, dx
= \frac{x^{-3}}{-3}+C= -\frac{1}{3x^3}+C$
\vskip10pt
Check: $\d \frac{d}{dx} ( -\frac{1}{3x^3}) = \frac{d}{dx} ( -\frac{1}{3}x^{-3}) =-\frac13\left(-3x^{-4}\right)=x^{-4}=\frac1{x^4}$
\vskip20pt
\item
$\d \int (x^2 - 2x +1) \, dx = \frac13 x^3-x^2+x+C$
\vskip10pt
Check: $\frac{d}{dx} (\frac13 x^3-x^2+x+C) = x^2-2x+1$
\vskip20pt
\item
$\d \int \sqrt x \, dx = \int x^{1/2} \, dx
= \frac{x^{3/2}}{3/2}+ C = \frac{ 2 x^{3/2}}{3} + C$
\vskip20pt
\end{enumerate}
In all these examples, we are relying on the reverse Power Rule, which we call the Power Rule for Indefinite Integrals:
$$\int x^k \, dx = \frac{x^{k+1}}{k+1} \qquad (k \neq -1).$$
So far, our antidifferentiation skills are limited to the Power Rule, and the Sum and Constant Multiple Rules:
$$\int ( f(x) + g(x) )\, dx = \int f(x) \, dx + \int g(x) \, dx \qquad \text{ and } \qquad \int k f(x) \, dx = k \int f(x) \, dx, \quad k \text{ constant.}$$
Note that these come from similar rules for limits and derivatives. However, products and quotients are more complicated, and you will not learn how to integrate a product until Calculus II, when you learn Integration by Parts. Also, note that $\int x^{-1} \, dx$ is the only power that cannot be done with the Power Rule, and in Calculus II you will learn that
$\d \int \frac1x \, dx = \ln x$ for $x > 0.$
\section{Area, Estimating with Finite Sums} \label{area1}
These final sections are the best. It is the climax. The ancient Greeks knew how to find slopes of some curves and areas of some shapes, but Newton and Leibniz discovered that there is a connection between the two, and in this chapter you will finally learn it. The connection is the Fundamental Theorem of Calculus. It's what makes calculus calculus. Of course, you won't learn it right this second. It takes some set up.
A teacher told me once that calculus is ``finding areas of weird shapes." (Look back at lecture \ref{intro}.) Everyone knows the area of a rectangle, triangle, or circle (my mom's favorite math formula: pie are squared) but what's the area of a shape where the boundary is not a line or arc? What if the boundary is a function, like a parabola? For starters, we will try to approximate weird shapes with the simplest shapes of all--rectangles.
In this section, we start by approximating areas under functions with rectangles. Say we want to find the area under $y = x^2$ on $[0,1]$. This is a ``weird" shape:
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\draw (2,3) node{$y=x^2$};
\filldraw[gray] (0,0) parabola (4,4) -- (4,0) -- cycle;
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\end{tikzpicture}
Right off the bat, guesstimate the area. It's less than half of the unit square, so I might guess 0.4 (spoiler alert!--the actual area is $1/3$, but you don't know why yet). We are going to get lower and upper bounds for the actual area by using rectangles below and above the graph. The lower bound comes from a \textit{lower sum}, where the rectangles look like this:
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\filldraw[fill=gray,draw=black] (1,0) rectangle (2,1/4);
\filldraw[fill=gray,draw=black] (2,0) rectangle (3,1);
\filldraw[fill=gray,draw=black] (3,0) rectangle (4,9/4);
\filldraw (1,1/4) node[anchor = south east]{$(\frac14,\frac{1}{16})$} circle (2pt) ;
\filldraw (2,1) node[anchor = south east]{$(\frac12,\frac{1}{4})$} circle (2pt) ;
\filldraw (3,9/4) node[anchor = south east]{$(\frac34,\frac{9}{16})$} circle (2pt) ;
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\end{tikzpicture}
We split the interval into some subintervals (4 of them in this case), and there are 4 rectangles under the curve. The first rectangle has height 0, so you don't see it. The lower sum is $$\frac14 \cdot 0 + \frac14 \cdot \frac{1}{16} + \frac14 \cdot \frac14 + \frac14 \cdot \frac{9}{16} = \frac{7}{32} = 0.21875.$$
We added up width times height for each rectangle. The height comes from the $y$-values of the plotted points on the function. The answer $0.21875$ is less than the actual area we are trying to find, because there are pieces missing--the little white quasi-triangles between the rectangles' tops and the function.
To get an upper bound for the area we use an \textit{upper sum} where the rectangles look like this:
\begin{tikzpicture}
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\filldraw[fill=gray,draw=black] (0,0) rectangle (1,1/4);
\filldraw[fill=gray,draw=black] (1,0) rectangle (2,1);
\filldraw[fill=gray,draw=black] (2,0) rectangle (3,9/4);
\filldraw[fill=gray,draw=black] (3,0) rectangle (4,4);
\filldraw (1,1/4) node[anchor = south east]{$(\frac14,\frac{1}{16})$} circle (2pt) ;
\filldraw (2,1) node[anchor = south east]{$(\frac12,\frac{1}{4})$} circle (2pt) ;
\filldraw (3,9/4) node[anchor = south east]{$(\frac34,\frac{9}{16})$} circle (2pt) ;
\filldraw(4,4) circle (2pt);
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\end{tikzpicture}
The upper sum is
$$ \frac14 \cdot \frac{1}{16} + \frac14 \cdot \frac14 + \frac14 \cdot \frac{9}{16} + \frac14 \cdot 1= \frac{15}{32} = 0.46875,$$
which is greater than the actual area, because there are extra pieces in the rectangles above the curve.
The upper and lower sums above represent the case $n = 4$ on the interval $[a,b] = [0,1]$, where we label the \textit{partition} of $[a,b]$ into subintervals using the endpoints $x_0 = 0$, $x_1 = \frac14$, $x_2 = \frac12$, $x_3 = \frac34$, and $x_4 = 1$. The ultimate goal is to let $n \to \infty.$ Woah! That's why we need calculus. You see that if we put more rectangles we get closer to the actual area, so if $n = \infty$ we get the actual area, perfectly.
\begin{tikzpicture}[scale=0.8]
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\filldraw[fill=gray,draw=black] (0,0) rectangle (1,1/4);
\filldraw[fill=gray,draw=black] (1,0) rectangle (2,1);
\filldraw[fill=gray,draw=black] (2,0) rectangle (3,9/4);
\filldraw[fill=gray,draw=black] (3,0) rectangle (4,4);
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\draw (2,-1) node{$n=4$};
\end{tikzpicture}
\begin{tikzpicture}[scale=0.8]
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\multido{\n=0+0.5}{8}{
\filldraw[fill=gray,draw=black] (\n, 0) rectangle (\n + 0.5, \n^2/4 + \n/4+0.25/4);
}
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\draw (2,-1) node{$n=8$};
\end{tikzpicture}
\begin{tikzpicture}[scale=0.8]
\draw (-2,0) -- (5,0) node[anchor=south]{$x$};
\draw (0,-1) -- (0,5) node[anchor=east]{$y$};
\multido{\n=0+0.1}{40}{
\filldraw[fill=gray,draw=black] (\n, 0) rectangle (\n + 0.1, \n^2/4 + 0.2*\n/4+0.01/4);
}
\draw[thick] (0,0) parabola (4,4) node[anchor=west]{$(1,1)$};
\draw (2,-1) node{$n=40$};
\end{tikzpicture}
\section{Area with Infinite Sums}
In this section we add up infinitely many rectangles. First, we need to learn \textit{summation notation}, a way to write large sums precisely.
\begin{framed}
\textbf{Summation Notation}
The Greek uppercase sigma $\sum$ is used (here with \textit{lower limit} $a$, \textit{upper limit} $n$, and \textit{index} $k$) to add numbers in a pattern.
$$\sum_{k = a}^n f(k) = f(a) + f(a+1) + f(a+2) + ... + f(n)$$
\end{framed}
\vskip20pt
\textbf{Examples}
\vskip10pt
$\d \sum_{k = 1}^4 k^2 = 1^2 + 2^2 + 3^2 + 4^2 = 1+4+9+16 = 30.$
\vskip10pt
$\d \sum_{k = -1}^7 k = -1 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 = 27.$
\vskip10pt
$\d \sum_{k = 3}^{10} \frac{1}{k+2} = \frac15 + \frac16 + \frac17 + \frac18 + \frac19 + \frac{1}{10} + \frac{1}{11} + \frac{1}{12} = \frac{28271}{27720} \approx 1.020.$
\vskip10pt
$\d \sum_{k = 1}^5 7 = 7 + 7 + 7 + 7 + 7 = 5\cdot 7 = 35.$
\vskip10pt
$\d \sum_{k = 1}^{100} k = 1 + 2 + 3 + ... + 98 + 99 + 100 = (1 + 100) + (2 + 99) + (3 + 98) + ... + (50+51) = 50(101) = 5,050.$
\vskip10pt
For centuries, mathematicians have searched for and found patterns in summation, and a few of them will be useful for us. The first one is easy, the second one is clever, and the two after that are too hard for us to prove in this class (the algebra is doable, but you need a mathematical technique called \textit{induction} that you typically learn in a 300 level math course).
\begin{framed}
\textbf{Sum Formulas}
$\d \sum_{k = 1}^n c = cn, \quad c \text{ constant.}$
$ \d \sum_{k = 1}^n k = \frac{n(n+1)}{2}$
$ \d \sum_{k = 1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$
$ \d \sum_{k=1}^n k^3 = \frac{n^2(n+1)^2}{4}$
\end{framed}
Note also that for functions $f$ and $g$,
$$\sum (f+g) = \sum f + \sum g,$$
by commutativity of addition, which is called the sum law for sums. The constant multiple law for sums is
$$\sum cf = c \sum f, \quad c \text{ const.},$$
which is equivalent to the distributive law.
Notice I don't always put the index variable under the $\sum$. That's technically ok if there's only one variable--it's obvious.
Also, if there are no limits at all in a summation law, it means the law is true no matter what the limits are.
\vskip10pt
\textbf{Examples}
\vskip10pt
(a)
\begin{align*}
\sum_1^{10} k(k^2+1) &= \sum_1^{10} (k^3 + k)\\
&= \sum_1^{10} k^3 + \sum_1^{10} k \qquad \text{ (used the sum law for sums lol)}\\
&= \left( \frac{(10)(10+1)}{2} \right)^2 + \frac{(10)(10+1)}{2} \qquad \text{(used the formulas, e.g., } \sum_1^n k = \frac{n(n+1)}{2} )\\
&= 3080 \qquad \text{ (do the math) }
\end{align*}
\vskip20pt
(b)
$$
\sum_1^{15} ( 2k - 3) = 2 \sum_1^{15} k - 3(15)
= 2\left[ \frac{15(15+1)}{2} \right] - 45 = 195
$$
\vskip20pt
Now we get to what may be the hardest part of the entire class. We are going to add up areas of infinitely many rectangles. Such a sum is called a \textit{Riemann sum}, named after Bernhard Riemann, a famous mathematician who lived about 150 years after Newton and Leibniz. It took awhile to clarify the idea of area under a curve and give us the proof of the Fundamental Theorem of Calculus that we will see in this text in section \ref{ftc}.
Look back at section \ref{area1}, where we found an upper sum to approximate the area under the parabola $y = x^2$ on the interval $[0,1]$. We partitioned the interval $[0,1]$ into four subintervals. To define the partition, we need the endpoints of the subintervals, which were
$x_0 = 0$,
$x_1 = \frac14$,
$x_2 = \frac12$,
$x_3 = \frac34$, and
$x_4 = 1$.
\begin{tikzpicture}[scale=1.4]
\draw (0,0) -- (4,0);
\multido{\n=0+1}{5}{
\draw (\n,-0.25) node[anchor=north]{$x_\n$} -- (\n,0.25);
}
\draw (0,-0.75) node{0};
\draw (4,-0.75) node{1};
\end{tikzpicture}
The width of each subinterval is $\Delta x = \frac14$, which comes from dividing the length of the interval by $n = 4$. Our upper sum was
$$\sum_{k=1}^4 \text{width} \cdot \text{height} = \sum_{k=1}^4 \Delta x f(x_k) = \sum_1^4 \frac14 \left( \frac{k}{4} \right)^2 = \frac14 \sum_1^4 \frac{k^2}{16} = \frac{1}{64} \sum_1^4k^2 = \frac{1}{64} \cdot \frac{4(4+1)(2\cdot 4 + 1)}{6} = \frac{15}{32}.$$
(Same thing we got in section \ref{area1}. Wow!)
Now imagine the interval being $[a,b]$, and the number of subintervals being any $n$. The picture is
\begin{tikzpicture}[scale=1.4]
\draw (0,0) -- (10,0);
\multido{\n=0+1}{3}{
\draw (\n,-0.25) node[anchor=north]{$x_\n$} -- (\n,0.25);
}
\draw (3, -0.25) node{$...$};
\draw (0,-0.75) node{$a$};
\draw (10,-0.75) node{$b$};
\draw (4,-0.25) node[anchor=north]{$x_k$} -- (4,0.25);
\draw (5, -0.25) node{$...$};
\draw (10,-0.25) node[anchor=north]{$x_n$} -- (10,0.25);
\end{tikzpicture}
and the formulas are
\begin{framed}
$\Delta x = \d \frac{b-a}{n}.$
$x_k = a + k\Delta x$. (So $x_0 = a$, $x_1 = a + \Delta x$, $x_2 = a + 2\Delta x$, $x_3 = a + 3\Delta x$, ... , $x_n = b$.)
The area under $f(x)$ on $[a,b]$ is equal to $\d \lim_{n \to \infty} \left( \sum_{k = 1}^n \Delta x f(x_k) \right)$.
\end{framed}
Now we can find the actual area, perfectly, under a parabola.
\vskip10pt
\textbf{Example:} Use an infinite Riemann sum to find the area under $y = x^2$ on $[0,1]$.
\vskip10pt
We have $\Delta x = \frac{1-0}{n} = \frac1n$, $x_k = 0 + k \left( \frac1n \right) = \frac{k}{n}$, and
\setcounter{equation}{0}
\begin{align}
\text{the area} &= \lim_{n \to \infty} \left( \sum_{k = 1}^n \Delta x f(x_k) \right) \\
&= \lim_{n \to \infty} \left( \sum_{k=1}^n \frac1n f\left( \frac{k}{n} \right) \right)\\
&= \lim_{n \to \infty} \left( \frac1n \sum_{k=1}^n\left( \frac{k}{n} \right)^2 \right)\\
&= \lim_{n \to \infty} \left( \frac1n \sum_{k=1}^n\left( \frac{k^2}{n^2} \right) \right)\\
&= \lim_{n \to \infty} \left( \frac{1}{n^3} \sum_{k=1}^n\left(k^2 \right) \right)\\
&= \lim_{n \to \infty} \left( \frac{1}{n^3} \cdot \frac{n(n+1)(2n+1)}{6} \right)\\
&= \lim_{n \to \infty} \frac{2n^3 + 3n^2 + n}{6n^3}\\
&= \frac26 = \frac13.
\end{align}
Notes on steps: (1) is our definition of an infinite Riemann sum, and as we realized in section \ref{area1}, the error is 0 when $n = \infty$. (2) comes from the partition, i.e., the framed formulas above for $\Delta x$ and $x_k$ where $[a,b] = [0,1]$. In (3), the $\frac{1}{n}$ has been factored out of the sum by the constant multiple rule for sums. In the sum, the variable is $k$, so $n$ is a constant in the sum! Later, when we take the limit, $n$ is not a constant. Also in (3), we used $f(x) = x^2$. (4) is basic algebra, and (5) is factoring out $1/n^2$ which, again, is a constant in the sum. (6) comes from the hard sum formula that we never proved, then FOILing and simplifying gives (7). The final step is to remember your limits at infinity (section \ref{limatinf}).
\section{The Definite Integral} \label{defint}
The indefinite integral (section \ref{antid}) is a function related to derivatives. A \textit{definite integral} is a number representing \textit{net area} under a function. The reason they are both called ``integrals" is the climax, section 5.4.
\begin{framed}
The \textit{definite integral}
$$\int_a^b f(x) \, dx$$
is a number that represents the \textit{net area} (which can be negative) between the function $f$ and the $x$-axis from $x = a$ to $x = b$.
\end{framed}
When $f$ is positive and $a < b$, net area is the same as normal area (the area you are used to, a.k.a. geometric area). However, negative numbers become involved when the function is negative or when $b < a$, so there is a difference between net area and geometric area. In this section, you need to draw a picture to evaluate the integrals, and when the shape is made of rectangles, triangles, and circles, we don't need calculus to find the areas of those shapes. Otherwise, we can use infinite Riemann sums, since
\begin{equation}\label{riemann}
\int_a^b f(x) \, dx = \lim_{n \to \infty} \sum_{k=1}^{\infty} f(x_k)\, \Delta x
\end{equation}
when $f$ is (Riemann) integrable, $\Delta x = \frac{b-a}{n}$, and $x_k = a + k\Delta x$. Looking at the equation (\ref{riemann}) above, you suddenly get some insight into why we write integrals the way we do (which started in section 4.7). The German S integral symbol, $\int$, is like the Greek S (a.k.a Sigma), $\sum$, the $f(x)$ is in both, and the $dx$ is like $\Delta x$ as $\Delta x \to 0$ (see section 3.8).
\vskip10pt
\textbf{Examples:}
\vskip10pt
(a) Find $\d \int_{-2}^3 x \, dx$.
This is the net area between the line $y = x$ and the $x$-axis on $[-2,3]$, so on the left the graph forms a triangle under the axis, where the net area is negative. The area of the red triangle below the axis gets subtracted.
\begin{tikzpicture}
\filldraw[gray] (0,0) -- (3,0) -- (3,3) -- (0,0) ;
\filldraw[red!50!gray] (0,0) -- (-2,0) -- (-2,-2) -- (0,0) ;
\draw (-4,0) -- (4,0) node[anchor=south]{$x$};
\draw (0,-4) -- (0,4) node[anchor=west]{$y$};
\draw[ultra thick, <->] (-4,-4) -- (4,4) node[anchor=west]{$y = x$};
\multido{\n=-3+1}{7}{
\draw (\n, -0.2) -- (\n, 0.2);
}
\draw (3,-.4) node{$3$};
\end{tikzpicture}
Using $\frac12 bh$ for the areas of the triangles, we get
$$\d \int_{-2}^3 x \, dx = \frac12 (3)(3) - \frac12 (2)(2) = \frac52.$$
(b) Evaluate $\d \int_0^3 \sqrt{9-x^2}\, dx$.
The key is to recognize the integrand $f(x) = \sqrt{9-x^2}$ as a semicircle of radius 3 centered at $(0,0)$. On $[0,3]$ we have a quarter circle.
\begin{tikzpicture}
\filldraw[gray] (0,0) -- (3,0) arc (0:90:3cm) -- (0,0) ;
\draw (-4,0) -- (4,0) node[anchor=south]{$x$};
\draw (0,-4) -- (0,4) node[anchor=west]{$y$};
\multido{\n=-3+1}{7}{
\draw (\n, -0.2) -- (\n, 0.2);
}
\draw (3,-.4) node{$3$};
\draw[ultra thick] (3,0) arc (0:180:3cm);
\end{tikzpicture}
Using pie are squared;), we get
$$\int_0^3 \sqrt{9-x^2}\, dx = \frac14 \pi (3)^2 = \frac{9\pi}{4}.$$
(c) Evaluate $\d \int_2^0 (1 - |t-1|) \, dt$.
The \textit{lower limit of integration} 2 is greater than the \textit{upper limit} 0, so we are integrating backwards. (The word ``limit" here is not the same as in chapter 2, it's just a coincidence.) The way the definite integral works, we get a negative. Graph $y = 1 - |x-1|$ using transformations, a precalculus skill.
\begin{tikzpicture}
\draw (0,0) -- (4,0) ;
\draw (2,-2) node[anchor=north]{$y=|x|$} -- (2,2);
\draw[ultra thick, <->] (1,1) -- (2,0) -- (3,1) ;
\draw (5,0) -- (9,0) ;
\draw (7,-2) node[anchor=north]{$y=|x-1|$} -- (7,2);
\draw[ultra thick, <->] (7,1) -- (8,0) -- (9,1) ;
\draw (10,0) -- (14,0) ;
\draw (12,-2) node[anchor=north]{$y=-|x-1|$} -- (12,2);
\draw[ultra thick, <->] (12,-1) -- (13,0) -- (14,-1) ;
\end{tikzpicture}
\begin{tikzpicture}
\filldraw[gray] (0,0) -- (1,1) -- (2,0) -- (0,0);
\draw (-4,0) -- (4,0) node[anchor=south]{$x$};
\draw (0,-4) -- (0,4) node[anchor=west]{$y$};
\draw[ultra thick, <->] (-1,-1) -- (1,1) -- (3,-1) ;
\multido{\n=-3+1}{7}{
\draw (\n, -0.2) -- (\n, 0.2);
}
\multido{\n=-3+1}{7}{
\draw ( -0.2,\n) -- ( 0.2,\n);
}
\draw (3,-.4) node{$3$};
\end{tikzpicture}
\setcounter{equation}{0}
Thus,
\begin{align}
\int_2^0 (1 - |t-1|) \, dt &= \int_2^0 (1 - |x-1|) \, dx\\
&= - \int_0^2 (1 - |x-1|) \, dx \\
&= - \left( \frac12bh\right)\\
&= - \left( \frac12 (2)(1) \right) = -1.
\end{align}
In step (2), I just wanted to illustrate the concept of a dummy variable, particularly important in this chapter. It doesn't matter what the variable is, but the function variable should match the differential (so $t$ matches $dt$ and $x$ matches $dx$). Then (3) comes from the definition of integrating backwards, and (4) uses the area of a triangle, evaluated to get the answer in (5).
\vskip20pt
\textbf{Laws of definite integrals.}
Let $f$ and $g$ be \textit{integrable} functions. The constant multiple law, $\d \int_a^b cf(x)\, dx = c \int_a^bf(x) \, dx, \quad c \text{ const.}$, and sum law, $\d \int_a^b [f(x)+g(x)]\, dx = \int_a^bf(x) \, dx + \int_a^b g(x) \, dx,$ are
connected to the same named laws for limits, derivatives, antiderivatives, and sums. The additive law $\d \int_a^b f(x) \, dx + \int_b^c f(x) \, dx = \int_a^c f(x) \, dx$ is easy to understand (draw a picture) when $a < b < c$, but it actually works for any $a,b,c$ since we can integrate backwards, i.e., $\d \int_a^b f(x) \, dx = - \int_b^a f(x) \, dx$. Also,
$\d \int_a^a f(x) \, dx = 0$, since the width is 0.
\vskip10pt
\textbf{Integrability FAQs}
(which were frequently asked by mathematicians when calculus was young, but which you might not have thought about):
\vskip10pt
\textbf{Q:} By the way, when does this stuff work?
\textbf{A:} In this class, we only have formulas for sum powers 0 to 3. So cubic polynomials are about all we can do without the FTC. If you let the subintervals have different sizes and expand your list of sum formulas you can get exact areas under a larger variety of functions, but it gets gnarly.
\vskip10pt
\textbf{Q:} What functions are integrable?
\textbf{A:} \textit{Integrable} is a serious word in math, a word with specific meaning in the same way ``continuous" and ``differentiable" have specific meaning. \textit{Riemann integrable} means that the upper and lower sums approach one another as the subintervals shrink to width 0. However, modern mathematicians have a better way to integrate, named after Henri Lebesgue who did it in the early 1900s. One way to think of Lebesgue integration is this: Imagine counting your change by just randomly adding it up as it you dig through it, a nickel here (5 cents), a penny there (6), another nickel (11), a dime (21), another penny (now we're at 22 cents, oh wait did I mess up?), etc... VS sorting your change into pennies, nickels, dimes, and quarters, and then counting each category separately and adding the 4 amounts to get the total. The first way is like Riemann integration, and the second way is like Lebesgue integration. The second way is better right? Instead of going along the $x$-axis and adding loads of function values, you divy up the $y$-axis and calculate the \textit{measure} of the sets where the function hits those $y$-values. The \textit{measure} is something that one typically learns about as a first year graduate student, because it is a harder concept than the length of an interval, but Lebesgue integration is probably the way we will be teaching it in 200 years. The Dirichlet function $f(x) = \begin{cases} 1 \text{ if } x \text{ is rational}\\
0 \text{ if } x \text{ is irrational}
\end{cases}$
is Lebesgue integrable but not Riemann integrable.
\vskip10pt
\textbf{Q:} What is the relationship between integrable and continuous?
\textbf{A:} If $f$ is continuous then $f$ is integrable. However, the converse is false. Functions with jump discontinuities are still integrable, and in Calc II you will learn when you can integrate up to a vertical asymptote and when you can't. (Spoiler: For $\frac{1}{x^p}$, $p < 1$ you can and $p \geq 1$ you can't.)
\section{The Fundamental Theorem of Calculus} \label{ftc}
This is the climax. Who would have thought that slope (derivatives) and area (definite integrals) are mathematical inverses? A genius like Isaac Newton, that's who. (He said ``genius is 1\% inspiration and 99\% perspiration," so don't think it was easy for him.) Somehow this fact makes all the advanced science in the world possible, and its discovery has been called the greatest achievement of humankind.
There are different versions of the Fundamental Theorem of Calculus (FTC), and we will prove one of them. The \textit{area function}
$$A(x) = \int_a^x f(t)\, dt$$
represents the area under $f$ on $[a,x]$. So we want the interval to change size as $x$ changes, and we need the dummy variable $t$ in the integral because $x$ is already taken.
\begin{tikzpicture}
\filldraw[gray!50] (0,0) -- (0,2) parabola (1,3) cos (3,2) sin (4,1.5) --(4,0);
\draw (-1,0) -- (5,0);
\draw (0,-0.2) node[anchor=north]{$a$} -- (0,0.2) ;
\draw (4,-0.2) node[anchor=north]{$x$} -- (4,0.2);
\draw[ultra thick] (0,2) parabola (-1,2.5);
\draw[ultra thick] (0,2) parabola (1,3) cos (3,2) sin (4,1.5) cos (5,1) node[anchor=south]{$f$};
\draw[thick, ->] (4.2,-0.4) -- (4.6,-0.4);
\draw[thick, ->] (3.8,-0.4) -- (3.4,-0.4);
\draw (2,1) node{area $A(x)$};
\end{tikzpicture}
The derivative of the area function is $f$. So if you take $f$, stick it in the area function, then take a derivative, you get back to $f$. So areas and derivatives ``cancel"; they're inverses. (\textit{Sound of minds blowing.})
\begin{framed}
\textbf{The FTC, Version 1:}
If $f$ is continuous, and $a$ fixed, then
$$\frac{d}{dx} \int_a^x f(t) \, dt = f(x).$$
\end{framed}
\begin{proof}
We will use the definition of the derivative (section \ref{dfunction}), which you know by heart (right?). Then with the rules of definite integrals from the previous section (\ref{defint}), we break it down.
\setcounter{equation}{0}
\begin{align}
\frac{d}{dx} \int_a^x f(t) \, dt &= \lim_{h \to 0} \frac{\int_a^{x+h} f(t) \, dt - \int_a^x f(t) \, dt}{h}\\
&= \lim_{h \to 0} \frac1h \int_x^{x+h} f(t) \, dt\\
&= \lim_{h \to 0} \frac1h \cdot \left( f(x) \cdot h\right) \\
&= f(x).
\end{align}
Some explanation is needed. Another way to write (1) is $A'(x) = \lim_{h \to 0} \frac{A(x+h) - A(x)}{h}$, which is clearly the definition of the derivative. The thing that makes (1) look strange is that the variable of the area function $A$ is just a little upper limit of integration. The $a$ and $f$ are fixed, and $t$ is a dummy variable. Then (2) comes from the additive law for definite integrals. Symbolically, we know $\int_a^b + \int_b^c = \int_a^c$, so with $b = x$, $c = x+h$ and a subtraction on both sides, this becomes
$$\int_a^x f(t)\, dt + \int_x^{x+h}f(t)\, dt = \int_a^{x+h}f(t)\, dt \Rightarrow \int_x^{x+h}f(t)\, dt = \int_a^{x+h}f(t)\, dt - \int_a^xf(t)\, dt.$$
The key to getting (3) is that $f$ is continuous, and when you focus on a tiny interval (since $h \to 0$), $f$ is basically constant. Without getting too technical, we can believe the picture representing the area $\d \int_x^{x+h} f(t) \, dt$ is basically a super-thin rectangle with width $h$ and height $f(x)$, so its area is basically $f(x) \cdot h$.
\begin{tikzpicture}
\draw (0,0) -- (3,0);
\filldraw[fill=gray!50] (1.4,0) -- (1.4,4.8) -- (1.6,4.85) -- (1.6,0);
\draw[ultra thick] (0,4.7) parabola (3,5.3) node[anchor=south west]{$f$};
\draw (1.4,-0.2) node[anchor=north]{$x$} -- (1.4, 0.2) ;
\draw (1.6,-0.2) -- (1.6, 0.2) ;
\draw[<-] (1.65, -0.25) -- (1.95, -0.55) node[anchor=north west]{$x+h$};
\draw (4,2.5) node{$\d \int_{x}^{x+h} f(t) \, dt \approx f(x) \cdot h$};
\end{tikzpicture}
If you want to get technical we can prove (2) = (3) by using the Mean Value Theorem for Integrals. (The MVT saves the day again!)
Going from (3) to (4) is evaluating an easy limit. Pau.
\end{proof}
That was the climax! However, if you are feeling like you want more, don't worry. There's much, much more. The main way that the FTC is applied is version 2 below, and after that there are bazillions of ways to expand on calculus and explore math further.
\begin{framed}
\textbf{The FTC, Version 2:}
$$\int_a^b f(x) \, dx = F(b) - F(a)$$
where $F' = f$.
\end{framed}
Version 2 is the one that everyone remembers and loves. It makes finding areas under curves quick and easy. The most important skill you learn in this chapter is to use the FTC, Version 2, so you should practice it a lot on homework.
\vskip10pt
\textbf{Examples}
\vskip10pt
\begin{enumerate}[(a)]
\item Find the area under $y = x^2$ on $[0,1]$.
This is a problem we have already tried twice in these notes (once in section 5.1 and again in section 5.2). If you struggled through the upper and lower sum approximations and the infinite Riemann sum, you will really appreciate the power of the FTC.
$$\int_0^1 x^2\, dx = \left[ \frac{x^3}{3} \right]_0^1 = \frac{1^3}{3} - \frac{0^3}{3} = \frac13.$$
(Same answer as before. Wow!)
It is important to use the notation precisely. We write
$$\d \left[ F(x) \right]_a^b = F(b) - F(a)$$ because it looks better and is more efficient, so it makes the FTC look like $\int_a^b f(x) \, dx = \left[ F(x) \right]_a^b.$
Now you see why definite integrals and indefinite integrals are related, since $\int f(x) \, dx = F(x) + C$ and $\int_a^b f(x) \, dx = \left[ F(x) \right]_a^b$. It doesn't matter if you put the $+C$ when evaluating definite integrals, since
$$\left[ F(x) + C \right]_a^b = (F(b) + C) - (F(a) + C) = F(b) + C - F(a) - C = F(b) - F(a) = \left[ F(x) \right]_a^b,$$ but don't forget it for indefinite integrals.
\vskip20pt
\item
$\d \int_2^7 4 \, dv = \left[ 4v \right]_2^7 = 4(7) - 4(2) = 20$
\vskip20pt
\item
$\d \int _1^2\frac1{x^2}\,dx= \int _1^2x^{-2}\,dx=\left[\frac{x^{-1}}{-1}\right]_1^2=\left[\frac{-1}{x}\right]_1^2=\left(-\frac12\right)-\left(-\frac11\right)=-\frac12+1=\frac12$\\
\\
\item Find the geometric area between the $x$-axis and the graph of $y = x^3 + x^2 - 2x$ on $[-2,1]$.
This question throws students off, but it has been on the final exam in the past so study it carefully. You have to remember that definite integrals are \textit{net area}, not geometric area, so you can't just integrate from $-2$ to $1$ and get the answer. You have to sketch it. Factor and use your precalculus skills.
\includegraphics[width=3in]{205lecture54.pdf}
Integrating from $-2$ to $0$ gives geometric area since $f$ is positive there. However, the graph is negative between $0$ and $1$, so when you integrate there you get a negative number. The actual area is the absolute value of that negative number. So the answer is
\begin{align*}
\int_{-2}^0 (x^3+x^2 - 2x)\, dx + \left| \int_0^1 (x^3 + x^2 - 2x)\, dx \right|
&= \left[ \frac{x^4}{4} + \frac{x^3}{3} - x^2 \right]_{-2}^0 + \left| \left[ \frac{x^4}{4} + \frac{x^3}{3} - x^2 \right]_0^1 \right| \\
&= 0 - \left(4 - \frac83 - 4\right) + \left| \frac14 + \frac13 - 1 \right| \\
&= \frac83 + \left| \frac{-5}{12} \right|\\
&= \frac83 + \frac{5}{12}\\
&= \frac{37}{12} .
\end{align*}
\end{enumerate}
\section{$u$-Substitution}
The last two sections in Calc I give us a little more power with our definite integrals. Calc II is devoted primarily to integration, so there is still a lot more to be learned. So far, our antiderivatives are all from the Power Rule, Sum Rule, and Constant Multiple Rule. However, every derivative rule (in chapter 3) can be reversed to make an antiderivative rule, and in Calc II you will learn Integration by Parts (the reverse Product Rule). It turns out the Reverse Chain Rule is easier, so we learn that now.
Recall that the Chain Rule says
$$\frac{d}{dx} f(g(x)) = f'(g(x)) g'(x) \qquad \text{ or } \qquad \frac{dy}{dx} = \frac{dy}{du} \frac{du}{dx}.$$
If $u = g(x)$ and the composition $f(g(x))$ is continuous, then
$$\int f(g(x)) g'(x) \, dx = \int f(u) \, du,$$
because $\d g'(x) \, dx = \frac{du}{dx} \, dx = du$. The derivative notation $\frac{dy}{dx}$ and differential notation ($dx \approx \Delta x$, section 3.8) work neatly here.
\vskip10pt
\textbf{Example:}
$$ \int (x^3 - 1)(3x^2) \, dx = \frac{(x^3 - 1)^2}{2} + C.$$
I did that one in my head. You can too, if you are good at the Chain Rule. Remember from section 4.7 that you should never get an antiderivative wrong because you can check by taking the derivative:
$$\frac{d}{dx} \frac{(x^3 - 1)^2}{2} = \frac12 \cdot 2(x^3 - 1)^1(3x^2)= (x^3 - 1)(3x^2).$$
The $3x^2$ comes from the Chain Rule, and luckily it was just sitting there in the integral, making it easy to reverse in my head. Thankfully, we don't always have to do integrals in our head. There is a nice protocol to follow that makes it straightforward. For $\int (x^3 - 1)(3x^2) \, dx$, we let $u = x^3 -1$. Then $\d \frac{du}{dx} = 3x^2$, so $du = 3x^2\, dx$. Straightforward substitution gives $\int (x^3 - 1)(3x^2) \, dx = \int u\, du$, and $\int u \, du = \frac{u^2}{2} + C$, so substituting the original variable $x$ back in gives $\frac{(x^3-1)^2}{2} + C$.
Let's write that down step-by-step.
\begin{framed}
\textbf{$u$-Substitution}
1. Choose $u$. (Different choices are possible, but it won't work if you make the wrong choice. Usually its the thing in parentheses. Sometimes you have to fail and try something else.)
2. Calculate $du$. (If $u = g(x)$, then $du = g'(x) \, dx$. Don't forget the $dx$, and review section 3.8 if you think $du$ is the derivative--it's not!)
3. Substitute as in $$\int f(g(x)) g'(x) \, dx = \int f(u) \, du.$$ (You might have to insert a multiplicative constant, using the Constant Multiple Rule. Some students like to solve for $dx$ and simply plug that in, hoping the $g'(x)$ will cancel.)
4. Integrate. (For indefinite integrals, give the answer in terms of the original variable, $x$. For definite integrals, change the limits of integration and you don't have to go back to $x$.)
\end{framed}
Note that all the variables are dummy variables, so even though ``$u$-substitution" is what I usually say (or just ``$u$-sub" to be cool), there is nothing special about the letter $u$.
\vskip10pt
\textbf{Examples:}
\vskip10pt
Off to the side, show $u$ and $du$ every time. I do it in parentheses under the integral in these examples. Check by differentiating.
\begin{enumerate}[(a)]
\item $\d \int (x^2-1)^6(2x)\,dx=\int u^6\,du=\frac{u^7}7=\frac{(x^2-1)^7}{7}+C$\\
($\d u=x^2-1, \frac{du}{dx}=2x\Rightarrow du=2x\,dx$)\\
Check: $\d \frac{d}{dx}\left(\frac{(x^2-1)^7}{7}+C\right)=\frac17\cdot 7(x^2-1)^6(2x)=(x^2-1)^6(2x)$\\
\\
\item \label{const}
$\d \int (4x^2+3)^3 x\, dx = \int u^3 \, \frac{du}{8} =
\frac18 \int u^3 \, du = \frac18 \cdot \frac{u^4}{4} + C =
\frac18\cdot \frac{(4x^2+3)^4}{4} + C
= \frac{(4x^2+3)^4}{32} + C
$
($\d u=4x^2+3, \frac{du}{dx}=8x\Rightarrow \frac{du}8=x\,dx$)\\
Check: $\d \frac{d}{dx}\left( \frac{(4x^2+3)^4}{32} + C\right)=\frac1{32}\cdot 4(4x^2+3)^3(8x)=x(4x^2+3)^3$\\
\\
Example (\ref{const}) is the first where we need to use the constant multiple rule. Since $du = 8x \,dx$, we have a factor of 8 to deal with. The way I did it above is to solve for $x \, dx$, since that matches what we have in the given integral. Another way to do it is to solve for $dx$ completely, which some students prefer. I don't, because you get denominators that make the differential undefined, so there is a technical issue. If you do it by solving for $dx$ completely, I won't deduct points, but I will steer clear of that in these notes.
\item
$\d \int t^2\left(t^3-2\right)\,dt= \int \left(t^5-2t^2\right)\,dt= \frac{t^6}6-\frac{2t^3}{3}+C$\\
(If you can perform an integration without substitution, you should. But you should try to get the same answer using $u = t^3 - 2$.)\\
\\
\section{The Area Between Two Curves}
This is a natural idea, and very important as it is (A) useful; and (B) leads to bigger and better things like the volume of a solid of revolution (Calc II). Hark back to section \ref{area1}, where we drew rectangles under a graph. The following picture illustrates a rectangle between two graphs.
\begin{tikzpicture}
\draw[thick] (-3,0) -- (3,-1) node[anchor=west]{$g$};
\draw[thick] (3,1) node[anchor=west]{$f$} arc (75:100:14);
\draw (0,-0.5) rectangle (0.4,1.45);
\draw[decorate,decoration={brace,amplitude=6pt}] (0.5,1.4) -- (0.5,-0.45);
\draw (0.8,0.4) node[anchor=west]{$f(x) - g(x)$ length};
\draw (0.22,-0.8) node{$\Delta x$};
\draw (0.22,-1.2) node{width};
\end{tikzpicture}
The idea is that rectangle height (a.k.a. length, above) is ``top minus bottom," and width is $\Delta x$, so the rectangle's area is $[f(x) - g(x)] \Delta x$. As we add up infinitely many infinitesimally thin rectangles, we think $\Delta x \approx dx$ and we get the integral formula below.
\begin{framed}
If $f(x) \geq g(x)$ on $[a,b]$, then the area between the curves on $[a,b]$ is
$$\int_a^b [f(x) - g(x)]\, dx.$$
\end{framed}
\textbf{Example:} Find the area of the region bounded by $y = x+2$ and $y = x^2$.
\vskip10pt
You need to draw the graphs to see the region. The trickiest part of these problems is typically not the calculus, but the drawing and finding points of intersection.
\begin{tikzpicture}[scale=0.9]
\draw (-5,0) -- (5,0);
\draw (1,-0.5)--(1,0.5);
\draw (2,-0.5)--(2,0.5);
\draw (3,-0.5)--(3,0.5);
\draw (4,-0.5)--(4,0.5) node[anchor=west]{$x$};
\draw (-1,-0.5)--(-1,0.5);
\draw (-2,-0.5)--(-2,0.5);
\draw (-3,-0.5)--(-3,0.5);
\draw (-4,-0.5)--(-4,0.5) ;
\draw (0,-4) -- (0,5);
\draw (-0.5,1)--(0.5,1);
\draw (-0.5,2)--(0.5,2);
\draw (-0.5,3)--(0.5,3);
\draw (-0.5,4)--(0.5,4) node[anchor=south]{$y$};
\draw (-0.5,-1)--(0.5,-1);
\draw (-0.5,-2)--(0.5,-2);
\draw (-0.5,-3)--(0.5,-3);
\filldraw[red] (0,0) parabola (2,4) -- (-1,1);
\filldraw[red] (0,0) parabola (-1,1);
\draw[ultra thick, <->] (-3,-1) -- (3,5) node[anchor=west]{$y=x+2$};
\draw[ultra thick, ->] (0,0) parabola (-2.5,6.25);
\draw[ultra thick, ->] (0,0) parabola (2.5,6.25) node[anchor=west]{$y = x^2$};
\end{tikzpicture}
To find the points of intersection, we set the two functions $f(x) = x+2$ and $g(x) = x^2$ equal to each other.
$$x+2 = x^2 \Rightarrow x^2 - x - 2 = 0 \Rightarrow (x-2)(x+1) = 0 \Rightarrow x = 2, -1.$$
Hence, the area between the curves is
\begin{align*}
\int_{-1}^2 [f(x) - g(x)]\, dx &= \int_{-1}^2 [x+2-x^2]\, dx\\
&= \left[ \frac{x^2}{2} + 2x - \frac{x^3}{3} \right]_{-1}^2 \\
&= 2 + 4 - \frac83 - \left(\frac12 -2 + \frac13 \right)\\
&= 4.5.
\end{align*}
One last little trick before we send you off to Calc II, where you will learn to find volumes of solids of revolution. It will become important for you to be able to rotate the problem we just did 90 degrees. Precalculus teaches you about the vertical line test (v.l.t.) for functions of $x$. We want to consider functions of $y$, which pass the horizontal line test (h.l.t.). A graph that passes both the v.l.t. and the h.l.t. can be written as either a function of $x$ or $y$, like, for example, $y = \sqrt[3] x$, which is identical to $x = y^3$. In some cases, it is better to think of sideways rectangles, and integrate with respect to $y$.
\vskip10pt
\begin{tikzpicture}
\draw[thick] (1,0) node[anchor=north]{$x = g(y)$} sin (1.5,5);
\draw[thick] (5,0) node[anchor=north]{$x = f(y)$} .. controls (6,1) and (4,4).. (5,5);
\draw (1.15,2.2) rectangle (5.05,2.6);
\draw[decorate,decoration={brace,amplitude=6pt}] (5,2.1) -- (1.2,2.1);
\draw (3,1) node{length $f(y) - g(y)$} ;
\draw (6,2.4) node{$\Delta y$ width};
\end{tikzpicture}
\vskip10pt
Instead of using ``top minus bottom", you use ``right minus left," and integrate along the appropriate vertical interval $[c,d]$. The integral formula becomes
$$\int_c^d [f(y) - g(y)] \, dy.$$
\textbf{Example.} Find the area of the region bounded by the $x$-axis, $y = x^3$, and $x = 2 - y^2$ for $y \geq 0$.
\vskip10pt
Sketch it all. If you have trouble with $x = 2 - y^2$, plot points by picking $y$-values and generating $x$s. With practice you should be able to do this kind of thing quickly (if you can do $y = 2 - x^2$ quickly, the one we want is just a reflection about the diagonal.)
\begin{tikzpicture}[scale=1.5]
\draw (-4,0) -- (4,0);
\draw (1,-0.25)--(1,0.25);
\draw (2,-0.25)--(2,0.25);
\draw (3,-0.25)--(3,0.25) node[anchor=west]{$x$};
\draw (-1,-0.25)--(-1,0.25);
\draw (-2,-0.25)--(-2,0.25);
\draw (-3,-0.25)--(-3,0.25);
\draw (0,-3) -- (0,4);
\draw (-0.25,1)--(0.25,1);
\draw (-0.25,2)--(0.25,2);
\draw (-0.25,3)--(0.25,3) node[anchor=south]{$y$};
\draw (-0.25,-1)--(0.25,-1);
\draw (-0.25,-2)--(0.25,-2);
\filldraw[red] (0,0) .. controls (0.6,0) and (1,0.5) .. (1,1) .. controls (1.1,0.9) and (2,0.5) .. (2,0);
\draw[ultra thick,<->] (-4,0) -- (4,0);
\draw[ultra thick, <-] (-1.3,-2.2) .. controls (-1,-1) and (-1,0) .. (0,0);
\draw[ultra thick, <-] (1.3,2.2) node[anchor=south]{$y = x^3$} .. controls (1,1) and (1,0) .. (0,0);
\draw[ultra thick, <-] (-2,2) node[anchor=south]{$x = 2-y^2$ for $y \geq 0$} ..controls (-1.5,2) and (2,1) .. (2,0);
\end{tikzpicture}
We want to write the curves as functions $y$. So the right boundary of the region is $f(y) = 2 - y^2$, and the left boundary is $x=g(y) = \sqrt[3]{y}$.
The key point of intersection is when $2 - y^2 = \sqrt[3]{y}$, which is hard to solve, but in the picture it looks like $(1,1)$ and it is, which is easy to check by verifying that $(1,1)$ is on both graphs. The bottom of the region is $y = 0$, and the top is at $y = 1$, so the area is
\begin{align*}
\int_0^1 [f(y) - g(y)] \, dy &= \int_0^1 [2 - y^2 - \sqrt[3]{y}]\, dy\\
&= \left[ 2y - \frac{y^3}{3} - \frac34 y^{4/3} \right]_0^1\\
&= 2 - \frac13 - \frac34 \\
&= \frac{11}{12}.
\end{align*}
Congratulations on completing Calculus I!!
\end{enumerate}
\end{document}