curve(sin(x)/x, from = -2.5, to = 2.5)
The topics discussed in the previous chapter are part of what is called precalculus. They provide the foundation for calculus, but they are not calculus. Now we are ready for an important new idea, the notion of limit. It is this idea that distinguishes calculus from other branches of mathematics. In fact, we define calculus this way:
Calculus is the study of limits.
The concept of limit is central to many problems in the physical, engineering, and social sciences. The general question is:
what happens to the function \(f(x)\) as \(x\) gets close to some constant \(c\)?
Here is what we’d like to understand: what does \(f(x)\) look like when \(x\) is really really close to \(c\), but not equal to \(c\)?
Heuristic examples:
From average speed to instantaneous speed.
To give meaning to this “instantaneous” velocity we must talk about the limit of the average speed over smaller and smaller intervals.
From the area of a polygon to the area of the circle.
The area of the circle is the limit of the areas of the inscribed polygons as \(n\) (the number of sides in the polygon) increases without bound.
Example function \[f(x)=\frac{x^3-1}{x-1}\] what is happening to \(f(x)\) as \(x\) approaches \(1\)?
In mathematical symbols, we write \[\lim_{x\rightarrow 1}\frac{x^3-1}{x-1}=3\]
First look at several trivial but important examples:
Example 1, page 73. Yes, just substitute, and add the key word “near”.
Example 2, page 73. Dealing with the undefined point – Factoring and Cancellation.
Example 3, page 73. An important result that worth memorizing. \[\lim_{x\to 0}\frac{\sin x}{x}=1\]
We will give a rigorous demonstration in Section 2.5.
curve(sin(x)/x, from = -2.5, to = 2.5)
Calculator may fool you and mislead you to a wrong answer.
Example 4, page 74. Find \[\lim_{x\to 0}\left[x^2-\frac{\cos x}{10000}\right]\]
# A replication of table in figure 6, page 74.
x <- seq(1, 0, by= -0.1)
f <- x^2-cos(x)/10000
plot(f, type = "o")
f [1] 0.99994597 0.80993784 0.63993033 0.48992352 0.35991747 0.24991224
[7] 0.15990789 0.08990447 0.03990199 0.00990050 -0.00010000
Both graph and calculation tale suggest that the limit is \(0\). But this is wrong! Here is the correct way
Example 5, page 74. Integer function has steps, thus no limit at a jump.
\[ \lim_{x\to 2}[x] \]
Even though we write out the limit form, it does not mean it exists.
Example 6, page 74. Wiggles never get stable, no limit. e.g., \(\lim_{x\to 0}\sin (1/x)\)
curve(sin(1/x), -1/pi, 1/pi)
Recall the integer function, and answer if \(\lim_{x\to 2}[x]\) exist. The answer is DNE.
The limit does not exist at the jump points. Such functions suggest the introduction of one-sided limits.
Let the symbol \(x\to c^+\) mean that \(x\) approaches \(c\) from the right, and let \(x\to c^-\) mean that \(x\) approaches \(c\) from the left.
Illustration in Figure 10: Two of the limits do not exist, although all but one of the one-sided limits exist.
N.B. The real number \(\epsilon\) must be given first; the number \(\delta\) is to be produced, and it will usually depend on \(\epsilon\). To prove a limit is to find such \(\delta\) in terms of \(\epsilon\).
Example 2, page 79.
Example 4, page 80. This example will be used in proof of theorem A in section 2.3.

N.B. Theorem A remains true for one-sided limits.
Example 1 & 2, page 84. Example 3 & 4, page 85. Apply theorem A.
First recall the definitions of polynomial function and rational function, page 85.
When we apply Theorem B, the Substitution Theorem, we say we evaluate the limit by substitution. e.g., Example 5, page 85.
Not all limits can be evaluated by substitution. For Example, find
\[\lim_{x\to 2}\frac{x^2+3x-10}{x^2+x-6}\]
Theorem B does not apply because the denominator is \(0\) when \(x=2\). The function above can be simplified by factoring, we still need one more theorem to help us find the result.
Once we apply Theorem C, \[\lim_{x\to 2}\frac{x^2+3x-10}{x^2+x-6}=\lim_{x\to 2}\frac{(x-2)(x+5)}{(x-2)(x+3)}=\lim_{x\to 2}\frac{x+5}{x+3}\] we can evaluate the limit by substitution.
Comments: You may also consider this example as rationalizing the denominator by multiplying the conjugate. \[\lim_{x\to 1}\frac{x-1}{\sqrt x -1}=\lim_{x\to1}\frac{(x-1)(\sqrt x+1)}{(\sqrt x -1)(\sqrt x+1)}=\lim_{x\to1}\frac{(x-1)(\sqrt x+1)}{x-1}=\lim_{x\to1}(\sqrt x+1)=2\]
The proof of Theorem A, Statement1-5. (Optional, rigorous definition in sec 2.2 is the prerequisite.)
N.B. The Squeeze Theorem (Sandwich Theorem) is a powerful tool that will help you find the limit.
Proof is optional, based on the rigorous definition of the limit.
Example 9, page 88. Revisit the important limit result, now we apply Theorem D and obtain the same result.
The deepest problems and most profound paradoxes of mathematics are often intertwined with the use of the concept of the infinite. We have already used the symbols \(\infty\) and \(\infty\) in our notation for certain intervals. e.g., \((3, \infty)\) denotes the set of all real numbers greater than \(3\).
N.B. We have never referred to \(\infty\) as a number, which means \(\infty\) can never be operated as a number. For example, we have never added it to a number or divided it by a number.
In symbols, we ask for the value of \(\lim_{x\to \infty} g(x)\). In plain English, we are asking “What happens to \(g(x)\) as \(x\) gets larger and larger?”
a <- 1:10^5
x <- 10^a
# x/(1+x^2)
curve(x/(1+x^2), -100, 100, lwd=2)
abline(h=0, col="grey", lwd=2)
N.B. When we write \(x\to \infty\) we are not implying that somewhere far, far to the right on the x-axis there is a number—bigger than all other numbers—that x is approaching. Rather, we use \(x\to \infty\) as a shorthand way of saying that \(x\) gets larger and larger without bound.
Example 1, page 90.
Now we show the second statement to complete the whole proof. To show that if \(k\) is a positive integer, then \[\lim_{x\to -\infty}\frac{1}{x^k}=0\]
Let \(\epsilon > 0\) be given. Based on the preliminary analysis, as \(x\) goes to the negative extreme, without loss of generality, considering the case that \(k\) is odd, \(x<M\) implies \(\frac{1}{x^k}>\frac{1}{M^k}\). Comparing to \(\left|\frac{1}{x^k}-0\right|<\epsilon\), thus \(\frac{1}{x^k}>-\epsilon\), so we choose \(M=-\sqrt[k]{1/\epsilon}\).
Then \(x<M\) implies that \[\left|\frac{1}{x^k}-0\right|=\left\{\begin{aligned}-\frac{1}{x^k}< -\frac{1}{M^k}=\epsilon, \quad k \text{ is odd} \\\frac{1}{x^k}< \frac{1}{M^k}=\epsilon, \quad k \text{ is even}\end{aligned}\right.\] Q.E.D.
Example 2 & 3, page 91. A standard trick: divide the numerator and denominator by the highest power of x that appears in the denominator. (For the limit at infinity.)
A sequence is a collection of numbers in order. It is a special function with domain of positive integers, \(\{1,2,3,\ldots\}\). Therefore, we usually use \(a_n\) rather than \(a(n)\) to denote the \(n\)th term of a sequence, and use \(\{a_n\}\) to denote the whole sequence.
N.B. The Main Limit Theorem (Theorem 2.3 A) holds for sequences, since the sequence is a function of positive integers, which is regarded as a special case of the function of real values.
Example 4, page 91. We still can apply Theorem 2.3 A.
Although we focus our interest on finite limit, it is reasonable to give a symbol to the infinite limits. As shown in figure 6, it makes no sense to talk about \(\lim_{x\to 2}1/(x-2)\), but we think it is reasonable to write \[\lim_{x\to 2^-}\frac{1}{x-2}=-\infty, \text{ and }\lim_{x\to 2^+}\frac{1}{x-2}=\infty\]
The line \(x=c\) is a vertical asymptote of the graph of \(y=f(x)\) if any of the following four statements is true.
The line \(y=b\) is a horizontal asymptote of the graph of \(y=f(x)\) if either \[\lim_{x\to\infty}f(x)=b\quad\text{or}\quad\lim_{x\to-\infty}f(x)=b\]
Example 7, page 93. Tricks: We often have a vertical asymptote at a point where the denominator is zero. Horizontal asymptote can be found by taking the limit to infinity.
Therefore, the graph of \(y=\frac{2x}{x-1}\) has a vertical asymptote at \(x=1\) and a horizontal asymptote at \(y=2\) as shown in Figure 8.
This substitution rule applies to the trigonometric functions as well.
(Proof of Statement 1 & 2, page 95, not covered but good to know.)
N.B. Important limit results. We will make explicit use of these two limit statements in Chapter 3. (Proof details shown on board in class.)
Proof of 1.
Proof of 2.
Using statement 1, we just multiply the numerator and denominator by \(1+\cos t\),
Example 3, page 97. Sketch the graphs of \(u(x)=|x|, l(x)=-|x|\) and \(f(x)=x\cos(1/x)\). Use the graphs along with the Squeeze Theorem to determine \(\lim f(x)\).
# fig 3, example 3, page 97
curve(x*cos(1/x), -1,1, col="blue", lwd=1.5)
curve(abs(x), -1, 1, add = TRUE, lwd=2)
curve(-abs(x), -1, 1, add = TRUE, lwd=2 )
abline(h=0, v=0, col="grey")
Since the graph of \(y=f(x)=x\cos(1/x)\) is “squeezed” between the graphs of \(u(x)\) and \(l(x)\), both of which go to \(0\) as \(x\to 0\). we can apply the Squeeze Theorem to determine \(\lim_{x\to 0}f(x)=0\).
Theorem A,Properties of Exponential and Logarithmic Functions on page 99, has been reviewed in Section 1.7, i.e., Theorem A and Theorem B.
Note that the limits of logarithmic functions is an analogous theorem for logarithm as the inverse of exponential functions. We have Theorem C to guarantee the limits for the inverse of general functions.
(Proof is optional and skipped.)
Example 1, page 100. Sketch the graph of exponential and logarithmic functions to help you memorize the theorem and have an intuitive impression of the limit of a function.
curve((3/2)^(x^2), 0, 8)
curve(log2(1/x),0,10^6)
N.B. The limit in this definition is the same, whether we regard \(n\) as a natural number, the limit then being the limit of a sequence, or as a real number.
Another way to specify \(e\) is to say \[e=\lim_{h\to 0}(1+h)^{1/h}\]
Thus, \[\lim_{n\to \infty}\left(1+\frac{r}{n}\right)^n=\lim_{n\to \infty}\left[\left(1+\frac{r}{n}\right)^{n/r}\right]^r=e^r\]
Application in economics: the continuous compounded interest. The amount of money after one year is \(A(1)=A_0 e^r\). In general, after \(t\) the amount of money is \[A(t)=A_0 e^{rt}\]
Let’s suppose you have a bank account at a bank that pays interest at a generous rate of 12% annually, compounded once a year. You put in an initial deposit; every year, your fortune increases by 12%. This means that after n years, your fortune has increased by a factor of \((1+0.12)^n\). In particular, after one year, your fortune is just \((1 + 0.12) = 1.12\) times the original amount. If you started with $100, you’d finish the year with $112.
Now suppose you find another bank that also offers an annual interest rate of 12%, but now it compounds twice a year. Of course you aren’t going to get 12% for half a year; you have to divide that by 2. Basically this means that you are getting 6% interest for every 6 months. So, if you put money into this bank account, then after one year it has compounded twice at 6%; the result is that your fortune has expanded by a factor of \((1+0.06)^2\), which works out to be 1.1236. So if you started with $100, you’d finish with $112.36.
The second account is a little better than the first. It makes sense when you think about it—compounding is beneficial, so compounding more often at the same annual rate should be better. Let’s try 3 times a year at the annual rate of 12%. We take 12% and divide by 3 to get 4%, then compound three times; our fortune has increased by \((1 + 0.04)^3\), which works out to be 1.124864. This is a little higher still. How about 4 times a year? That’d be \((1 + 0.03)^4\), which is approximately 1.1255. That’s even higher. Now, the question is, where does it stop? If you compound more and more often at the same annual rate, do you get wads and wads of cash after a year, or is there some limitation on all this? The answer is
\[\lim_{n\to \infty}\left(1+\frac{0.12}{n}\right)^n\]
Therefore, suppose you start with $A in cash and put it in a bank account which compounds continuously at an annual interest rate of \(r\). After one year, you’ll have $\(Ae^r\). After two years, you’ll have $\(Ae^r \times e^r = Ae^{2r}\).
N.B. It’s easy to keep repeating this and see that after \(t\) years, you’ll have $\(Ae^{rt}\).
Example 2, page 102. Part (a), just apply the formula. Part (b), we need natural logarithm functions.
Example 3, page 102. Part (a), this is just the limit of a polynomial in h, given the fixed exponent. So we evaluate it by substitution. Part (b), with some manipulation we can apply the formula.
Example 5, page 103. Review and apply the change of base formula.
curve(log(x, base = 5), 0, 10)
abline(h=0, col="grey")
These are actually exponential functions in disguise. We won’t be using them much but they do come up occasionally, so it’s good to be familiar with them.
In both mathematics and science, certain combinations of \(e^x\) and \(e^{-x}\) occur so often that they are given special names.
No triangles needed! This isn’t trigonometry, after all.
Convince yourself and verify this identity, \[\cosh^2 x -\sinh^2 x=1\]
Convince yourself that sinh is an odd function, cosh is an even function. And tanh is an odd function and sech is an even function.
The hyperbolic sine (sinh) and hyperbolic tangent (tanh) are increasing functions, in figure 8, and automatically have inverses.
To obtain inverses for hyperbolic cosine (cosh) and hyperbolic secant (sech), we restrict their domains to \(x\geq 0\).
Then solving for \(x\) and interchanging the roles of \(x\) and \(y\), we obtain
In mathematics and science, we use the word continuous to describe a process that goes on without abrupt changes. In fact, our experience leads us to assume that this is an essential feature of many natural processes.
If any one of these three fails, then f is discontinuous at \(c\).
Example 1, page 107. The key idea is they both exist, and are equal. A removable point of discontinuity at \(x=2\).
A point of discontinuity \(c\) is called removable if the function can be defined or redefined at \(c\) so as to make the function continuous. Otherwise, a point of discontinuity is called nonremovable.
as shown in figure 3 and 4, page 108.
Do the standard function operations preserve continuity? Yes, according to the next theorem.
Example 2, page 109. If all the functions used for combination are continuous on the natural domain, so does the combination.
Transcendental functions include exponential and logarithmic functions, trigonometric and hyperbolic functions and their corresponding inverse. By interior, we mean the interval, excluding the endpoints.
Example 3, page 109. \(x=0, 1\) are the points of interest. Check them using the definition of continuity.
Proof is optional. Note that \(t\) is a dummy variable in \(f(\cdot)\), you could change the \(t\) to any letter you like and it means the same thing.
For the first statement in textbook (Optional).
For the second statement, we have a stronger condition: since \(g\) is continuous at \(c\), and we know at \(c\), \(f(\cdot)\) has a limit \(L\), thus, the limit \(L=g(c)\). Therefore, by the first statement \[\lim_{x\to c}f(g(x))=f(g(c)),\] i.e., \(f\circ g\) is continuous at \(c\).
N.B. If \(f\) and \(g\) are both continuous everywhere in their domain, the composition \(f\circ g\) is continuous too.
Example 4, page 110. Continuous at each real number c in the domain.
Continuity on an interval ought to mean continuity at each point of that interval. This is exactly what it does mean for an open interval. We also consider a closed interval, and summarize in a formal definition.
Example 6, page 111.
Example 7, page 111. Continuous on its natrual domain. You may find a graph is helpful – No jump point on the domain. Check the endpoints.
curve(sqrt(4-x^2), -2,2)
Example 8, page 112. That is asking if arccos is continuous on its domain. Check the endpoints.
curve(acos(x), -1, 1)
abline(h=0, v=0, col="grey")
N.B. Intuitively, for \(f\) to be continuous on \([a,b]\) means that the graph of \(f\) on \([a,b]\) should have no jumps, so we should be able to “draw” the graph of from the point \((a, f(a))\) to the point \((b, f(b))\) without lifting our pencil from the paper.
This property is stated more precisely in Theorem F.
In other words, \(f\) takes on every value between \(f(a)\) and \(f(b)\).
N.B. Continuity is needed and sufficient for this theorem. The converse of this theorem is not true in general.
Example 9, page 113.
First of all, sketch the graph of \(f(x)=x-\cos x\), we see the curve goes through x-axis. So it does have a solution. Rigorously, by IVT, \(W=0\) is between \(f(0)\) and \(f(\pi/2)\).
Comments: Bisection methods is an iterative root-finding procedure. You’ll come across it again if you take scientific computing (or computational statistics) class where the steps of this algorithm and coding in computer language will be covered in details.
curve(x-cos(x), 0, pi/2)
abline(h=0, col="red")
The bisection method is an iterative root-finding procedures. For example, our goal is to find the root of \[g(x)=\frac{1+1/x-\log x}{(1+x)^2}=0\] The intermediate value theorem tells us that if \(g(x)\) is continuous on \([a_0, b_0]\) and \(g(a_0)g(b_0)\leq 0\) then there exists at least one \(x^* \in [a_0, b_0]\) for which \(g(x^*)=0\).
To find this \(x^*\), the bisection method systematically shrinks the interval from \([a_0, b_0]\) to \([a_1, b_1]\) to \([a_2, b_2]\) and so on, where \([a_0, b_0]\supset [a_1, b_1]\supset [a_2, b_2] \supset ...\) and so forth.
Let the initial value \(x^{(0)} = (a_0 + b_0)/2\). The updating equations are
\[[a_{t+1},b_{t+1}]=\left\{\begin{aligned} \left[a_t, x^{(t)}\right] \quad\text{ if } g(a_t)g(x^{(t)})\leq 0 , \\ \left[ x^{(t)},b_t\right] \quad \text{ if }g(a_t)g(x^{(t)})> 0 \end{aligned}\right.\]
and \[x^{(t+1)}=\frac{1}{2}(a_{t+1}, b_{t+1}).\]
If \(g\) has more than one root in the starting interval, it is easy to see that bisection will find one of them, but will not find the rest.
## INITIAL VALUES
a = 1
b = 5
x = a+(b-a)/2
itr = 40
## FUNCTIONS
g = function(x){log(x)/(1+x)}
g.prime = function(x){(1+(1/x)-log(x))/((1+x)^2)}
## MAIN
for (i in 1:itr){
if (g.prime(a)*g.prime(x) < 0) {b = x}
else {a = x}
x = a+(b-a)/2
}
## OUTPUT
x # FINAL ESTIMATE[1] 3.591121
g(x) # OBJECTIVE FUNCTION AT ESTIMATE[1] 0.2784645
g.prime(x) # GRADIENT AT ESTIMATE[1] -1.121895e-14
Example 10, page 113.