You already know how to differentiate and integrate. This course is about why it all works. It rebuilds calculus from the real numbers up, proving each result before using it, until every topic in the IB Analysis and Approaches HL calculus syllabus has been derived rather than memorised.
19 modules · about 140 hours · 229 exercises with full solutions · 8 interactive graphs
f'(a) = \lim_{h\to0}\frac{f(a+h) - f(a)}{h}
Why first principles, and why now
At NTNU the first-semester calculus course for fysmat (TMA4401 Matematikk 1D: Kalkulus in the current study plan) starts where IB stops. Its syllabus opens with the real numbers, sequences and convergence, countability, the Intermediate and Extreme Value Theorems and the Mean Value Theorem, and it ends with Taylor’s theorem, convergence tests, power series, and existence and uniqueness for differential equations. The exam is four hours with no notes. Students who arrive knowing why the rules hold find that first semester familiar; students who only know the rules find it a different subject.
This course closes that gap during your gap year. It covers every AAHL calculus topic (the syllabus map shows where), but in a logical order built on definitions and proofs, with the extra material that NTNU adds marked Beyond IB.
The spine of the course
Almost everything rests on one axiom about the real numbers. Follow the arrows to see which theorem is used to prove which.
Every module opens with a big question, then builds the answer from definitions, with every theorem proved unless it is clearly marked. The boxes follow the conventions of a university textbook:
Definition
The precise meaning of a term. These are what you quote at the start of a proof.
Theorem
A result, followed by its proof. Proofs end with ∎.
Example
A worked computation or argument, usually in IB exam style.
Pitfall
A common mistake, and why it is one.
Taken on trust
The few results stated without full proof (such as the construction of the real numbers). Being honest about these is part of the point.
Beyond IB
Material that goes past the IB syllabus because NTNU will expect it.
Norwegian terms are marked grenseverdi wherever a concept is introduced, so the vocabulary of Norwegian lectures is familiar before you hear it. All of them are collected in the glossary.
Exercises come in three tiers. Try each for at least fifteen minutes before opening the solution; a solution read too early teaches very little.
FluencyIB-exam style computations that keep your technique sharp.
UnderstandingExplain or prove something. This is the skill the NTNU exam rewards.
ChallengeHarder proofs and problems with a university flavour. Skip them on a first pass if you need to.
Tick exercises and modules as you finish them. They are always saved in this browser. On your own devices, sign in with the sync passphrase (under the progress bar) and they are also saved on the server, so they follow you between devices. The note under the progress bar says which.
A pace for the gap year
The course is about 140 hours of work. At four to five hours a week, starting in late October, it finishes in early summer and leaves July and August for review before the semester starts in mid-August.
Part I is the slowest going, because the ideas are the least familiar. Do not rush it: everything after it is easier because of it.
How to study with this course
Write proofs by hand. Reading a proof and being able to write it are different skills, and the exam tests the second.
Close the page and reproduce the key results of a module from memory, statement and proof, before marking it complete.
Play with the graphs. Each one is built so that you can break the idea it illustrates: find a δ that fails, an Euler step that is too large, a Taylor polynomial outside its radius of convergence.
Keep an error log. When a solution surprises you, write down why. Patterns appear within weeks.
Use Python for the numerical parts. A few lines reproduce bisection, Newton’s method and Euler’s method, and you will program numerical methods in your first semester.
Course · Coverage
IB syllabus map
Every calculus statement of the IB Mathematics: Analysis and Approaches HL syllabus (Topic 5, standard level and additional higher level), with the places in this course where it is developed. The descriptions are summaries, not the official wording.
Standard level, SL 5.1–5.11
IB
Content
Where in this course
SL 5.1
The concept of a limit. The derivative as the gradient function and as a rate of change.
Derivatives of \tan, \sec, \csc, \cot, a^x, \log_ax, \arcsin, \arccos, \arctan; the corresponding integrals, including composites with linear functions; partial fractions.
First-order differential equations: Euler’s method; separable equations; homogeneous equations with y = vx; linear equations with an integrating factor.
Maclaurin series of e^x, \sin x, \cos x, \ln(1+x) and (1+x)^p; new series by substitution, products, integration and differentiation; series from differential equations.
Material marked Beyond IB in the modules (countability, the ratio test, uniform continuity, numerical integration, improper integrals, hyperbolic functions, arc length, Bernoulli equations, Euler’s formula) is not in the IB syllabus. The NTNU page shows how it lines up with your first semester.
Part I · Foundations · Module 1
The real numbers
De reelle tallene
Big questionWhat exactly is a real number, and which single property of ℝ makes calculus possible?
IB syllabus
Foundations for AHL 5.12
Time
about 8 hours · 12 exercises
Builds on
IB AA HL algebra and functions
In IB you used real numbers constantly without being told what they are. That was enough for computing. It is not enough for proving, because the big theorems of calculus (the Intermediate Value Theorem, the Mean Value Theorem, the Fundamental Theorem) all rest on one fact: the real number line has no gaps. This module makes that fact precise and shows how much follows from it.
1.1The language of proof
University calculus is written in a compact language of sets and quantifiers. You will read it fluently within a few weeks, but only if you practise it from the start.
Notation
Meaning
x \in A
x is an element of the set A
A \subseteq B
every element of A is also in B
\{x \in \R : x^2 < 2\}
the set of real numbers x with x^2 < 2
(a,b),\ [a,b],\ [a,b),\ (a,\infty)
intervals; a round bracket excludes the endpoint
\N = \{1,2,3,\dots\}, \Z, \Q, \R
natural numbers, integers, rationals, reals (in this course 0 \notin \N)
\forall, \exists
“for all”, “there exists”
P \Rightarrow Q, P \iff Q
“if P then Q”, “P if and only if Q”
The order of quantifiers matters. Compare
\forall x \in \R\ \ \exists y \in \R : \ y > x \qquad\text{and}\qquad \exists y \in \R\ \ \forall x \in \R : \ y > x.
The first says “every number has a bigger number”, which is true (take y = x+1). The second says “some number is bigger than every number”, which is false. Same symbols, different order, opposite truth values. The definitions of limit and continuity are long strings of quantifiers, so this is not pedantry.
Rule 1.1Negating quantifiers
\neg\big(\forall x : P(x)\big) \iff \exists x : \neg P(x), \qquad \neg\big(\exists x : P(x)\big) \iff \forall x : \neg P(x).
To negate a string of quantifiers, change every \forall into \exists and every \exists into \forall, keep the order, and negate the statement at the end.
Example 1.2Negating a definition
A function f is bounded if \exists M > 0\ \forall x : |f(x)| \le M. So f is unbounded if
\forall M > 0\ \ \exists x : |f(x)| > M.
In words: whatever bound you propose, f beats it somewhere. In Module 3 a sequence (a_n) converges to L if \forall \eps>0\ \exists N\ \forall n \ge N : |a_n - L| < \eps. The negation, which you will use to prove that (-1)^n diverges, is \exists \eps > 0\ \forall N\ \exists n \ge N : |a_n - L| \ge \eps.
You already know the main proof techniques from AHL 1.15. In this course you will use all of them:
Direct proof: assume P, deduce Q.
Contrapositive:P \Rightarrow Q is equivalent to \neg Q \Rightarrow \neg P.
Contradiction: assume \neg Q (together with P) and derive something impossible.
Induction: for statements about every n \in \N.
Counterexample: one example is enough to disprove a “for all” statement.
1.2From counting numbers to fractions
The natural numbers \N can be added and multiplied but not always subtracted, so we extend to the integers \Z. Integers cannot always be divided, so we extend to the rationals
\Q = \Big\{\tfrac{p}{q} : p \in \Z,\ q \in \N\Big\}.
\Q is an ordered field. That means the familiar rules of algebra hold (addition and multiplication are commutative and associative, multiplication distributes over addition, every number has a negative and every non-zero number has a reciprocal), and so do the rules of inequalities: if a < b then a + c < b + c, and if a<b and c>0 then ac < bc. Every manipulation of equations and inequalities you did in IB follows from these rules.
\Q is also dense: between any two rationals p < q lies another one, \tfrac{p+q}{2}. So the rationals have no “next” number and look as if they fill the line completely. They do not.
1.3A hole in the rationals
Theorem 1.3√2 is irrational
There is no rational number q with q^2 = 2.
Proof. Suppose, for a contradiction, that (p/q)^2 = 2 where p, q \in \N have no common factor. Then p^2 = 2q^2, so p^2 is even. An odd number has an odd square, since (2k+1)^2 = 2(2k^2+2k)+1, so p itself is even: p = 2m. Then 4m^2 = 2q^2, so q^2 = 2m^2 and q is even too. Now p and q share the factor 2, a contradiction. ∎
Picture the set A = \{q \in \Q : q > 0,\ q^2 < 2\}. Its elements creep upwards: 1,\ 1.4,\ 1.41,\ 1.414,\ \dots They are all below 1.5, so the set is bounded above. But there is no least rational upper bound: if s is a positive rational with s^2 > 2, a slightly smaller rational is still an upper bound, and if s^2 < 2 then s is not an upper bound at all. (The proof of Theorem 1.9 below contains the computation.) The rational line has a hole exactly where \sqrt2 should be. Calculus cannot work on a line with holes: the function x^2 - 2 changes sign on [1,2] without ever being zero in \Q.
1.4Bounds, suprema and infima
Definition 1.4Upper bound, bounded
Let A \subseteq \R. A number M is an upper bound for A if a \le M for every a \in A. If A has an upper bound it is bounded above. Lower bounds and bounded below are defined the same way with \ge, and A is bounded if it is bounded above and below. øvre skranke
Definition 1.5Supremum and infimum
A number s is the least upper bound or supremum of A, written s = \sup A, if
s is an upper bound for A, and
s \le M for every upper bound M of A.
The greatest lower bound or infimum, \inf A, is defined the same way with the inequalities reversed. minste øvre skranke
A supremum need not belong to the set. If it does, it is the maximum.
A = [0,1]: \sup A = 1 \in A, so 1 = \max A.
A = [0,1): \sup A = 1 \notin A. The set has no maximum. To see that 1 is the least upper bound: if 0 \le M < 1 then \tfrac{M+1}{2} is in A and bigger than M, and if M < 0 then 0 \in A beats it. So no number below 1 is an upper bound.
A = \{\tfrac1n : n \in \N\}: \max A = 1, and \inf A = 0, which is not attained. (That 0 is the greatest lower bound needs the Archimedean property below.)
Lemma 1.6The ε-test for a supremum
Let s be an upper bound for A. Then s = \sup A if and only if for every \eps > 0 there is some a \in A with a > s - \eps.
Proof. (\Rightarrow) Let s = \sup A and \eps > 0. Since s - \eps < s, the number s-\eps is not an upper bound, so some a \in A has a > s - \eps.
(\Leftarrow) Suppose the condition holds, and let M be an upper bound with M < s. Put \eps = s - M > 0. Some a \in A has a > s - \eps = M, which contradicts M being an upper bound. So every upper bound satisfies M \ge s. ∎
This is the form in which you will use suprema in practice: just below \sup A there are always elements of A.
1.5The Completeness Axiom
The real numbers \R are an ordered field, with all the algebra and inequality rules of \Q, that satisfies one extra axiom.
Axiom 1.7Completeness
Every non-empty subset of \R that is bounded above has a supremum in \R. kompletthetsaksiomet
\Q satisfies every other axiom and fails this one: the set \{q\in\Q : q>0,\ q^2<2\} has no supremum in \Q. Completeness is the precise meaning of “\R has no holes”. Every time a proof in this course says “let s = \sup\{\dots\}”, this axiom is at work. The matching statement for infima follows from it (Exercise 1.8).
Taken on trustDoes ℝ exist?
That a complete ordered field exists, and that it is essentially unique, is proved by building \R out of \Q (using Dedekind cuts or Cauchy sequences). The construction is long and adds little at this stage, so we take \R as given and use only the axioms. If you are curious, Abbott’s Understanding Analysis (section 8.6) builds it.
1.6First consequences of completeness
Theorem 1.8Archimedean property
\N is not bounded above in \R. Equivalently: for every \eps > 0 there is an n \in \N with \tfrac1n < \eps.
Proof. Suppose \N were bounded above. By completeness, s = \sup \N exists. Then s - 1 is not an upper bound, so some n \in \N has n > s-1. But then n+1 \in \N and n+1 > s, contradicting that s is an upper bound. For the second form, given \eps>0 choose n \in \N with n > 1/\eps; then 1/n < \eps. ∎
So there are no “infinitely small” positive real numbers. This is why, from Module 3 onwards, we can describe “arbitrarily close” by “closer than every \eps > 0”.
Theorem 1.9√2 exists in ℝ
There is a positive real number s with s^2 = 2.
Proof. Let A = \{x \ge 0 : x^2 < 2\}. It is non-empty (1 \in A) and bounded above by 2 (if x \ge 2 then x^2 \ge 4). Let s = \sup A; then s \ge 1. We rule out s^2 < 2 and s^2 > 2.
Suppose s^2 < 2. For 0 < h < 1 we have h^2 < h, so
(s+h)^2 = s^2 + 2sh + h^2 < s^2 + h(2s+1).
Choose h with 0 < h < 1 and h < \dfrac{2 - s^2}{2s+1}. Then (s+h)^2 < 2, so s + h \in A. That contradicts s being an upper bound.
Suppose s^2 > 2. Let h = \dfrac{s^2-2}{2s}, so 0 < h < s. Then
(s-h)^2 = s^2 - 2sh + h^2 > s^2 - 2sh = 2.
If x \in A then x^2 < 2 < (s-h)^2, and as both are non-negative, x < s - h. So s-h is an upper bound smaller than s, contradicting that s is the least one. Hence s^2 = 2. ∎
The same idea produces nth roots of every positive number. In Module 5 the Intermediate Value Theorem will give them much more cheaply.
Theorem 1.10ℚ is dense in ℝ
If a < b are real numbers, there is a rational number r with a < r < b.
Proof. By the Archimedean property choose n \in \N with \tfrac1n < b - a. The set of integers greater than na is non-empty (Archimedean property again) and bounded below, so it has a least element m. Then m - 1 \le na < m, which gives
a < \frac{m}{n} \le a + \frac1n < b.
Take r = m/n. ∎
This also explains infinite decimals. The expansion 1.41421356\ldots names the real number \sup\{1,\ 1.4,\ 1.41,\ 1.414,\ \dots\}, and completeness guarantees that this supremum exists. In the same way 0.999\ldots = \sup\{0.9, 0.99, 0.999, \dots\} = 1 (Exercise 1.11).
1.7Absolute value and inequalities
Definition 1.11Absolute value
|x| = x if x \ge 0 and |x| = -x if x < 0. The number |x - a| is the distance between x and a on the number line.
The translation below is used on almost every page of Part I, so make it automatic:
|x - a| < \delta \iff a - \delta < x < a + \delta.
“x is within \delta of a” and “x lies in the open interval of radius \delta centred at a” are the same statement.
Theorem 1.12Triangle inequality
For all real a and b, \ |a + b| \le |a| + |b|. trekantulikheten
Proof. We have -|a| \le a \le |a| and -|b| \le b \le |b|. Adding gives -(|a|+|b|) \le a + b \le |a| + |b|, which says exactly that |a+b| \le |a|+|b|. ∎
Replacing a by a-b and b by b-c gives the distance form |a - c| \le |a - b| + |b - c|: going via b is never shorter. A useful relative is the reverse triangle inequality \big||a| - |b|\big| \le |a-b| (Exercise 1.5).
Example 1.13Bounding one factor while the other is small
Suppose |x - 3| < 1. Then 2 < x < 4, so 5 < x + 3 < 7, and therefore
|x^2 - 9| = |x-3|\,|x+3| < 7\,|x-3|.
So if we also know |x - 3| < \eps/7, then |x^2 - 9| < \eps. This two-step move (first restrict x to keep one factor bounded, then make the other factor small) is the heart of almost every \eps–\delta proof in Module 4.
1.8Beyond IB: how many real numbers are there?
Beyond IBCountability is on the NTNU syllabus
Cardinality and countability are listed in the first-semester calculus course at NTNU. Here is the core of it.
Definition 1.14Countable set
A set A is countable if its elements can be listed as a sequence a_1, a_2, a_3, \dots (repeats allowed; finite and empty sets count as countable). Otherwise it is uncountable. tellbar
Theorem 1.15ℚ is countable
The rational numbers can be listed in a single sequence.
Proof. List the positive fractions p/q in order of p + q: first \tfrac11; then \tfrac12, \tfrac21; then \tfrac13,\tfrac22,\tfrac31; and so on. Each group is finite and every positive rational appears in some group. If r_1, r_2, \dots is this list, then 0, r_1, -r_1, r_2, -r_2, \dots lists all of \Q. ∎
Theorem 1.16Cantor: ℝ is uncountable
No sequence contains every real number in (0,1).
Proof. Suppose x_1, x_2, x_3, \dots lists every number in (0,1). Write each in decimal, x_n = 0.d_{n1}d_{n2}d_{n3}\ldots, using the expansion that does not end in repeating 9s. Build y = 0.e_1e_2e_3\ldots by choosing e_n = 5 if d_{nn} \ne 5 and e_n = 4 if d_{nn} = 5. Then y \in (0,1), and y has only one decimal expansion because it contains no 0s or 9s. Its nth digit differs from that of x_n, so y \ne x_n for every n. The list misses y, a contradiction. ∎
So the rationals, although dense, form a “small” set, and there are two different sizes of infinity on the number line. You will meet this again in measure theory and probability.
Key results
\Q has holes (\sqrt2 \notin \Q). \R is the ordered field in which every non-empty set that is bounded above has a supremum.
An upper bound s of A is \sup A exactly when every s - \eps is beaten by some element of A.
Completeness gives the Archimedean property (1/n gets below any \eps>0), the existence of \sqrt2, and the density of \Q.
|x - a| < \delta \iff a-\delta < x < a+\delta, and |a+b| \le |a|+|b|.
To negate a quantified statement, swap \forall \leftrightarrow \exists and negate the end.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
1.1Fluency
Negate each statement, and decide whether the original is true.
(a) Every student in the class passed. (b) \forall x \in \R\ \exists y \in \R : x + y = 0. (c) \exists M > 0\ \forall x \in \R : |f(x)| \le M, for f(x) = x^2.
Then decide whether \exists y \in \R\ \forall x \in \R : x + y = 0 is true.
Solution
(a) “Some student in the class did not pass.” (b) Negation: \exists x\ \forall y : x + y \ne 0. The original is true: given x, take y = -x. (c) Negation: \forall M > 0\ \exists x : |f(x)| > M. For f(x)=x^2 the negation is true (take x = \sqrt{M}+1), so the original is false.
The swapped statement is false: whatever y is, the choice x = 1 - y gives x + y = 1 \ne 0. Swapping the quantifiers changed a true statement into a false one.
1.2Fluency
Solve, writing the answer as an interval or union of intervals: (a) |2x - 3| < 5 (b) |x - 1| < |x + 2| (c) |x^2 - 4| < 1.
Solution
(a) -5 < 2x - 3 < 5 \iff -1 < x < 4, so x \in (-1, 4).
(b) Both sides are non-negative, so we may square: (x-1)^2 < (x+2)^2 \iff -2x + 1 < 4x + 4 \iff x > -\tfrac12. So x \in (-\tfrac12, \infty). Geometrically: x is closer to 1 than to -2.
(c) The terms are 0, \tfrac12, -\tfrac23, \tfrac34, -\tfrac45, \dots. \sup = 1 and \inf = -1, neither attained, since every term has absolute value 1 - \tfrac1n < 1 while the even terms approach 1 and the odd terms approach -1.
(d) \inf = \tfrac12 (attained at n = 1), \sup = 1 (not attained).
(e) \sup = \sqrt2 and \inf = -\sqrt2, neither attained. As a subset of \Q this set has no supremum at all; inside \R it does. That is completeness at work.
1.4Understanding
Prove that \sqrt3 is irrational. Where exactly does your proof break if you try the same argument for \sqrt4?
Solution
Suppose \sqrt3 = p/q with p, q \in \N and no common factor. Then p^2 = 3q^2, so 3 \mid p^2. If 3 \nmid p then p = 3k \pm 1 and p^2 = 9k^2 \pm 6k + 1 leaves remainder 1 on division by 3, which is impossible. So 3 \mid p; write p = 3m. Then 9m^2 = 3q^2, so q^2 = 3m^2 and by the same argument 3 \mid q. This contradicts the assumption that p and q have no common factor.
For \sqrt4 the step “4 \mid p^2 \Rightarrow 4 \mid p” is false (p = 2 is a counterexample). The argument uses the fact that 3 is prime.
1.5Understanding
Prove the reverse triangle inequality: \big||a| - |b|\big| \le |a - b| for all real a, b.
Solution
By the triangle inequality, |a| = |(a - b) + b| \le |a - b| + |b|, so |a| - |b| \le |a-b|. Swapping the roles of a and b gives |b| - |a| \le |b - a| = |a - b|. A number whose value and negative are both at most |a-b| has absolute value at most |a-b|.
1.6Understanding
Let A and B be non-empty sets that are bounded above, and let A + B = \{a + b : a \in A,\ b \in B\}. Prove that \sup(A+B) = \sup A + \sup B.
Solution
Let s = \sup A and t = \sup B. For a \in A and b \in B we have a + b \le s + t, so s+t is an upper bound for A+B.
Now use the ε-test (Lemma 1.6). Let \eps > 0. There are a \in A with a > s - \eps/2 and b \in B with b > t - \eps/2. Then a + b \in A + B and a + b > (s + t) - \eps. Since \eps was arbitrary, s + t = \sup(A+B).
1.7Understanding
Prove Bernoulli’s inequality: if x \ge -1 and n \in \N, then (1+x)^n \ge 1 + nx. (We will use it repeatedly in Module 3.)
Solution
Induction on n. For n = 1 both sides equal 1 + x. Suppose (1+x)^n \ge 1 + nx. Since 1 + x \ge 0, multiplying both sides by 1+x preserves the inequality:
The hypothesis x \ge -1 was needed exactly once, to multiply an inequality by 1+x.
1.8Understanding
Show that if A is non-empty and bounded below, then \inf A exists and \inf A = -\sup(-A), where -A = \{-a : a \in A\}.
Solution
If m is a lower bound for A, then -m is an upper bound for -A, so by completeness s = \sup(-A) exists. For every a\in A we have -a \le s, so a \ge -s: thus -s is a lower bound for A. If m is any lower bound for A, then -m is an upper bound for -A, so s \le -m, that is m \le -s. Hence -s is the greatest lower bound.
1.9Challenge
Prove that between any two real numbers a < b there is an irrational number.
Solution
Apply the density of \Q (Theorem 1.10) to a/\sqrt2 < b/\sqrt2 to get a rational r strictly between them. If r = 0 happens to be chosen, apply density again to the interval (0, b/\sqrt2) or (a/\sqrt2, 0), whichever is non-empty, to get a non-zero rational instead. Then a < r\sqrt2 < b. The number r\sqrt2 is irrational: if r\sqrt2 = q \in \Q then \sqrt2 = q/r \in \Q, contradicting Theorem 1.3.
1.10Challenge
(Nested intervals.) Let [a_1,b_1] \supseteq [a_2,b_2] \supseteq [a_3,b_3] \supseteq \cdots be closed bounded intervals. Prove that some real number lies in all of them. Then show that the corresponding statement for intervals of rationals is false.
Solution
Nesting gives a_1 \le a_2 \le \cdots and b_1 \ge b_2 \ge \cdots, with a_n \le b_n. For any n and m, let k = \max(n,m); then a_n \le a_k \le b_k \le b_m. So every b_m is an upper bound for A = \{a_n : n \in \N\}. Let s = \sup A. Then a_n \le s for all n (upper bound) and s \le b_m for all m (least upper bound). So s \in [a_n, b_n] for every n.
In \Q this fails. Take the decimal truncations of \sqrt2: [1.4, 1.5] \supseteq [1.41, 1.42] \supseteq [1.414, 1.415] \supseteq \cdots (intervals of rationals). The only real number in all of them is \sqrt2, which is not rational, so their intersection in \Q is empty.
1.11Challenge
Prove that 0.999\ldots = 1, where the left side means \sup\{1 - 10^{-n} : n \in \N\}.
Solution
Every 1 - 10^{-n} is less than 1, so 1 is an upper bound. Let \eps > 0. By the Archimedean property there is n with 1/n < \eps, and since 10^n > n we get 10^{-n} < 1/n < \eps. Then 1 - 10^{-n} > 1 - \eps. By the ε-test, 1 is the supremum.
1.12Challenge
Show that the set of irrational numbers is uncountable.
Solution
Suppose the irrationals could be listed as i_1, i_2, i_3, \dots. The rationals can be listed as q_1, q_2, q_3, \dots. Then q_1, i_1, q_2, i_2, q_3, i_3, \dots would list every real number, contradicting Cantor’s theorem. So “almost all” real numbers are irrational, even though the rationals are dense.
Part I · Foundations · Module 2
Functions
Funksjoner
Big questionWhat is a function, precisely, and which functions will calculus be about?
Calculus studies how functions change. Before we can talk about change we need to be exact about what a function is, how functions combine, and when they can be reversed. Much of this module is familiar from IB Topic 2, so read it briskly. Do the exercises anyway: domains, composites and inverses come back on almost every page from Module 6 onwards.
2.1What a function is
Definition 2.1Function
A functionf from a set A to a set B, written f : A \to B, is a rule that assigns to each element x \in Aexactly one element f(x) \in B. The set A is the domain, B is the codomain, and f(A) = \{f(x) : x \in A\} is the range. definisjonsmengdeverdimengde
The graph of f is the set of points \{(x, f(x)) : x \in A\} in the plane. “Exactly one output for each input” is the vertical line test: no vertical line meets the graph twice. The equation x^2 + y^2 = 1 does not define y as a function of x on [-1,1], because each x in (-1,1) gives two values of y. The formula y = \sqrt{1 - x^2} does define a function: the upper semicircle. Curves like the full circle return in Module 8, where we differentiate them without solving for y.
When a function is given by a formula and no domain is stated, the convention is to take the largest set of real numbers on which the formula makes sense. This is the natural domain. For example
Functions can be added, subtracted, multiplied and divided pointwise: (f+g)(x) = f(x) + g(x), (fg)(x) = f(x)g(x), (f/g)(x) = f(x)/g(x). The domain of each is the intersection of the two domains, with the zeros of g removed for the quotient.
Definition 2.2Composition
The compositef \circ g is the function (f\circ g)(x) = f(g(x)). Its domain is the set of x in the domain of g for which g(x) lies in the domain of f. sammensatt funksjon
Example 2.3Order matters, and so do domains
Let f(x) = \sqrt{x} and g(x) = 1 - x^2. Then (f \circ g)(x) = \sqrt{1 - x^2}, with domain [-1, 1]. In the other order, (g \circ f)(x) = 1 - (\sqrt x)^2 = 1 - x, but its domain is [0, \infty), not \R: the input must first pass through \sqrt{\ }. Two functions are equal only if they have the same domain and the same values.
The chain rule in Module 7 differentiates composites layer by layer, so practise seeing the layers. The function h(x) = \sin^3(2x+1) is built in three steps:
The transformations of graphs from IB are compositions with linear functions. The graph of y = a\,f\big(b(x - c)\big) + d is the graph of f stretched horizontally by the factor 1/b, then shifted right by c, stretched vertically by a and shifted up by d.
2.3Injective functions and inverses
Definition 2.4Injective, surjective, bijective
A function f: A \to B is injective (one-to-one) if f(x_1) = f(x_2) implies x_1 = x_2; surjective (onto) if every y \in B equals f(x) for some x \in A; and bijective if it is both. injektiv
Definition 2.5Inverse function
If f : A \to B is bijective, its inversef^{-1} : B \to A sends each y \in B to the unique x \in A with f(x) = y. Then f^{-1}(f(x)) = x for all x \in A and f(f^{-1}(y)) = y for all y \in B. omvendt funksjon
An injective function f : A \to \R is a bijection from A onto its range f(A), so it has an inverse defined on f(A). Since (a, b) lies on the graph of f exactly when (b,a) lies on the graph of f^{-1}, the graph of the inverse is the reflection of the graph of f in the line y = x. That reflection is the whole idea behind the derivative of an inverse function in Module 8.
Definition 2.6Monotone functions
A function f is increasing on a set I if x_1 < x_2 in I implies f(x_1) \le f(x_2), and strictly increasing if it implies f(x_1) < f(x_2). Decreasing and strictly decreasing are defined the same way. A function that is either increasing or decreasing is monotone. voksendeavtakende
Theorem 2.7Strictly monotone implies injective
A strictly monotone function is injective, and so it has an inverse on its range.
Proof. Suppose f is strictly increasing and x_1 \ne x_2; say x_1 < x_2. Then f(x_1) < f(x_2), so f(x_1) \ne f(x_2). The decreasing case is the same. ∎
Many functions are not injective, but become injective when we restrict their domain. This is how the inverse trigonometric functions are defined:
Restrict
to
Inverse
Inverse maps
x^2
[0, \infty)
\sqrt{x}
[0,\infty) \to [0,\infty)
\sin x
[-\tfrac\pi2, \tfrac\pi2]
\arcsin x
[-1, 1] \to [-\tfrac\pi2, \tfrac\pi2]
\cos x
[0, \pi]
\arccos x
[-1, 1] \to [0, \pi]
\tan x
(-\tfrac\pi2, \tfrac\pi2)
\arctan x
\R \to (-\tfrac\pi2, \tfrac\pi2)
Pitfallarcsin undoes sin only on its interval
\arcsin(\sin x) = x holds only for x \in [-\tfrac\pi2, \tfrac\pi2]. For example \arcsin\big(\sin \tfrac{5\pi}{6}\big) = \arcsin \tfrac12 = \tfrac{\pi}{6}. In the other order, \sin(\arcsin y) = y holds for every y \in [-1,1].
2.4Symmetry, periodicity and boundedness
A function is even if f(-x) = f(x) for all x in its domain (graph symmetric in the y-axis), odd if f(-x) = -f(x) (graph symmetric under a half-turn about the origin), and periodic with period p > 0 if f(x + p) = f(x) for all x. For example \cos, |x| and x^2 are even; \sin, \tan and x^3 are odd; e^x is neither. Sine and cosine have period 2\pi; tangent has period \pi. Symmetry saves work: in Module 16 you will see that \int_{-a}^{a} f(x)\,dx = 0 for every odd f.
2.5The catalogue of elementary functions
Calculus at this level is mostly about the following families, and the functions you can build from them with arithmetic and composition.
Family
Examples
Where defined
Polynomials
3x^4 - x + 2
\R
Rational functions
\dfrac{x^2 + 1}{x - 2}
where the denominator is non-zero
Roots and rational powers
\sqrt[3]{x},\ x^{2/3},\ x^{-1/2}
depends on the power
Exponentials and logarithms
e^x,\ 2^x,\ \ln x,\ \log_{10} x
\R for a^x; (0,\infty) for logarithms
Trigonometric
\sin, \cos, \tan, \sec, \csc, \cot
\sin, \cos on \R; others away from zeros of the denominator
Inverse trigonometric
\arcsin, \arccos, \arctan
[-1,1], [-1,1], \R
Others
|x|, piecewise rules, \lfloor x \rfloor
as stated
Angles are always in radians. The point (\cos\theta, \sin\theta) is the point on the unit circle reached by walking an arc of length \theta anticlockwise from (1,0). Radians are not a convention of taste: in Module 4 we will see that \frac{\sin x}{x} \to 1 as x \to 0 only when x is measured in radians, and every derivative of a trigonometric function depends on that limit.
NoteIdentities you will use constantly
\sin^2 x + \cos^2 x = 1, \quad 1 + \tan^2 x = \sec^2 x, \quad 1 + \cot^2 x = \csc^2 x,
\sin(a \pm b) = \sin a \cos b \pm \cos a \sin b, \quad \cos(a \pm b) = \cos a\cos b \mp \sin a \sin b,
\sin 2a = 2\sin a\cos a, \quad \cos 2a = \cos^2 a - \sin^2 a = 2\cos^2 a - 1 = 1 - 2\sin^2 a.
Taken on trustTwo IOUs
Until further notice we use \sin, \cos, e^x and \ln x with the properties you know from IB. Two things are owed. First, a definition of a^x when x is irrational: Module 9 gives one, and Module 15 gives a complete one, defining \ln x as an area. Second, a definition of \sin and \cos that does not rely on a picture of a circle: Module 19 defines them by power series, from which every property can be proved.
2.6Strange functions for testing ideas
Definitions in calculus are designed for well-behaved functions, but they are understood by testing them on badly behaved ones. Three functions will keep coming back:
The Dirichlet functionD(x) = 1 if x \in \Q and D(x) = 0 if x \notin \Q. Every interval contains both rationals and irrationals (Module 1), so its graph is two dense “clouds” of points. It is discontinuous everywhere (Module 5) and not integrable (Module 14).
\sin(1/x) for x \ne 0. As x \to 0 it oscillates between -1 and 1 infinitely often, so it has no limit at 0 (Module 4).
x^2 \sin(1/x), with value 0 at x = 0. It is differentiable everywhere, but its derivative jumps around near 0, so the derivative is not continuous (Modules 6 and 7).
Key results
A function assigns exactly one output to each input in its domain. Always know the domain.
The domain of f\circ g consists of the x in the domain of g with g(x) in the domain of f.
Strictly monotone functions are injective and have inverses on their range; the inverse’s graph is the reflection in y = x.
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
2.1Fluency
Find the natural domain and the range: (a) f(x) = \sqrt{4 - x^2} (b) g(x) = \dfrac{1}{x^2 - 1} (c) h(x) = \ln(x - 3).
Solution
(a) Need 4 - x^2 \ge 0, so the domain is [-2, 2]. As x runs over it, 4 - x^2 takes every value in [0,4], so the range is [0, 2].
(b) Domain \R \setminus \{-1, 1\}. The quantity x^2 - 1 takes every value in [-1, 0) \cup (0, \infty). Taking reciprocals, [-1,0) goes to (-\infty, -1] and (0,\infty) goes to (0, \infty). Range: (-\infty, -1] \cup (0, \infty).
(c) Domain (3, \infty); range \R.
2.2Fluency
Let f(x) = \sqrt{x} and g(x) = x^2 - 4. Find f \circ g and g\circ f with their domains, and decide whether g \circ f = f\circ g anywhere.
Solution
(f\circ g)(x) = \sqrt{x^2 - 4}, defined when x^2 \ge 4: domain (-\infty, -2] \cup [2, \infty).
(g\circ f)(x) = (\sqrt{x})^2 - 4 = x - 4, with domain [0, \infty).
They agree where both are defined and \sqrt{x^2-4} = x - 4. That needs x \ge 4 and x^2 - 4 = x^2 - 8x + 16, so x = \tfrac52, which is not \ge 4. So they agree nowhere.
2.3Fluency
Write each function as a composite of simpler functions, listing the layers from the inside out: (a) \sin^3(2x+1) (b) e^{\sqrt{x^2+1}} (c) \ln(\cos x). For (c), find the natural domain.
Solution
(a) x \mapsto 2x + 1 \mapsto \sin(\cdot) \mapsto (\cdot)^3. (b) x \mapsto x^2 + 1 \mapsto \sqrt{\cdot} \mapsto e^{(\cdot)}. (c) x \mapsto \cos x \mapsto \ln(\cdot).
For (c) we need \cos x > 0, so the domain is the union of the intervals \big(-\tfrac\pi2 + 2k\pi,\ \tfrac\pi2 + 2k\pi\big), k \in \Z.
2.4Fluency
Find the inverse of f(x) = \dfrac{2x+1}{x-3}, x \ne 3, and state its domain.
Solution
Solve y = \frac{2x+1}{x-3} for x: y(x - 3) = 2x + 1, so x(y - 2) = 3y + 1 and x = \frac{3y+1}{y-2}. Hence f^{-1}(x) = \dfrac{3x+1}{x-2}, with domain x \ne 2. (The range of f is \R\setminus\{2\}: y = 2 would need 2x + 1 = 2x - 6.)
2.5Fluency
Evaluate exactly: (a) \arcsin(-\tfrac12) (b) \arccos(-\tfrac12) (c) \arctan\sqrt3 (d) \arcsin\big(\sin\tfrac{5\pi}{6}\big) (e) \cos(\arcsin x) for x \in [-1,1].
Solution
(a) -\tfrac\pi6 (b) \tfrac{2\pi}{3} (c) \tfrac\pi3 (d) \tfrac\pi6, because \tfrac{5\pi}6 \notin [-\tfrac\pi2, \tfrac\pi2] while \sin\tfrac{5\pi}6 = \tfrac12.
(e) Let \theta = \arcsin x, so \sin\theta = x and \theta \in [-\tfrac\pi2, \tfrac\pi2]. On that interval \cos\theta \ge 0, so \cos\theta = +\sqrt{1 - \sin^2\theta} = \sqrt{1 - x^2}. This identity is exactly what Module 8 needs to differentiate \arcsin.
2.6Understanding
Prove that if f is strictly increasing on its domain, then its inverse f^{-1} is strictly increasing on the range of f.
Solution
Let u < v be in the range, with u = f(x) and v = f(y). If x \ge y, then (as f is increasing) f(x) \ge f(y), that is u \ge v, a contradiction. So x < y, i.e. f^{-1}(u) < f^{-1}(v).
2.7Understanding
Show that every function f : \R \to \R is the sum of an even function and an odd function. Identify the two parts when f(x) = e^x.
Solution
Write f(x) = \underbrace{\tfrac12\big(f(x) + f(-x)\big)}_{E(x)} + \underbrace{\tfrac12\big(f(x) - f(-x)\big)}_{O(x)}. Replacing x by -x shows E(-x) = E(x) and O(-x) = -O(x).
For f = e^x the parts are \cosh x = \tfrac12(e^x + e^{-x}) and \sinh x = \tfrac12(e^x - e^{-x}), the hyperbolic cosine and sine. They are part of the NTNU syllabus and reappear in Module 9.
2.8Understanding
Show that \cos(\arctan x) = \dfrac{1}{\sqrt{1+x^2}} and \sin(\arctan x) = \dfrac{x}{\sqrt{1+x^2}} for every real x.
Solution
Let \theta = \arctan x \in (-\tfrac\pi2, \tfrac\pi2). There \cos\theta > 0, and 1 + \tan^2\theta = \sec^2\theta gives \cos^2\theta = \frac{1}{1+x^2}, so \cos\theta = \frac{1}{\sqrt{1+x^2}}. Then \sin\theta = \tan\theta\cos\theta = \frac{x}{\sqrt{1+x^2}}.
2.9Understanding
Show that f(x) = \dfrac{x}{1 + |x|} is a bijection from \R onto (-1, 1), and find f^{-1}.
Solution
For x \ge 0, f(x) = 1 - \frac{1}{1+x}, which is strictly increasing, takes the value 0 at x=0, and takes every value in [0,1) (solve y = \frac{x}{1+x} to get x = \frac{y}{1-y} \ge 0). Since f is odd, it maps (-\infty, 0] onto (-1, 0] in the same way. So f is strictly increasing on \R, hence injective, with range (-1,1).
The inverse is f^{-1}(y) = \dfrac{y}{1 - |y|} for -1 < y < 1. So \R and the bounded interval (-1,1) are “the same size” in the sense of Module 1.
2.10Challenge
Suppose f : \R \to \R satisfies f(x + y) = f(x) + f(y) for all x, y. Prove that f(0) = 0, that f(-x) = -f(x), and that f(q) = q\,f(1) for every rational q. (Module 5 finishes the job: if f is also continuous, then f(x) = cx for all real x.)
Solution
f(0) = f(0 + 0) = 2f(0), so f(0) = 0. Then 0 = f(x + (-x)) = f(x) + f(-x). By induction, f(nx) = n f(x) for n \in \N: the step is f((n+1)x) = f(nx) + f(x). Together with oddness, f(mx) = m f(x) for all m \in \Z.
Now let q = m/n with m\in\Z, n \in \N. Then n\,f(q) = f(nq) = f(m) = m f(1), so f(q) = \frac mn f(1) = q f(1).
2.11Challenge
Show that every positive rational number is a period of the Dirichlet function, that no irrational number is a period, and hence that the Dirichlet function has no smallest positive period.
Solution
If p \in \Q, then x + p is rational exactly when x is, so D(x + p) = D(x) for every x. If p is irrational then D(0 + p) = 0 \ne 1 = D(0), so p is not a period. The periods are therefore exactly the positive rationals, and there is no smallest positive rational (if p is one, so is p/2).
Part I · Foundations · Module 3
Sequences and series
Følger og rekker
Big questionWhat does it mean for an infinite process to arrive somewhere?
All of calculus is built on one idea, the limit. Derivatives are limits of difference quotients, integrals are limits of sums, and series are limits of partial sums. The simplest setting for limits is a sequence: a list of numbers a_1, a_2, a_3, \dots This module defines convergence precisely and proves the results you will use again and again. It covers the “understanding of limits (convergence and divergence)” of AHL 5.12 in far more depth than the IB requires, and it is the core of the first weeks at NTNU.
3.1Sequences
A sequence is a function from \N to \R, written n \mapsto a_n or simply (a_n). følge Some sequences that will matter:
A table like this suggests a limit. It cannot prove one: the values could start drifting at n = 10^{12}. To prove anything we need a definition.
3.2What convergence means
Definition 3.1Convergence of a sequence
The sequence (a_n)converges to the real number L if
\text{for every } \eps > 0 \text{ there is an } N \in \N \text{ such that } |a_n - L| < \eps \text{ for all } n \ge N.
We write a_n \to L or \lim\limits_{n\to\infty} a_n = L. A sequence that converges to no real number diverges. konvergerergrenseverdi
Read it as a game. Your opponent names a tolerance \eps, however small. You must reply with a point N in the sequence beyond which every term stays within \eps of L. If you can always reply, the sequence converges to L. Usually N depends on \eps: a smaller tolerance needs a later starting point.
Example 3.21/n → 0
Let \eps > 0. By the Archimedean property (Theorem 1.8) choose N \in \N with N > 1/\eps. For every n \ge N,
So \frac5n < \eps will be enough, which needs n > 5/\eps.
Proof. Let \eps > 0 and choose N \in \N with N > 5/\eps. For n \ge N, \ |a_n - 3| < \frac5n \le \frac5N < \eps.
This is the pattern for every convergence proof: find N by working backwards from the inequality you want, then write the argument forwards.
Example 3.4(−1)ⁿ diverges
Suppose (-1)^n \to L for some L. Take \eps = 1: there is an N with |(-1)^n - L| < 1 for all n \ge N. Choosing one even and one odd n \ge N gives |1 - L| < 1 and |-1 - L| < 1. But then
which is impossible. This is the negation of convergence from Module 1 in action: we found one \eps for which no N works.
Definition 3.5Divergence to infinity
a_n \to \infty if for every M there is an N with a_n > M for all n \ge N. Such a sequence still diverges (it has no real limit), but in a definite way. For example \sqrt n \to \infty: given M > 0, take N > M^2.
3.3Rules for limits
Theorem 3.6Limits are unique
A sequence converges to at most one limit.
Proof. Suppose a_n \to L and a_n \to L' with L \ne L'. Let \eps = \frac12|L - L'| > 0. For all large n both |a_n - L| < \eps and |a_n - L'| < \eps, so |L - L'| \le |L - a_n| + |a_n - L'| < 2\eps = |L - L'|, a contradiction. ∎
Theorem 3.7Convergent sequences are bounded
If (a_n) converges, there is an M with |a_n| \le M for every n.
Proof. Let a_n \to L. With \eps = 1 there is N such that |a_n - L| < 1, and hence |a_n| < |L| + 1, for n \ge N. Only finitely many terms come before N, so M = \max\{|a_1|, \dots, |a_{N-1}|, |L| + 1\} works. ∎
Theorem 3.8Limit laws
Suppose a_n \to a and b_n \to b, and let c be a constant. Then
a_n + b_n \to a + b, \qquad c\,a_n \to c\,a, \qquad a_n b_n \to ab, \qquad \frac{a_n}{b_n} \to \frac ab \ \ (\text{if } b \ne 0 \text{ and every } b_n \ne 0).
Proof.Sum. Let \eps > 0. Choose N_1 with |a_n - a| < \eps/2 for n \ge N_1, and N_2 with |b_n - b| < \eps/2 for n \ge N_2. For n \ge \max(N_1, N_2), the triangle inequality gives |(a_n + b_n) - (a+b)| \le |a_n - a| + |b_n - b| < \eps.
Product. Write a_nb_n - ab = a_n(b_n - b) + b(a_n - a), so
By Theorem 3.7 there is K > 0 with |a_n| \le K for all n. Given \eps > 0, choose N so that for n \ge N both |b_n - b| < \frac{\eps}{2K} and |a_n - a| < \frac{\eps}{2(|b| + 1)}. Then |a_nb_n - ab| < \frac\eps2 + \frac\eps2 = \eps. The constant multiple law is the case b_n = c. The quotient law is Exercise 3.6. ∎
using \frac1n \to 0 and \frac1{n^2} = \frac1n\cdot\frac1n \to 0 (product law).
Theorem 3.10Limits preserve ≤
If a_n \le b_n for all n, with a_n \to a and b_n \to b, then a \le b.
Proof. Suppose a > b and let \eps = \frac{a - b}{2}. For large n, a_n > a - \eps = \frac{a+b}{2} and b_n < b + \eps = \frac{a+b}2, so a_n > b_n, a contradiction. ∎
Strict inequalities are not preserved: 0 < \frac1n for every n, yet both sides have limit 0.
Theorem 3.11Squeeze Theorem
If a_n \le b_n \le c_n for all n, and a_n \to L and c_n \to L, then b_n \to L. skviseregelen
Proof. Let \eps > 0. For all large n we have L - \eps < a_n and c_n < L + \eps, and therefore L - \eps < a_n \le b_n \le c_n < L + \eps. ∎
For example \frac{\sin n}{n} \to 0, because -\frac1n \le \frac{\sin n}{n} \le \frac1n and both bounds tend to 0.
3.4Monotone sequences and completeness
To use the definition of convergence you must already know the limit. The next theorem proves convergence without knowing the limit in advance, and it is the first place where completeness pays off.
Theorem 3.12Monotone Convergence Theorem
An increasing sequence that is bounded above converges, and its limit is \sup\{a_n : n \in \N\}. A decreasing sequence that is bounded below converges to \inf\{a_n : n\in\N\}.
Proof. Let (a_n) be increasing and bounded above, and let s = \sup\{a_n\}, which exists by the Completeness Axiom. Let \eps > 0. By the ε-test (Lemma 1.6) some term satisfies a_N > s - \eps. For every n \ge N the sequence is increasing and bounded by s, so s - \eps < a_N \le a_n \le s, and thus |a_n - s| < \eps. The decreasing case is the same with infima. ∎
In \Q this theorem fails: 1, 1.4, 1.41, 1.414, \dots is increasing and bounded but has no rational limit.
Example 3.13A recursive sequence
Let a_1 = 1 and a_{n+1} = \sqrt{2 + a_n}. We show a_n \to 2.
Bounded:a_1 < 2, and if a_n < 2 then a_{n+1} < \sqrt{4} = 2. By induction 0 < a_n < 2 for all n.
Increasing:a_{n+1}^2 - a_n^2 = 2 + a_n - a_n^2 = (2 - a_n)(1 + a_n) > 0, and both terms are positive, so a_{n+1} > a_n.
Limit: by the Monotone Convergence Theorem a_n \to L for some L \in [1, 2]. The shifted sequence (a_{n+1}) has the same limit, so taking limits in a_{n+1}^2 = 2 + a_n gives L^2 = 2 + L. Hence (L-2)(L+1) = 0 and L = 2.
PitfallProve convergence before solving L = f(L)
Let a_1 = 2 and a_{n+1} = a_n^2. “Taking limits” gives L = L^2, so L = 0 or L = 1. Both are wrong: a_n = 2^{2^{n-1}} \to \infty. The equation L = f(L) only tells you what the limit must be if there is one.
Theorem 3.14The number e
The sequence e_n = \left(1 + \frac1n\right)^n is increasing and bounded above by 3. Its limit is called e:
e = \lim_{n\to\infty}\left(1 + \frac1n\right)^n = 2.718281828\ldots
Increasing: when n is replaced by n+1, every bracket 1 - \frac jn grows to 1 - \frac{j}{n+1}, and one more positive term (k = n+1) is added. So e_{n+1} > e_n.
Bounded: each product of brackets is at most 1, and k! \ge 2^{k-1} for k \ge 1, so
The Monotone Convergence Theorem now gives convergence. ∎
In Module 9 this same number turns out to be the base whose exponential function is its own derivative, and in Exercise 3.12 you prove e = \sum_{k=0}^\infty \frac{1}{k!}.
3.5A toolkit of standard limits
Theorem 3.15Standard limits
If |r| < 1 then r^n \to 0.
If a > 0 then a^{1/n} \to 1.
n^{1/n} \to 1.
For every k \in \N and every b > 1, \ \dfrac{n^k}{b^n} \to 0. (Exponentials beat powers.)
For every real x, \ \dfrac{x^n}{n!} \to 0. (Factorials beat exponentials.)
Proof. (1) If r = 0 there is nothing to do. Otherwise write \frac{1}{|r|} = 1 + h with h > 0. By Bernoulli’s inequality (Exercise 1.7), (1+h)^n \ge 1 + nh > nh, so 0 \le |r|^n < \frac{1}{nh}, and the Squeeze Theorem gives |r|^n \to 0.
(4) Write b = 1 + h with h > 0. For n \ge 2k the binomial theorem gives b^n \ge \binom{n}{k+1}h^{k+1}, and each of the k+1 factors n, n-1, \dots, n-k in \binom{n}{k+1} is at least n/2. So b^n \ge \frac{(n/2)^{k+1}h^{k+1}}{(k+1)!} and
For large n these give a hierarchy that is worth memorising: \ \ln n \ll n^k \ll b^n \ll n! \ll n^n. Module 11 proves the corresponding facts for functions with L’Hôpital’s rule.
3.6Subsequences and the Bolzano–Weierstrass Theorem
A subsequence of (a_n) is a sequence a_{n_1}, a_{n_2}, a_{n_3}, \dots with n_1 < n_2 < n_3 < \cdots. If a_n \to L then every subsequence also tends to L, since n_k \ge k. So if two subsequences have different limits, the sequence diverges: the even terms of (-1)^n tend to 1 and the odd terms to -1.
Theorem 3.16Bolzano–Weierstrass
Every bounded sequence has a convergent subsequence.
Proof. First we show that every sequence has a monotone subsequence. Call n a peak if a_n \ge a_m for every m > n. If there are infinitely many peaks n_1 < n_2 < \cdots, then a_{n_1} \ge a_{n_2} \ge \cdots is a decreasing subsequence. If there are finitely many, choose n_1 beyond the last one. Since n_1 is not a peak, some n_2 > n_1 has a_{n_2} > a_{n_1}; since n_2 is not a peak, some n_3 > n_2 has a_{n_3} > a_{n_2}; and so on. This gives an increasing subsequence.
If the original sequence is bounded, so is this monotone subsequence, and it converges by the Monotone Convergence Theorem. ∎
This theorem is the engine inside the Extreme Value Theorem in Module 5.
3.7Series
Definition 3.17Series
Given a sequence (a_k), its partial sums are S_n = a_1 + a_2 + \cdots + a_n. The series\sum_{k=1}^{\infty} a_kconverges with sum S if S_n \to S. Otherwise it diverges. rekke
An infinite sum is not a sum of infinitely many numbers (nobody can do that). It is the limit of finite sums, and so everything about series is a statement about the sequence (S_n).
Theorem 3.18Geometric series
If |r| < 1 then \displaystyle\sum_{k=0}^{\infty} r^k = \frac{1}{1-r}. If |r| \ge 1 the series diverges.
Proof. For r \ne 1, \ S_n = 1 + r + \cdots + r^{n-1} = \frac{1 - r^n}{1-r} (multiply out (1-r)S_n to check). If |r| < 1 then r^n \to 0 by Theorem 3.15, so S_n \to \frac{1}{1-r}. If |r| \ge 1 the terms r^k do not tend to 0, so the series diverges by the next theorem. ∎
Theorem 3.19Terms of a convergent series tend to 0
If \sum a_k converges, then a_k \to 0.
Proof.a_n = S_n - S_{n-1} \to S - S = 0. ∎
PitfallThe converse is false
Terms tending to 0 do not make a series converge. The standard counterexample is next.
The block ending at \frac{1}{2^j} has 2^{j-1} terms, each at least \frac1{2^j}, so it is at least \frac12. Hence S_{2^m} \ge 1 + \frac m2, which is unbounded. (This argument is due to Nicole Oresme, around 1350.) ∎
The partial sums grow very slowly, roughly like \ln n: after a million terms the sum is only about 14.4.
Telescoping series can be summed exactly. Since \frac{1}{k(k+1)} = \frac1k - \frac1{k+1},
Suppose 0 \le a_k \le b_k for all k. If \sum b_k converges, so does \sum a_k. If \sum a_k diverges, so does \sum b_k.
Proof. The partial sums of \sum a_k are increasing (the terms are non-negative) and bounded above by \sum_{k=1}^\infty b_k. By the Monotone Convergence Theorem they converge. The second statement is the contrapositive of the first. ∎
Example 3.22Σ 1/k² converges
For k \ge 2, \ \frac1{k^2} < \frac{1}{k(k-1)} = \frac{1}{k-1} - \frac1k. Telescoping, S_n < 1 + \left(1 - \frac1n\right) < 2. The partial sums are increasing and bounded, so the series converges. Its sum is \frac{\pi^2}{6}, a famous result of Euler that needs more machinery to prove.
Beyond IBRatio test and alternating series
Ratio test. If a_k > 0 and \frac{a_{k+1}}{a_k} \to \rho, then \sum a_k converges if \rho < 1 and diverges if \rho > 1. (If \rho = 1 the test says nothing: both \sum \frac1k and \sum\frac{1}{k^2} have \rho = 1.) Idea of proof: if \rho < 1, pick r with \rho < r < 1. For k beyond some K we have a_{k+1} \le r\,a_k, so a_k \le a_K r^{k - K}, and the comparison test with a geometric series finishes it. If \rho > 1, the terms eventually increase, so they do not tend to 0.
Alternating series test. If b_k decreases to 0, then \sum (-1)^{k+1}b_k converges. For example 1 - \frac12 + \frac13 - \frac14 + \cdots converges (to \ln 2, as you will prove in Module 15), even though the harmonic series diverges.
Both tests are on the NTNU syllabus. Module 19 uses the ratio test to decide where Maclaurin series converge.
Key results
a_n \to L means: \forall\eps>0\ \exists N\ \forall n\ge N : |a_n - L| < \eps. Prove it by finding N from \eps.
Limits are unique; convergent sequences are bounded; limits respect sums, products, quotients and \le; the Squeeze Theorem.
Monotone Convergence Theorem: bounded and monotone implies convergent. This is completeness in action, and it defines e = \lim(1 + \frac1n)^n.
Bolzano–Weierstrass: every bounded sequence has a convergent subsequence.
A series converges when its partial sums do. \sum r^k = \frac1{1-r} for |r|<1. Terms \to 0 is necessary but not sufficient: \sum \frac1k diverges.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
3.1Fluency
Find each limit, justifying the steps with the limit laws or the Squeeze Theorem.
(d) -\frac{1}{\sqrt n} \le \frac{\cos n}{\sqrt n} \le \frac1{\sqrt n}, and \frac{1}{\sqrt n} \to 0, so the limit is 0 by squeezing.
3.2Fluency
Find the sum of each series, or explain why it diverges.
(a) \displaystyle\sum_{k=1}^\infty 3\left(-\tfrac12\right)^k (b) \displaystyle\sum_{k=0}^\infty \frac{2^k + 3^k}{6^k} (c) 0.272727\ldots written as a fraction (d) \displaystyle\sum_{k=0}^\infty (x - 1)^k for the values of x where it converges.
Solution
(a) A geometric series with first term -\frac32 and ratio -\frac12: the sum is \frac{-3/2}{1 + 1/2} = -1.
(b) \sum \left(\frac13\right)^k + \sum\left(\frac12\right)^k = \frac{3}{2} + 2 = \frac72 (the sum of two convergent series is the limit of the sum of their partial sums).
Prove directly from the definition that \dfrac{2n+3}{n+1} \to 2.
Solution
\left|\frac{2n+3}{n+1} - 2\right| = \frac{1}{n+1} < \frac1n. Given \eps > 0, choose N > 1/\eps. For n \ge N, \left|\frac{2n+3}{n+1} - 2\right| < \frac1n \le \frac1N < \eps.
3.5Understanding
Prove that if a_n \to L then |a_n| \to |L|. Is the converse true? Is it true when L = 0?
Solution
By the reverse triangle inequality, \big||a_n| - |L|\big| \le |a_n - L|. So any N that works for (a_n) and \eps also works for (|a_n|).
The converse is false: |(-1)^n| \to 1 but (-1)^n diverges. When L = 0 it is true, because |a_n - 0| = \big||a_n| - 0\big|, so the two statements are literally the same.
3.6Understanding
Suppose b_n \to b with b \ne 0 and every b_n \ne 0. Show that |b_n| > \frac{|b|}{2} for all large n, and deduce that \frac{1}{b_n} \to \frac1b. Combine with the product law to obtain the quotient law.
Solution
Take \eps = \frac{|b|}{2}: for n \ge N_1, |b_n - b| < \frac{|b|}2, so |b_n| \ge |b| - |b - b_n| > \frac{|b|}{2}.
Then for n \ge N_1, \ \left|\frac1{b_n} - \frac1b\right| = \frac{|b - b_n|}{|b_n|\,|b|} < \frac{2}{|b|^2}|b_n - b|. Given \eps>0, choose N \ge N_1 with |b_n - b| < \frac{\eps|b|^2}{2} for n \ge N; then \left|\frac{1}{b_n} - \frac1b\right| < \eps.
Finally \frac{a_n}{b_n} = a_n\cdot\frac1{b_n} \to a\cdot\frac1b by the product law.
3.7Understanding
(The Babylonian method.) Let a_1 = 2 and a_{n+1} = \frac12\left(a_n + \frac{3}{a_n}\right). Show that a_n \ge \sqrt3 for all n \ge 2, that (a_n) is decreasing, and that a_n \to \sqrt3. Compute a_2, a_3, a_4.
Solution
All terms are positive. By AM–GM, a_{n+1} = \frac12\left(a_n + \frac3{a_n}\right) \ge \sqrt{a_n\cdot\frac{3}{a_n}} = \sqrt3. (Also a_1 = 2 > \sqrt3.)
By the Monotone Convergence Theorem a_n \to L \ge \sqrt 3 > 0. Taking limits in the recursion (quotient law, L \ne 0): L = \frac12(L + \frac3L), so L^2 = 3 and L = \sqrt3.
a_2 = 1.75, a_3 = 1.732142\ldots, a_4 = 1.7320508\ldots, against \sqrt3 = 1.7320508\ldots. The number of correct digits roughly doubles each step; Module 13 explains why (this is Newton’s method).
3.8Understanding
Decide whether each series converges: (a) \sum \frac{1}{\sqrt k} (b) \sum \frac{1}{k^2 + k + 1} (c) \sum \frac{k}{2^k} (use the ratio test) (d) \sum \frac{k!}{k^k}.
Solution
(a) Diverges: \frac{1}{\sqrt k} \ge \frac1k and the harmonic series diverges.
(b) Converges: 0 < \frac1{k^2+k+1} < \frac1{k^2}.
(c) Converges: \frac{a_{k+1}}{a_k} = \frac{k+1}{2k} \to \frac12 < 1. (Its sum is 2; see Module 19.)
Use subsequences to show that a_n = (-1)^n + \frac1n diverges.
Solution
The even terms 1 + \frac{1}{2m} \to 1 and the odd terms -1 + \frac{1}{2m-1} \to -1. If (a_n) converged, every subsequence would have the same limit.
3.10Challenge
Prove that a^{1/n} \to 1 for every a > 0. (Hint: for a > 1 write a^{1/n} = 1 + h_n and use Bernoulli’s inequality.)
Solution
For a > 1: a^{1/n} = 1 + h_n with h_n > 0. Bernoulli gives a = (1 + h_n)^n \ge 1 + nh_n, so 0 < h_n \le \frac{a - 1}{n} \to 0. For a = 1 it is trivial. For 0 < a < 1, a^{1/n} = \frac{1}{(1/a)^{1/n}} \to \frac11 = 1 by the first case and the quotient law.
3.11Challenge
Prove that n^{1/n} \to 1. (Hint: write n^{1/n} = 1 + h_n and keep only the \binom n2 term of the binomial expansion.)
Solution
With h_n \ge 0, for n \ge 2: \ n = (1 + h_n)^n \ge \binom{n}{2}h_n^2 = \frac{n(n-1)}{2}h_n^2. So h_n^2 \le \frac{2}{n-1} and 0 \le h_n \le \sqrt{\frac{2}{n-1}} \to 0.
3.12Challenge
Prove that e = \displaystyle\sum_{k=0}^\infty \frac{1}{k!}. (Hint: the proof of Theorem 3.14 shows e_n \le s_n := \sum_{k=0}^n \frac1{k!}. For the other direction fix m, keep only the terms k \le m in the expansion of e_n for n \ge m, and let n \to \infty.)
Solution
The series has positive terms and its partial sums s_n are bounded by 3 (same estimate as in the theorem), so s = \sum_{k=0}^\infty \frac1{k!} exists, and e_n \le s_n \le s gives e \le s.
Fix m. For n \ge m, dropping the terms with k > m,
This is a finite sum of terms each tending to \frac1{k!} as n \to \infty, so letting n\to\infty (limits preserve \le) gives e \ge s_m. Now let m \to \infty: e \ge s. Hence e = s.
3.13Challenge
Prove that e is irrational. (Hint: if e = p/q, consider x = q!\left(e - \sum_{k=0}^{q}\frac1{k!}\right).)
Solution
Suppose e = \frac pq with p,q \in \N. Then x = q!\,e - \sum_{k=0}^q \frac{q!}{k!} is an integer, since q!\,e = (q-1)!\,p and each \frac{q!}{k!} is an integer. By the previous exercise x = \sum_{k=q+1}^\infty \frac{q!}{k!} > 0. But
A sequence approaches its limit as n \to \infty. A function can approach a limit as x approaches any point a, from both sides at once, and this is the kind of limit derivatives need: the difference quotient \frac{f(a+h) - f(a)}{h} is not even defined at h = 0. This module defines \lim_{x\to a} f(x), shows how to compute and prove limits, and proves the trigonometric limit that every derivative of \sin and \cos depends on.
4.1Approaching without arriving
The function f(x) = \frac{x^2 - 1}{x - 1} is undefined at x = 1. Everywhere else it equals x + 1, so as x gets close to 1 its values get close to 2. A more interesting case is \frac{\sin x}{x}, which is also undefined at 0:
x
0.5
0.1
0.01
0.001
\frac{\sin x}{x}
0.958851
0.998334
0.999983
0.9999998
The graph of y = \frac{\sin x}{x} has a hole at x = 0. The value there is undefined, but the limit is 1.
And a physical example: a stone dropped from rest falls s(t) = 4.9t^2 metres in t seconds. Its average velocity between t = 1 and t = 1 + h is
The instantaneous velocity at t = 1 should be what this approaches as h \to 0, namely 9.8 m/s. We need a definition of “approaches” that never asks for the value at the point itself.
4.2The ε–δ definition
Definition 4.1Limit of a function
Let f be defined on an open interval around a, except possibly at a itself. We say \lim\limits_{x \to a} f(x) = L if
\text{for every } \eps > 0 \text{ there is a } \delta > 0 \text{ such that } 0 < |x - a| < \delta \implies |f(x) - L| < \eps.
grenseverdi
Three remarks.
The condition 0 < |x - a| excludes x = a. The value f(a) plays no part: it may be undefined, or different from L.
It is the same game as for sequences. Your opponent names \eps (a horizontal band L \pm \eps); you must find \delta (a vertical window a \pm \delta) so that the graph over the window, apart from the point a itself, stays inside the band.
If some \delta works, every smaller \delta works too. So you never need the best \delta, only one that works.
Example 4.2A linear function
Claim: \lim\limits_{x\to2}(3x - 1) = 5. We have |(3x - 1) - 5| = 3|x - 2|. Given \eps > 0, let \delta = \eps/3. If 0 < |x-2| < \delta then |(3x-1) - 5| = 3|x - 2| < 3\delta = \eps.
Example 4.3Restrict δ first
Claim: \lim\limits_{x\to3} x^2 = 9. We have |x^2 - 9| = |x - 3|\,|x+3|. The factor |x+3| is not small, but it is bounded near 3: if |x - 3| < 1 then 2 < x < 4 and |x + 3| < 7.
Given \eps > 0, let \delta = \min\left(1, \frac\eps7\right). If 0 < |x - 3| < \delta, then both |x - 3| < 1 (so |x + 3| < 7) and |x - 3| < \frac\eps7. Hence |x^2 - 9| < 7\cdot\frac\eps7 = \eps.
Example 4.4A square root
Claim: \lim\limits_{x\to4}\sqrt x = 2. For x \ge 0, multiplying by the conjugate gives
|\sqrt x - 2| = \frac{|x - 4|}{\sqrt x + 2} \le \frac{|x-4|}{2}.
Given \eps > 0, let \delta = \min(4, 2\eps). The condition \delta \le 4 keeps x > 0, where \sqrt x is defined. If 0 < |x - 4| < \delta then |\sqrt x - 2| \le \frac{|x-4|}{2} < \eps.
Example 4.5A removable hole
Claim: \lim\limits_{x\to1}\frac{x^2-1}{x-1} = 2. For x \ne 1 the expression equals x + 1, so \left|\frac{x^2 - 1}{x-1} - 2\right| = |x - 1|. Take \delta = \eps. The cancellation is legitimate precisely because the definition only looks at x \ne 1.
4.3Limits through sequences
The next theorem connects function limits to the sequence limits of Module 3. It means we get all the limit laws for functions for free.
Theorem 4.6Sequential characterisation of limits
\lim\limits_{x\to a} f(x) = L if and only if f(x_n) \to L for every sequence (x_n) with x_n \to a and x_n \ne a for all n.
Proof. (\Rightarrow) Let \eps>0 and take \delta from the definition. Since x_n \to a there is N with |x_n - a| < \delta for n \ge N. As x_n \ne a, we have 0 < |x_n - a| < \delta, so |f(x_n) - L| < \eps for n \ge N.
(\Leftarrow) We prove the contrapositive. Suppose the limit is not L. Negating the definition: there is an \eps > 0 such that for every \delta > 0 some x has 0 < |x - a| < \delta but |f(x) - L| \ge \eps. Using \delta = \frac1n for n = 1, 2, 3, \dots produces points x_n with 0 < |x_n - a| < \frac1n and |f(x_n) - L| \ge \eps. Then x_n \to a and x_n \ne a, but f(x_n) \not\to L. ∎
Theorem 4.7Limit laws for functions
If \lim\limits_{x\to a} f(x) = L and \lim\limits_{x\to a} g(x) = M, then f + g \to L + M, \ cf \to cL, \ fg \to LM, and f/g \to L/M provided M \ne 0.
Proof. Take any sequence x_n \to a with x_n \ne a. Then f(x_n) \to L and g(x_n) \to M, so by the limit laws for sequences (Theorem 3.8) f(x_n)g(x_n) \to LM, and similarly for the others. (For the quotient, g(x) \ne 0 near a because M \ne 0; see Exercise 4.8.) By Theorem 4.6 this proves each limit. ∎
Since \lim_{x\to a} x = a and constants have constant limits, it follows that for every polynomial P, \lim_{x\to a}P(x) = P(a), and for rational functions \lim_{x\to a}\frac{P(x)}{Q(x)} = \frac{P(a)}{Q(a)} whenever Q(a) \ne 0. Direct substitution works for polynomials and rational functions away from zeros of the denominator. At a point where substitution gives \frac00, simplify first: factorise and cancel, multiply by a conjugate, or combine fractions.
The sequential characterisation is also the best tool for showing that a limit does not exist: find two sequences approaching a along which f has different limits.
Example 4.9sin(1/x) has no limit at 0
Let x_n = \frac{1}{n\pi} and y_n = \frac{1}{2n\pi + \pi/2}. Both tend to 0, but \sin(1/x_n) = \sin(n\pi) = 0 while \sin(1/y_n) = \sin(2n\pi + \frac\pi2) = 1. So \lim_{x\to0}\sin(1/x) does not exist.
4.4One-sided limits
Definition 4.10One-sided limits
\lim\limits_{x\to a^+} f(x) = L means: for every \eps > 0 there is a \delta > 0 with |f(x) - L| < \eps whenever a < x < a + \delta. The left-hand limit \lim\limits_{x\to a^-} uses a - \delta < x < a instead.
Theorem 4.11Two sides make a limit
\lim\limits_{x \to a} f(x) = L if and only if both one-sided limits exist and equal L.
Proof. If the two-sided limit is L, the same \delta works on each side. Conversely, if \delta_1 works on the right and \delta_2 on the left for a given \eps, then \min(\delta_1,\delta_2) works on both sides. ∎
For the sign function \operatorname{sgn} x = \frac{x}{|x|} the right-hand limit at 0 is 1 and the left-hand limit is -1, so there is no limit. For \sqrt x at 0 only the right-hand limit makes sense (=0), because the function is not defined to the left.
Example 4.12A piecewise function (IB style)
Let f(x) = x^2 + 1 for x < 1 and f(x) = 3x - 1 for x \ge 1. Then \lim_{x\to1^-}f(x) = 2 and \lim_{x\to1^+} f(x) = 2, so \lim_{x\to1} f(x) = 2.
4.5Limits involving infinity
Definition 4.13Limits at infinity and infinite limits
\lim\limits_{x\to\infty} f(x) = L means: for every \eps > 0 there is an M with |f(x) - L| < \eps whenever x > M. (Similarly for x \to -\infty.)
\lim\limits_{x\to a} f(x) = \infty means: for every M there is a \delta > 0 with f(x) > M whenever 0 < |x - a| < \delta. (Similarly for -\infty, and for one-sided versions.)
These describe asymptotes. The line y = L is a horizontal asymptote if f(x) \to L as x \to \infty or x \to -\infty. The line x = a is a vertical asymptote if f(x) \to \pm\infty as x \to a from at least one side. The line y = mx + c is an oblique asymptote if f(x) - (mx + c) \to 0 as x \to \pm\infty. asymptote
For a rational function as x \to \pm\infty, divide numerator and denominator by the highest power of x in the denominator:
A useful trick: the substitution t = 1/x turns a limit as x \to \infty into a limit as t \to 0^+.
4.6The Squeeze Theorem and the key trigonometric limits
Theorem 4.14Squeeze Theorem for functions
Suppose g(x) \le f(x) \le h(x) for all x \ne a in some open interval around a, and \lim_{x\to a} g(x) = \lim_{x\to a} h(x) = L. Then \lim_{x\to a} f(x) = L.
Proof. Apply the Squeeze Theorem for sequences (Theorem 3.11) to g(x_n) \le f(x_n) \le h(x_n) for an arbitrary sequence x_n \to a with x_n \ne a, and use Theorem 4.6. ∎
y = x\sin(1/x) oscillates infinitely often near 0, but it is trapped between -|x| and |x|, so its limit at 0 is 0.
Theorem 4.15The fundamental trigonometric limit
\lim_{x\to 0}\frac{\sin x}{x} = 1 \qquad (x \text{ in radians}).
For 0 < x < \frac\pi2: triangle OAP sits inside sector OAP, which sits inside triangle OAT. Their areas are \frac12\sin x < \frac12 x < \frac12\tan x.
Proof. Let 0 < x < \frac\pi2. In the unit circle, triangle OAP has base 1 and height \sin x, the sector of angle x has area \frac x2 (this is where radians are needed), and triangle OAT has base 1 and height \tan x. The three regions are nested, so
\sin x < x < \tan x .
Dividing by \sin x > 0 and taking reciprocals gives
\cos x < \frac{\sin x}{x} < 1 .
To squeeze we need \cos x \to 1. From \sin t < t for small t>0 we get 0 \le 1 - \cos x = 2\sin^2\frac x2 < 2\left(\frac x2\right)^2 = \frac{x^2}{2}, so \cos x \to 1 as x \to 0^+. The Squeeze Theorem gives \frac{\sin x}{x}\to 1 as x\to0^+. Finally \frac{\sin x}{x} is even, so the left-hand limit is the same. ∎
NoteHow first-principles is this?
The proof uses two facts from geometry: the area of a sector, and the fact that the three regions are nested. That is a fair starting point, but it is geometry rather than analysis. In Module 19 we will define \sin by a power series, and then this limit follows from algebra alone. Note also that in degrees the limit would be \frac{\pi}{180}, which is why calculus always uses radians.
\displaystyle\lim_{x\to0}\frac{\sin 5x}{x} = \lim_{x\to0} 5\cdot\frac{\sin 5x}{5x} = 5, because u = 5x \to 0 as x \to 0. In general \frac{\sin kx}{x} \to k.
Key results
\lim_{x\to a} f(x) = L: \forall \eps>0\ \exists\delta>0 : 0<|x-a|<\delta \Rightarrow |f(x)-L|<\eps. The value f(a) is irrelevant.
Function limits are sequence limits along every sequence x_n \to a, x_n \ne a. So the limit laws carry over, and two sequences with different limits prove that no limit exists.
Substitution works for polynomials and rational functions; at \frac00, simplify first.
The two-sided limit exists exactly when both one-sided limits exist and agree.
\frac{\sin x}{x} \to 1 and \frac{1-\cos x}{x}\to 0 as x \to 0, with x in radians.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
Let f(x) = x^2 + 1 for x < 1 and f(x) = ax + 3 for x \ge 1. Find the value of a for which \lim_{x\to1} f(x) exists.
Solution
The left limit is 2 and the right limit is a + 3. They agree when a = -1.
4.3Fluency
Find all asymptotes of y = \dfrac{2x^2 + 3x - 1}{x - 1}.
Solution
Vertical: x = 1 (the numerator is 4 \ne 0 there, so y \to \pm\infty). Long division: 2x^2 + 3x - 1 = (x-1)(2x+5) + 4, so y = 2x + 5 + \frac{4}{x-1}. Since \frac{4}{x-1} \to 0 as x \to\pm\infty, the oblique asymptote is y = 2x + 5. There is no horizontal asymptote.
4.4Understanding
Prove from the ε–δ definition: (a) \lim_{x\to-1}(4x + 7) = 3 (b) \lim_{x\to2}x^2 = 4 (c) \lim_{x\to1}\frac1x = 1.
(b) |x^2 - 4| = |x - 2||x + 2|. If |x - 2| < 1 then 1 < x < 3 and |x + 2| < 5. Take \delta = \min(1, \eps/5); then |x^2 - 4| < 5\cdot\frac\eps5 = \eps.
(c) \left|\frac1x - 1\right| = \frac{|x - 1|}{|x|}. If |x - 1| < \frac12 then x > \frac12 and \frac{1}{|x|} < 2. Take \delta = \min\left(\frac12, \frac\eps2\right); then \left|\frac1x - 1\right| < 2\cdot\frac\eps2 = \eps.
4.5Understanding
Show that \lim_{x\to0}x^2\sin(1/x) = 0, and explain why this does not contradict the fact that \lim_{x\to0}\sin(1/x) does not exist.
Solution
-x^2 \le x^2\sin(1/x) \le x^2 for x \ne 0, and \pm x^2 \to 0, so the limit is 0 by the Squeeze Theorem. The product law needs both factors to have limits. Here \sin(1/x) has none, but it is bounded, and a bounded factor times something tending to 0 tends to 0.
4.6Understanding
Write out the negation of “\lim_{x\to a} f(x) = L”. Use it to prove that \lim_{x\to0}\operatorname{sgn} x does not exist, by showing that no number L is the limit.
Solution
Negation: there is an \eps > 0 such that for every \delta > 0 there is an x with 0 < |x - a| < \delta and |f(x) - L| \ge \eps.
Let L be any number and take \eps = 1. For any \delta > 0, the points x = \pm\frac\delta2 give \operatorname{sgn} x = \pm1. Since |1 - L| + |L + 1| \ge 2, at least one of |1 - L| and |-1 - L| is \ge 1, so one of the two points satisfies |\operatorname{sgn} x - L| \ge 1. So no L is the limit.
4.7Understanding
Show that \displaystyle\lim_{x\to0}\frac{1 - \cos x}{x^2} = \frac12.
Solution
\frac{1 - \cos x}{x^2} = \frac{1 - \cos^2 x}{x^2(1 + \cos x)} = \left(\frac{\sin x}{x}\right)^2\cdot\frac{1}{1 + \cos x} \to 1\cdot\frac12 = \frac12. So for small x, \cos x \approx 1 - \frac{x^2}{2}. Module 19 will explain this as the start of a Maclaurin series.
4.8Understanding
Prove that if \lim_{x\to a} f(x) = L > 0, then f(x) > \frac L2 > 0 for all x \ne a in some open interval around a. (We will use this repeatedly: a function with a positive limit is positive nearby.)
Solution
Take \eps = \frac L2 in the definition: there is \delta > 0 with |f(x) - L| < \frac L2 when 0 < |x - a| < \delta. Then f(x) > L - \frac L2 = \frac L2. The same argument with |f(x)| \ge |L| - |f(x) - L| shows that a non-zero limit keeps f away from 0 near a, which the quotient law needs.
4.9Understanding
Show that \lim_{x\to0} x\left\lfloor \frac1x\right\rfloor = 1, where \lfloor y\rfloor is the greatest integer \le y.
Solution
For every y, y - 1 < \lfloor y \rfloor \le y. With y = \frac1x: if x > 0, multiplying by x gives 1 - x < x\lfloor 1/x\rfloor \le 1. If x < 0 the inequalities reverse: 1 \le x\lfloor1/x\rfloor < 1 - x. Either way x\lfloor 1/x\rfloor lies between 1 and 1 - x, both of which tend to 1, so the limit is 1 by squeezing.
4.10Challenge
Let f(x) = x if x is rational and f(x) = 0 if x is irrational. Show that \lim_{x\to0}f(x) = 0, but that \lim_{x\to a} f(x) does not exist for any a \ne 0.
Solution
|f(x)| \le |x| for all x, so \delta = \eps works at 0.
Let a \ne 0. By density (Theorem 1.10 and Exercise 1.9) there are rationals q_n \to a and irrationals r_n \to a, all different from a. Then f(q_n) = q_n \to a and f(r_n) = 0 \to 0. These limits differ, so by Theorem 4.6 there is no limit at a.
4.11Challenge
Prove the product law for function limits directly from the ε–δ definition, without using sequences.
Solution
Suppose f \to L and g \to M as x \to a. Write |f(x)g(x) - LM| \le |f(x)|\,|g(x) - M| + |M|\,|f(x) - L|.
Choose \delta_1 so that |f(x) - L| < 1 for 0<|x-a|<\delta_1; then |f(x)| < |L| + 1. Given \eps > 0, choose \delta_2 with |g(x) - M| < \frac{\eps}{2(|L|+1)} and \delta_3 with |f(x) - L| < \frac{\eps}{2(|M|+1)}. For 0 < |x - a| < \min(\delta_1,\delta_2,\delta_3),
Prove that if \lim_{x\to a} f(x) = L then \lim_{x\to a}|f(x)| = |L|. Show by example that the converse fails, and prove that it holds when L = 0.
Solution
\big||f(x)| - |L|\big| \le |f(x) - L|, so the same \delta works. The converse fails for \operatorname{sgn} x at 0: |\operatorname{sgn} x| = 1 for x \ne 0, so its limit is 1, but \operatorname{sgn} x has no limit. When L = 0, the statements “|f(x) - 0| < \eps” and “\big||f(x)| - 0\big| < \eps” are identical.
Part I · Foundations · Module 5
Continuity
Kontinuitet
Big questionWhat does it mean for a graph to have no breaks, and what are such functions guaranteed to do?
Continuity is the precise version of “drawing the graph without lifting the pen”. A continuous function on a closed interval has two guaranteed behaviours: it takes every value in between (the Intermediate Value Theorem), and it attains a largest and a smallest value (the Extreme Value Theorem). Both fail over \Q, and both proofs run through completeness. Every optimisation problem you solved in IB relied silently on the second one.
5.1Continuity at a point
Definition 5.1Continuity
A function f is continuous ata if f is defined at a and \lim\limits_{x\to a} f(x) = f(a). In ε–δ form:
\text{for every } \eps > 0 \text{ there is a } \delta > 0 \text{ such that } |x - a| < \delta \implies |f(x) - f(a)| < \eps .
f is continuous on an interval if it is continuous at every point of it, using one-sided limits at any endpoints that belong to the interval. kontinuerlig
Three things must happen: f(a) exists, \lim_{x\to a} f(x) exists, and the two are equal. (The restriction 0 < |x - a| from the definition of a limit can be dropped, since at x = a the inequality holds trivially.) Combining with Theorem 4.6: f is continuous at a exactly when x_n \to a implies f(x_n) \to f(a). In words, continuous functions are the ones you can take limits inside: f(\lim x_n) = \lim f(x_n).
When continuity fails, it fails in one of a few recognisable ways:
Type
What goes wrong
Example at the point
Removable
the limit exists but f(a) is missing or wrong
\frac{x^2-4}{x-2} at x = 2
Jump
one-sided limits exist but differ
\lfloor x \rfloor at every integer
Infinite
f(x) \to \pm\infty
\frac1{x^2} at x = 0
Oscillating
no one-sided limit at all
\sin\frac1x at x = 0
The informal IB description (AHL 5.12) is the graph-has-no-breaks picture. The definition above is what that picture means, and it covers functions whose graphs you could never draw, such as the Dirichlet function, which is continuous nowhere (Exercise 5.7).
5.2Building continuous functions
Theorem 5.2Arithmetic of continuous functions
If f and g are continuous at a, so are f + g, cf, fg, and f/g provided g(a) \ne 0. In particular, polynomials are continuous everywhere and rational functions are continuous wherever they are defined.
Proof. Apply the limit laws (Theorem 4.7) with L = f(a) and M = g(a). ∎
Theorem 5.3Composites of continuous functions
If g is continuous at a and f is continuous at g(a), then f\circ g is continuous at a.
Proof. Let \eps > 0. Since f is continuous at g(a), there is \eta > 0 with |f(y) - f(g(a))| < \eps whenever |y - g(a)| < \eta. Since g is continuous at a, there is \delta > 0 with |g(x) - g(a)| < \eta whenever |x - a| < \delta. Putting y = g(x): if |x - a| < \delta then |f(g(x)) - f(g(a))| < \eps. ∎
The same argument shows that limits pass through continuous functions: if \lim_{x\to a}g(x) = b and f is continuous at b, then \lim_{x\to a} f(g(x)) = f(b). For example \lim_{x\to0}\cos\left(\frac{\sin x}{x}\right) = \cos 1.
Theorem 5.4sin and cos are continuous
For all real x and a, \ |\sin x - \sin a| \le |x - a| and |\cos x - \cos a| \le |x - a|. In particular \sin and \cos are continuous everywhere.
Proof. First, |\sin t| \le |t| for every t: for 0 < t < \frac\pi2 this is the inequality \sin t < t from the proof of Theorem 4.15; for t \ge \frac\pi2 we have |\sin t| \le 1 < t; and \sin is odd. The sum-to-product identity gives
So \delta = \eps works at every point. For cosine, use \cos x = \sin(x + \frac\pi2). ∎
Combining these results with Theorem 5.8 below and Module 9, every elementary function is continuous on its natural domain: polynomials, rational functions, roots, |x|, trigonometric and inverse trigonometric functions, exponentials and logarithms, and every function built from them by arithmetic and composition. This is why direct substitution gives the limit of such a function at any point of its domain.
5.3The Intermediate Value Theorem
Theorem 5.5Intermediate Value Theorem (IVT)
Let f be continuous on [a, b] and let k be any number between f(a) and f(b). Then f(c) = k for some c \in [a,b]. skjæringssetningen
A continuous curve from below the line y = k to above it must cross the line somewhere.
Proof. If k equals f(a) or f(b) there is nothing to prove. Suppose f(a) < k < f(b); the case f(a) > k > f(b) follows by applying this one to -f and -k.
Let S = \{x \in [a,b] : f(x) < k\}. It is non-empty (a \in S) and bounded above by b, so c = \sup S exists, and a \le c \le b. We rule out f(c) < k and f(c) > k.
Suppose f(c) < k. Then c \ne b. Apply continuity at c with \eps = k - f(c): there is \delta > 0 with f(x) < f(c) + \eps = k whenever |x - c| < \delta. Choose a point x with c < x < c + \delta and x \le b. Then x \in S and x > c, contradicting that c is an upper bound for S.
Suppose f(c) > k. Then c \ne a. With \eps = f(c) - k there is \delta > 0 with f(x) > k whenever |x - c| < \delta. So no point of (c - \delta, c] lies in S, and since every point of S is \le c, every point of S is \le c - \delta. Then c - \delta is an upper bound for S, contradicting that c is the least one.
Hence f(c) = k. ∎
Both hypotheses matter. Over \Q the theorem fails: x^2 - 2 is negative at 1 and positive at 2 but never zero at a rational point. Without continuity it fails too: \operatorname{sgn} x takes the values -1 and 1 on [-1,1] but never \frac12.
Example 5.6nth roots, cheaply
Let y > 0 and n \in \N. The polynomial p(x) = x^n - y is continuous, p(0) = -y < 0, and p(1 + y) = (1+y)^n - y \ge 1 + ny - y > 0 by Bernoulli. By the IVT there is c \in (0, 1+y) with c^n = y. Since x^n is strictly increasing on [0,\infty), this root is unique. Compare the effort with the proof of Theorem 1.9: the work is the same, but it has been packaged once and for all inside the IVT.
The IVT is also an algorithm. If f(a) and f(b) have opposite signs, evaluate f at the midpoint m = \frac{a+b}2 and keep whichever half still has a sign change. After n halvings the root is trapped in an interval of length \frac{b-a}{2^n}. This is the bisection method. Run forever, it gives a second proof of the IVT (for k = 0, which is enough after subtracting k): the halved intervals are nested, so by Exercise 1.10 some point c lies in all of them, and their endpoints converge to c from both sides. By continuity f(c) is a limit of values \le 0 and also of values \ge 0, so f(c) = 0.
def bisect(f, a, b, tol=1e-10):
# assumes f(a) and f(b) have opposite signs
while b - a > tol:
m = (a + b) / 2
if f(a) * f(m) <= 0:
b = m
else:
a = m
return (a + b) / 2
print(bisect(lambda x: x**3 + x - 1, 0, 1)) # 0.6823278038...
You will write programs like this in your first semester at NTNU, where numerical methods are taught alongside the theory.
5.4The Extreme Value Theorem
Theorem 5.7Extreme Value Theorem (EVT)
If f is continuous on a closed bounded interval [a,b], then f attains a maximum and a minimum there: there are points c, d \in [a,b] with
f(d) \le f(x) \le f(c) \quad\text{for all } x \in [a, b].
ekstremalverdisetningen
Proof.Step 1: f is bounded. If not, for each n there is x_n \in [a,b] with |f(x_n)| > n. The sequence (x_n) is bounded, so by Bolzano–Weierstrass (Theorem 3.16) some subsequence x_{n_k} converges to a limit c, and c \in [a,b] because limits preserve \le. By continuity f(x_{n_k}) \to f(c), so the sequence f(x_{n_k}) is convergent and hence bounded. But |f(x_{n_k})| > n_k \ge k, a contradiction.
Step 2: the supremum is attained. By step 1 and completeness, M = \sup\{f(x) : a \le x \le b\} exists. For each n, M - \frac1n is not an upper bound, so there is x_n \in [a,b] with M - \frac1n < f(x_n) \le M. Again a subsequence x_{n_k} converges to some c \in [a,b], and f(x_{n_k}) \to f(c) by continuity. By squeezing, f(x_{n_k}) \to M as well, so f(c) = M by uniqueness of limits.
For the minimum, apply this to -f. ∎
Every hypothesis is needed:
\frac1x is continuous on (0, 1] but unbounded: the interval is not closed.
x is continuous on (0, 1) and bounded, but has no maximum or minimum.
x on [0, \infty) has no maximum: the interval is not bounded.
f(x) = x for 0 \le x < 1 with f(1) = 0 has supremum 1 on [0,1], never attained: f is not continuous.
The EVT is what justifies the method you used for optimisation in IB. A continuous function on [a,b]has a maximum; Module 10 shows that at an interior maximum the derivative is zero; so the maximum must be at an endpoint or at a critical point, and comparing those finitely many values finds it.
5.5Continuity of inverse functions
Theorem 5.8Inverses of continuous monotone functions
If f is continuous and strictly monotone on an interval I, then f(I) is an interval and the inverse function f^{-1} : f(I) \to I is continuous (and strictly monotone in the same direction).
Taken on trustProof idea
That f(I) is an interval follows from the IVT. For the continuity of f^{-1}: a monotone function can only be discontinuous by jumping (its one-sided limits always exist, by an argument like the Monotone Convergence Theorem). A jump in f^{-1} would leave a gap in its range. But the range of f^{-1} is the interval I, which has no gaps. A full proof is in Adams and Essex, or any analysis text.
So x^{1/n} (the inverse of x^n on [0,\infty)), \arcsin, \arccos, \arctan, and in Module 9 the logarithm, are all continuous.
Beyond IBUniform continuity
In the definition of continuity, \delta may depend on the point a as well as on \eps. If one \delta works for every point at once, f is uniformly continuous. For example \frac1x is continuous on (0,1] but not uniformly continuous: near 0 the graph gets steeper and steeper, so ever smaller \delta are needed. A theorem of Heine says that a function continuous on a closed bounded interval is automatically uniformly continuous. That fact is the key step in proving that continuous functions are integrable (Module 14). The related idea of uniform convergence of sequences of functions is on the NTNU first-semester syllabus.
Key results
f is continuous at a when \lim_{x\to a} f(x) = f(a): you can take limits inside f.
Sums, products, quotients and composites of continuous functions are continuous, so every elementary function is continuous on its domain.
IVT: a continuous function on [a,b] takes every value between f(a) and f(b). It gives existence of roots and the bisection method.
EVT: a continuous function on a closed bounded interval attains a maximum and a minimum.
Both theorems need completeness, continuity, and (for the EVT) a closed bounded interval.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
5.1Fluency
Classify the discontinuity: (a) \frac{x^2-4}{x-2} at 2 (b) \lfloor x\rfloor at 3 (c) \frac{1}{(x-1)^2} at 1 (d) \sin\frac1x at 0. For any removable discontinuity, say how to redefine the function to remove it.
Solution
(a) Removable: the limit is 4; define f(2) = 4, giving the function x + 2. (b) Jump: left limit 2, right limit 3. (c) Infinite. (d) Oscillating: no one-sided limits (Example 4.9).
5.2Fluency
Find k so that f(x) = kx^2 + 1 for x \le 2 and f(x) = 3x - k for x > 2 is continuous everywhere.
Solution
Both pieces are continuous, so only x = 2 matters. The left value and limit is 4k + 1; the right limit is 6 - k. Setting 4k + 1 = 6 - k gives k = 1.
5.3Fluency
Show that x^5 - 3x + 1 = 0 has at least three real roots.
Solution
Let f(x) = x^5 - 3x + 1, a continuous function. f(-2) = -25 < 0, f(0) = 1 > 0, f(1) = -1 < 0, f(2) = 27 > 0. By the IVT there is a root in each of (-2,0), (0,1) and (1,2), and these intervals are disjoint.
5.4Fluency
Use four steps of bisection on [0, 1] to locate the root of x^3 + x - 1 = 0 in an interval of length \frac1{16}.
Solution
f(0) = -1, f(1) = 1. Midpoint 0.5: f = -0.375, keep [0.5, 1]. Midpoint 0.75: f \approx 0.172, keep [0.5, 0.75]. Midpoint 0.625: f \approx -0.131, keep [0.625, 0.75]. Midpoint 0.6875: f \approx 0.0125, keep [0.625, 0.6875]. The root (about 0.6823) lies in [0.625, 0.6875].
5.5Understanding
Prove from the ε–δ definition that f(x) = x^2 is continuous at every real number a.
Solution
|x^2 - a^2| = |x - a|\,|x + a|. If |x - a| < 1 then |x + a| \le |x - a| + 2|a| < 1 + 2|a|. Given \eps > 0, let \delta = \min\left(1, \frac{\eps}{1 + 2|a|}\right). If |x - a| < \delta then |x^2 - a^2| < (1 + 2|a|)\cdot\frac{\eps}{1 + 2|a|} = \eps. Note that \delta depends on a as well as \eps: x^2 is not uniformly continuous on \R.
5.6Understanding
(A fixed-point theorem.) Prove that if f : [0,1] \to [0,1] is continuous, then f(c) = c for some c \in [0,1].
Solution
Let g(x) = f(x) - x, continuous on [0,1]. Since f takes values in [0,1], g(0) = f(0) \ge 0 and g(1) = f(1) - 1 \le 0. By the IVT, g(c) = 0 for some c \in[0,1], that is f(c) = c. (Brouwer’s theorem generalises this to higher dimensions.)
5.7Understanding
Show that the Dirichlet function D is discontinuous at every point, and that g(x) = x\,D(x) is continuous at 0 and nowhere else.
Solution
Let a \in \R. There are rationals q_n \to a and irrationals r_n \to a (density). Then D(q_n) = 1 and D(r_n) = 0, so the two sequences of values have different limits, and \lim_{x\to a} D(x) does not exist. So D is not continuous at a.
For g: |g(x)| \le |x|, so g(x) \to 0 = g(0) as x \to 0. At a \ne 0 the same two sequences give g(q_n) = q_n \to a and g(r_n) = 0, and a \ne 0, so there is no limit.
5.8Understanding
Give an example of each, and say which hypothesis of the EVT fails: (a) a continuous function on (0,1) with no maximum; (b) a continuous function on [0,\infty) that is unbounded; (c) a function on [0,1] with no maximum.
Solution
(a) f(x) = x: the interval is not closed. (b) f(x) = x: the interval is not bounded. (c) f(x) = x for x < 1, f(1) = 0: the function is not continuous at 1. (Many other examples work.)
5.9Challenge
Continue Exercise 2.10: if f is continuous and f(x + y) = f(x) + f(y) for all x, y, prove that f(x) = cx for every real x, where c = f(1).
Solution
We know f(q) = cq for every rational q. Given a real x, choose rationals q_n \to x (density of \Q). By continuity f(x) = \lim f(q_n) = \lim cq_n = cx.
(Without continuity there are wild solutions that are not of this form, but constructing them needs the axiom of choice.)
5.10Challenge
A hiker starts up a mountain path at 08:00 and reaches the top at 16:00. The next day she starts down the same path at 08:00 and reaches the bottom at 16:00, walking at a completely different and varying pace. Prove that there is a time of day at which she is at exactly the same point of the path on both days.
Solution
Measure position by the distance u(t) (day 1) and d(t) (day 2) along the path from the bottom, at time t \in [8, 16]. Both are continuous. Let g(t) = u(t) - d(t). At t = 8: u = 0 and d = the full length \ell, so g(8) = -\ell < 0. At t = 16: g(16) = \ell - 0 > 0. By the IVT, g(t) = 0 for some t. (Picture both days happening at once: the two hikers must meet.)
5.11Challenge
(a) Prove that if f is continuous on an interval and never zero, then f has constant sign there. (b) Prove that a continuous function f : \R \to \R that takes only rational values is constant.
Solution
(a) If f(p) < 0 < f(q) for two points of the interval, the IVT gives a zero between them.
(b) Suppose f(p) \ne f(q). Between the two values lies an irrational number k (Exercise 1.9). By the IVT, f takes the value k somewhere between p and q, contradicting that all its values are rational.
Part II · The derivative · Module 6
The derivative from first principles
Den deriverte
Big questionHow fast is something changing at an instant, when an instant has no duration?
This is the idea calculus is named for. You know the derivative as a set of rules. This module defines it as a limit, computes it from that definition for the basic functions (the IB phrase is “differentiation from first principles”), and pins down exactly what differentiability means and what it implies.
6.1Two problems, one limit
The tangent problem. What is the slope of a curve y = f(x) at the point P = (a, f(a))? A line through P and a nearby point Q = (a + h, f(a+h)) on the curve, a secant, has slope
\frac{f(a+h) - f(a)}{h}.
The tangent at P should be the limiting position of these secants as Q slides towards P, that is as h \to 0.
The velocity problem. If s(t) is the position of a moving object at time t, its average velocity over the time interval from t to t + h is \frac{s(t+h) - s(t)}{h}. Its velocity at the instant t should be the limit of these averages as h \to 0. You saw this for a falling stone in Module 4.
Both problems lead to the same limit, and Newton and Leibniz’s insight was that this one limit answers both.
6.2The definition
Definition 6.1Derivative
A function f is differentiable ata if the limit
f'(a) = \lim_{h\to0}\frac{f(a+h) - f(a)}{h}
exists (as a real number). Then f'(a) is the derivative of f at a. Putting x = a + h gives the equivalent form f'(a) = \lim\limits_{x\to a}\frac{f(x) - f(a)}{x - a}. den derivertederiverbar
The derivative functionf' assigns the number f'(x) to each x at which f is differentiable. Several notations are in use, and you need to read all of them:
f'(x), \qquad \frac{dy}{dx}, \qquad \frac{d}{dx}f(x), \qquad Df(x), \qquad \dot y \ \ (\text{for time derivatives}).
Newton’s dot is standard in physics: in mechanics at NTNU you will write \dot x for velocity and \ddot x for acceleration.
The derivative has two readings (SL 5.1). Geometrically, f'(a) is the slope of the tangent line at (a, f(a)). Physically, it is the instantaneous rate of change of f with respect to x, measured in units of f per unit of x: metres per second, litres per minute, kroner per item.
Definition 6.2Tangent and normal lines
If f is differentiable at a, the tangent line to y = f(x) at (a, f(a)) is
y = f(a) + f'(a)(x - a).
The normal line is the line through the same point perpendicular to the tangent. Its slope is -\frac{1}{f'(a)} when f'(a) \ne 0, and it is the vertical line x = a when f'(a) = 0.
6.3Differentiation from first principles
Constant functions have derivative 0, and f(x) = mx + c has \frac{f(x+h) - f(x)}{h} = m for every h \ne 0, so f'(x) = m. The first interesting case is x^2:
At x = 0 the quotient is \frac{\sqrt h}{h} = \frac{1}{\sqrt h} \to \infty as h \to 0^+: the graph of \sqrt x has a vertical tangent at the origin and \sqrt x is not differentiable there.
Theorem 6.5Derivatives of sine and cosine
\dfrac{d}{dx}\sin x = \cos x \quad and \quad\dfrac{d}{dx}\cos x = -\sin x.
Proof. By the addition formula,
\frac{\sin(x+h) - \sin x}{h} = \frac{\sin x\cos h + \cos x \sin h - \sin x}{h} = -\sin x\cdot\frac{1 - \cos h}{h} + \cos x\cdot\frac{\sin h}{h}.
As h \to 0, \frac{1-\cos h}{h} \to 0 and \frac{\sin h}{h} \to 1 (Corollary 4.16 and Theorem 4.15), so the quotient tends to \cos x. Similarly
Everything the IB told you about differentiating trigonometric functions rests on these two limits, and those rest on radian measure.
From the limit laws, derivatives respect sums and constant multiples: (f + g)' = f' + g' and (cf)' = cf'. With the power rule this differentiates every polynomial (SL 5.3). Module 7 proves the product, quotient and chain rules.
6.4Differentiability and continuity
Theorem 6.6Differentiable implies continuous
If f is differentiable at a, then f is continuous at a.
Proof. For x \ne a,
f(x) - f(a) = \frac{f(x) - f(a)}{x - a}\cdot(x - a) \to f'(a)\cdot 0 = 0 \quad\text{as } x \to a,
by the product law. So f(x) \to f(a). ∎
The converse is false. For f(x) = |x| at 0, the difference quotient \frac{|h|}{h} equals 1 for h > 0 and -1 for h < 0. Try the “|x|” option in the graph above: the secants from the right and from the left settle on different slopes.
Definition 6.7One-sided derivatives
f'_+(a) = \lim\limits_{h\to0^+}\frac{f(a+h)-f(a)}{h} and f'_-(a) = \lim\limits_{h\to0^-}\frac{f(a+h) - f(a)}{h}. A function is differentiable at a exactly when both exist and are equal. For |x| at 0, f'_+(0) = 1 and f'_-(0) = -1.
Here is a gallery of the ways a continuous function can fail to be differentiable at 0. Each is worth sketching.
Function
What happens at 0
Difference quotient
|x|
corner
\pm 1 from the two sides
x^{2/3}
cusp
h^{-1/3} \to \pm\infty from the two sides
x^{1/3}
vertical tangent
h^{-2/3} \to +\infty
x\sin(1/x), value 0 at 0
oscillation
\sin(1/h), which has no limit
And a function that is differentiable but still surprising: g(x) = x^2\sin(1/x) with g(0) = 0. At 0 the quotient is \frac{h^2\sin(1/h)}{h} = h\sin(1/h) \to 0, so g'(0) = 0. In Module 7 you will see that g'(x) has no limit as x \to 0. So a derivative can exist everywhere without being a continuous function. The IB asks for an informal understanding of continuity and differentiability (AHL 5.12); this is what the formal version looks like.
6.5The best linear approximation
Theorem 6.8Differentiable means locally linear
f is differentiable at a with f'(a) = m if and only if
f(a+h) = f(a) + mh + E(h) \qquad\text{where}\qquad \frac{E(h)}{h} \to 0 \text{ as } h \to 0 .
Proof. Define E(h) = f(a+h) - f(a) - mh. Then \frac{E(h)}{h} = \frac{f(a+h) - f(a)}{h} - m, which tends to 0 exactly when the difference quotient tends to m. ∎
In words: near a, f is approximately the linear function h \mapsto f(a) + f'(a)h, with an error that is small even compared with h. If you zoom in on the graph of a differentiable function, it looks more and more like its tangent line. This gives the linear approximation
f(a + h) \approx f(a) + f'(a)\,h, \qquad\text{or}\qquad \Delta f \approx f'(a)\,\Delta x .
For example, with f(x) = \sqrt x and a = 4: \sqrt{4.1} \approx 2 + \frac{1}{4}(0.1) = 2.025, while the true value is 2.02485\ldots This point of view is the one that generalises: in several variables (your second semester) the derivative is the best linear approximation, and Taylor polynomials (Module 19) are the best polynomial approximations.
6.6Higher derivatives
If f' is itself differentiable, its derivative is the second derivativef'' = (f')', also written \frac{d^2y}{dx^2}. Continuing gives f''' and in general f^{(n)}, the nth derivative. If s(t) is position, then s' is velocity and s'' is acceleration (\ddot x in physics notation). andrederivert
Example 6.9Patterns in higher derivatives
For f(x) = x^n: \ f^{(k)}(x) = n(n-1)\cdots(n-k+1)x^{n-k} for k \le n, so f^{(n)}(x) = n! and every derivative after that is 0.
For \sin: \ \sin \to \cos \to -\sin \to -\cos \to \sin, a cycle of length 4. Compactly, \dfrac{d^n}{dx^n}\sin x = \sin\left(x + \dfrac{n\pi}{2}\right) (Exercise 6.6).
Key results
f'(a) = \lim_{h\to0}\frac{f(a+h)-f(a)}{h}: the slope of the tangent and the instantaneous rate of change.
Tangent: y = f(a) + f'(a)(x-a); normal slope -1/f'(a).
Find the equations of the tangent and the normal to y = x^3 - 2x at the point where x = 1.
Solution
y(1) = -1 and y' = 3x^2 - 2, so y'(1) = 1. Tangent: y = -1 + (x - 1), i.e. y = x - 2. Normal: slope -1 through (1,-1), i.e. y = -x.
6.3Fluency
Each limit is a derivative f'(a) in disguise. Identify f and a and evaluate: (a) \displaystyle\lim_{h\to0}\frac{(2+h)^5 - 32}{h} (b) \displaystyle\lim_{x\to\pi/3}\frac{\cos x - \frac12}{x - \frac\pi3} (c) \displaystyle\lim_{h\to0}\frac{\sqrt{9+h} - 3}{h}.
Solution
(a) f(x) = x^5, a = 2: 5\cdot2^4 = 80. (b) f = \cos, a = \frac\pi3: -\sin\frac\pi3 = -\frac{\sqrt3}{2}. (c) f = \sqrt{\ }, a = 9: \frac{1}{2\sqrt9} = \frac16 (compare the direct computation in Module 4).
6.4Fluency
Where is f(x) = |x^2 - 4| not differentiable? Find the one-sided derivatives there.
Solution
f(x) = x^2 - 4 for |x| \ge 2 and 4 - x^2 for |x| < 2. Away from \pm2 it is a polynomial, hence differentiable. At x = 2: from the right the slope is 2x = 4, from the left -2x = -4. At x = -2: from the right -2x = 4, from the left 2x = -4. So f is not differentiable at x = \pm 2 (corners where the parabola is reflected).
6.5Fluency
A tank drains so that it holds V(t) = (20 - t)^2 litres after t minutes, 0 \le t \le 20. Find the average rate of change of V over the first 5 minutes and the instantaneous rate at t = 5, with units, and interpret the signs.
Solution
Average: \frac{V(5) - V(0)}{5} = \frac{225 - 400}{5} = -35 litres per minute. Instantaneous: V'(t) = -2(20 - t), so V'(5) = -30 litres per minute. Both are negative because the volume is decreasing. At t = 5 the tank is draining at 30 L/min, more slowly than its average over the first five minutes, because the outflow slows as the tank empties.
6.6Understanding
Prove by induction that \dfrac{d^n}{dx^n}\sin x = \sin\left(x + \dfrac{n\pi}{2}\right) for all n \in \N. (You may use the first-principles result that \frac{d}{dx}\sin(x + c) = \cos(x + c) for any constant c; the proof is identical to Theorem 6.5.)
Solution
For n = 1: (\sin x)' = \cos x = \sin(x + \frac\pi2). Suppose the formula holds for n. Then
Let f(x) = x|x|. Show that f is differentiable everywhere with f'(x) = 2|x|, but that f' is not differentiable at 0.
Solution
For x > 0, f(x) = x^2 and f'(x) = 2x; for x < 0, f(x) = -x^2 and f'(x) = -2x. At 0: \frac{f(h) - f(0)}{h} = \frac{h|h|}{h} = |h| \to 0. So f'(x) = 2|x| for all x, which has a corner at 0. A function can be differentiable once without being differentiable twice.
6.8Understanding
Show that f(x) = x^{1/3} is continuous at 0 but not differentiable there. Describe the tangent line at the origin.
Solution
|x^{1/3}| < \eps whenever |x| < \eps^3, so f is continuous at 0. The difference quotient is \frac{h^{1/3}}{h} = h^{-2/3} \to +\infty as h \to 0 from either side. The curve has a vertical tangent: the line x = 0.
6.9Understanding
(a) Suppose f is differentiable at a. Prove that \displaystyle\lim_{h\to0}\frac{f(a+h) - f(a-h)}{2h} = f'(a). (b) Show that this limit can exist when f is not differentiable at a. (c) For f = \sin and a = 1, compare the forward quotient \frac{f(a+h)-f(a)}{h} and the symmetric quotient with \cos 1 when h = 0.1.
(b) f(x) = |x|, a = 0: the symmetric quotient is \frac{|h| - |-h|}{2h} = 0 for every h, so the limit is 0, but f'(0) does not exist.
(c) Forward: \frac{\sin1.1 - \sin1}{0.1} \approx 0.49736. Symmetric: \frac{\sin 1.1 - \sin 0.9}{0.2} \approx 0.53940. True value \cos 1 \approx 0.54030. The errors are about 0.043 and 0.0009: the symmetric quotient is far more accurate. Module 19 explains why (its error is proportional to h^2, not h). Numerical software uses it for exactly this reason.
6.10Challenge
Suppose |f(x)| \le x^2 for all x. Prove that f is differentiable at 0 and f'(0) = 0.
Solution
First |f(0)| \le 0, so f(0) = 0. Then \left|\frac{f(h) - f(0)}{h}\right| = \frac{|f(h)|}{|h|} \le |h| \to 0, so the difference quotient tends to 0 by squeezing. This covers x^2\sin(1/x), x^2 D(x) with D the Dirichlet function, and many other strange functions at once.
6.11Challenge
Suppose f(x + y) = f(x)f(y) for all x, y, that f is not the zero function, and that f is differentiable at 0 with f'(0) = k. Prove that f(0) = 1 and that f is differentiable everywhere with f'(x) = k\,f(x).
Solution
Choose x_0 with f(x_0) \ne 0. Then f(x_0) = f(x_0 + 0) = f(x_0)f(0), so f(0) = 1. For any x,
So a function that turns sums into products has a derivative proportional to itself. Module 9 shows that this is the defining property of exponential functions.
6.12Challenge
Let g(x) = x^2\sin(1/x) for x \ne 0 and g(0) = 0. Using only the definition, show that g is differentiable at 0. Then show that the function x\sin(1/x) (with value 0 at 0) is not differentiable at 0.
Solution
\frac{g(h) - g(0)}{h} = h\sin(1/h), and |h\sin(1/h)| \le |h| \to 0. So g'(0) = 0.
For k(x) = x\sin(1/x): \frac{k(h) - k(0)}{h} = \sin(1/h), which has no limit as h \to 0 (Example 4.9). One extra factor of x makes the difference between differentiable and not.
Part II · The derivative · Module 7
Rules of differentiation
Derivasjonsregler
Big questionHow do we differentiate complicated functions without going back to limits every time?
With the definition in hand we can now prove the rules that let you differentiate almost anything without going back to limits: the product, quotient and chain rules. You used all three in IB. Here you will see why they are true, and why the “obvious” proof of the chain rule has a hole in it.
7.1Sums and constant multiples
Theorem 7.1Linearity
If f and g are differentiable at x and a, b are constants, then (af + bg)'(x) = af'(x) + bg'(x).
Proof.\frac{(af + bg)(x+h) - (af+bg)(x)}{h} = a\,\frac{f(x+h) - f(x)}{h} + b\,\frac{g(x+h) - g(x)}{h}, and the limit laws do the rest. ∎
Combined with the power rule this differentiates every polynomial: \frac{d}{dx}(4x^3 - 7x + 2) = 12x^2 - 7.
7.2The product rule
Theorem 7.2Product rule
If f and g are differentiable at x, then so is fg, and (fg)'(x) = f'(x)g(x) + f(x)g'(x). produktregelen
Proof. Add and subtract f(x+h)g(x) in the numerator:
As h \to 0, f(x+h) \to f(x) because a differentiable function is continuous (Theorem 6.6), and the two quotients tend to g'(x) and f'(x). The limit is f(x)g'(x) + g(x)f'(x). ∎
A picture explains the shape of the formula. Think of f and g as the sides of a rectangle of area fg. If the sides grow by \Delta f and \Delta g, the area grows by f\,\Delta g + g\,\Delta f + \Delta f\,\Delta g. Divided by \Delta x, the first two terms give the product rule, and the corner piece \Delta f\,\Delta g is of second order and disappears in the limit. Leibniz wrote this as d(uv) = u\,dv + v\,du.
PitfallThe derivative of a product is not the product of derivatives
(x \cdot x)' = 2x, but (x)'(x)' = 1.
7.3The quotient rule
Lemma 7.3Reciprocal rule
If g is differentiable at x and g(x) \ne 0, then \left(\dfrac1g\right)'(x) = -\dfrac{g'(x)}{g(x)^2}.
Proof. Since g is continuous at x and g(x) \ne 0, also g(x+h) \ne 0 for small h (Exercise 4.8). Then
Proof. Write \frac fg = f\cdot\frac1g and use the product rule and the reciprocal rule: \ f'\cdot\frac1g + f\cdot\left(-\frac{g'}{g^2}\right) = \frac{f'g - fg'}{g^2}. ∎
Corollary 7.5Power rule for all integers
For every integer n (and x \ne 0 when n < 0), \ \dfrac{d}{dx}x^n = nx^{n-1}.
Proof. For n > 0 this is Theorem 6.3, and n = 0 is trivial. For n = -m with m \in \N, the reciprocal rule gives \frac{d}{dx}\frac{1}{x^m} = -\frac{mx^{m-1}}{x^{2m}} = -mx^{-m-1} = nx^{n-1}. ∎
This is the full statement of SL 5.3. Rational exponents, such as x^{3/2}, come in Module 8, and real exponents in Module 9.
7.4The chain rule
Theorem 7.6Chain rule
If g is differentiable at a and f is differentiable at g(a), then f\circ g is differentiable at a and
(f\circ g)'(a) = f'\big(g(a)\big)\,g'(a).
In Leibniz notation, with y = f(u) and u = g(x): \ \dfrac{dy}{dx} = \dfrac{dy}{du}\cdot\dfrac{du}{dx}. kjerneregelen
and let h \to 0. The flaw is that g(a+h) - g(a) may be zero for values of h arbitrarily close to 0, and then the first fraction is meaningless. This really happens: for g(x) = x^2\sin(1/x) (with g(0) = 0) we have g(h) = 0 at every h = \frac{1}{n\pi}. The repair is to avoid dividing by g(a+h) - g(a) at all.
Lemma 7.7Differentiability without division
f is differentiable at b if and only if there is a function \varphi, continuous at b, such that
f(y) - f(b) = \varphi(y)\,(y - b) \quad\text{for all } y \text{ near } b.
In that case \varphi(b) = f'(b).
Proof. If f is differentiable at b, define \varphi(y) = \frac{f(y) - f(b)}{y - b} for y \ne b and \varphi(b) = f'(b). The equation holds for y \ne b by construction and for y = b because both sides are 0. And \varphi(y) \to f'(b) = \varphi(b) as y \to b, which is continuity at b. Conversely, if such a \varphi exists, then \frac{f(y) - f(b)}{y-b} = \varphi(y) \to \varphi(b), so f'(b) exists and equals \varphi(b). ∎
Proof (chain rule). Let b = g(a) and take \varphi from the lemma for f at b. For all x near a,
As x \to a: g(x) \to g(a) = b since g is continuous at a, so \varphi(g(x)) \to \varphi(b) = f'(b) because \varphi is continuous at b (limits pass through continuous functions, Module 5). The second factor tends to g'(a). By the product law the limit is f'(g(a))\,g'(a). ∎
In practice, differentiate from the outside in, multiplying by the derivative of each inner layer:
A linear inner function contributes just its slope: \dfrac{d}{dx}f(ax+b) = a\,f'(ax+b). For example \frac{d}{dx}\cos(5x - 2) = -5\sin(5x-2). This special case will matter for integration in Module 15.
NoteIs dy/dx a fraction?
Not literally: dy and dx on their own have not been defined. But the chain rule says \frac{dy}{du}\cdot\frac{du}{dx} = \frac{dy}{dx}, and in Module 8 we will see \frac{dx}{dy} = 1\big/\frac{dy}{dx}. Leibniz’s notation was designed so that these rules look like fraction arithmetic. Use the convenience, and remember that each step is a theorem.
7.5All six trigonometric functions
Theorem 7.9Derivatives of tan, sec, csc, cot
\frac{d}{dx}\tan x = \sec^2 x, \qquad \frac{d}{dx}\sec x = \sec x\tan x, \qquad \frac{d}{dx}\csc x = -\csc x\cot x, \qquad \frac{d}{dx}\cot x = -\csc^2 x .
A memory aid: the “co-” functions (\cos, \csc, \cot) are the ones with a minus sign. These are the AHL 5.15 derivatives of \tan x, \sec x, \csc x and \cot x.
Factorising the common powers first, as here, is what makes stationary points easy to find later.
Example 7.11A tangent line (SL 5.4)
For y = \sin 2x at x = \frac\pi6: y = \frac{\sqrt3}{2} and y' = 2\cos 2x = 2\cos\frac\pi3 = 1. The tangent is y = \frac{\sqrt3}2 + \left(x - \frac\pi6\right).
PitfallCommon slips
\frac{d}{dx}\sin^2 x = 2\sin x\cos x, not \cos^2 x: the outer function is squaring.
\frac{d}{dx}\sin(x^2) = 2x\cos(x^2), not \cos(2x): the inner function is untouched in the first factor.
In the quotient rule the order matters: f'g - fg', not fg' - f'g.
Beyond IBLeibniz’s rule for higher derivatives
Applying the product rule repeatedly gives a binomial-theorem pattern:
(fg)^{(n)} = \sum_{k=0}^n\binom nk f^{(k)}g^{(n-k)} .
For example (fg)'' = f''g + 2f'g' + fg''. The proof is by induction (Exercise 7.11).
Show that y = \sin 2x + \cos 2x satisfies y'' + 4y = 0.
Solution
y' = 2\cos 2x - 2\sin 2x and y'' = -4\sin 2x - 4\cos 2x = -4y. This is the equation of simple harmonic motion, which you will solve in general in your first year at NTNU.
7.6Understanding
Derive the quotient rule directly from the definition of the derivative, without using the product rule.
Solution
Put everything over a common denominator and add and subtract f(x)g(x):
Let g(x) = x^2\sin(1/x) for x \ne 0 and g(0) = 0. Find g'(x) for x \ne 0, and show that \lim_{x\to0}g'(x) does not exist even though g'(0) = 0.
Solution
For x \ne 0, by the product and chain rules, g'(x) = 2x\sin(1/x) + x^2\cos(1/x)\cdot\left(-\frac1{x^2}\right) = 2x\sin(1/x) - \cos(1/x). The first term tends to 0, but \cos(1/x) has no limit as x \to 0 (same argument as for \sin(1/x)). So g'(x) has no limit, while g'(0) = 0 from Module 6. g is differentiable everywhere, but g' is not continuous at 0.
7.10Understanding
For the function g of the previous exercise, show that g\left(\frac{1}{n\pi}\right) = 0 for every n \in \N. Explain why this breaks the “tempting proof” of the chain rule when the inner function is g and a = 0.
Solution
g\left(\frac1{n\pi}\right) = \frac{1}{n^2\pi^2}\sin(n\pi) = 0 = g(0). So g(0 + h) - g(0) = 0 for h = \frac1{n\pi}, values of h arbitrarily close to 0. The tempting proof divides by g(a+h) - g(a), which is 0 at all these h, so its first fraction is undefined infinitely often near h = 0 and its limit cannot even be formed.
7.11Challenge
Prove Leibniz’s rule (fg)^{(n)} = \sum_{k=0}^n\binom nk f^{(k)}g^{(n-k)} by induction, and use it to find the 10th derivative of x^2\sin x.
Solution
For n = 1 it is the product rule. Assume it for n and differentiate each term with the product rule:
and \binom n{k-1} + \binom nk = \binom{n+1}k (Pascal’s rule).
With f = x^2 only k = 0, 1, 2 contribute:
\frac{d^{10}}{dx^{10}}(x^2\sin x) = x^2\sin^{(10)}x + 10\cdot2x\sin^{(9)}x + 45\cdot2\sin^{(8)}x = -x^2\sin x + 20x\cos x + 90\sin x,
using \sin^{(n)}x = \sin(x + \frac{n\pi}2).
7.12Challenge
Prove that the derivative of a differentiable even function is odd, and the derivative of a differentiable odd function is even. Prove also that the derivative of a differentiable periodic function is periodic with the same period.
Solution
If f(-x) = f(x) for all x, differentiate both sides with the chain rule: -f'(-x) = f'(x), so f' is odd. If f(-x) = -f(x), then -f'(-x) = -f'(x), so f' is even. If f(x + p) = f(x), then f'(x+p) = f'(x). (Check: \cos is even and \cos' = -\sin is odd.)
Part II · The derivative · Module 8
Inverse functions and implicit differentiation
Omvendte funksjoner og implisitt derivasjon
Big questionIf we know how fast y changes with x, how fast does x change with y?
If y = f(x) and we know \frac{dy}{dx}, what is \frac{dx}{dy}? The answer, its reciprocal, is the key to differentiating every inverse function: roots, the inverse trigonometric functions, and in Module 9 the logarithm. The same idea, differentiating an equation without solving it first, gives implicit differentiation.
8.1The derivative of an inverse function
The graph of f^{-1} is the graph of f reflected in the line y = x (Module 2). Reflection swaps horizontal and vertical, so it swaps “rise” and “run”: a tangent of slope m at (a, b) on the graph of f becomes a tangent of slope \frac1m at (b, a) on the graph of f^{-1}.
Theorem 8.1Inverse function rule
Let f be continuous and strictly monotone on an open interval I, differentiable at a \in I with f'(a) \ne 0, and let b = f(a). Then f^{-1} is differentiable at b and
As y \to b, continuity of f^{-1} gives x \to a, always with x \ne a. So the denominator tends to f'(a) \ne 0 and the whole expression tends to \frac{1}{f'(a)}. ∎
The hypothesis f'(a) \ne 0 matters. The function x^3 has a horizontal tangent at 0, so its inverse \sqrt[3]{x} has a vertical tangent at 0 and is not differentiable there (compare Module 6).
Example 8.2An inverse you cannot write down
Let f(x) = x^3 + x + 1. Since f'(x) = 3x^2 + 1 > 0, f is strictly increasing and has an inverse, but solving y = x^3 + x + 1 for x is unpleasant. We do not need to: f(1) = 3 and f'(1) = 4, so (f^{-1})'(3) = \frac14.
8.2Rational powers
Theorem 8.3Power rule for rational exponents
For every rational number r and every x > 0, \ \dfrac{d}{dx}x^r = rx^{r-1}.
Proof. First let r = \frac1n with n \in \N. On (0,\infty), x^{1/n} is the inverse of y^n, whose derivative ny^{n-1} is non-zero. By the inverse function rule, at y = x^{1/n},
This completes SL 5.6’s “derivative of x^n, n \in \Q”. Where the power is defined for negative x (for example x^{1/3} or x^{2/3}) the same formula holds for x < 0 too, by symmetry. Module 9 extends it to irrational exponents.
\dfrac{d}{dx}x^{2/3} = \tfrac23 x^{-1/3}, which tends to \pm\infty as x \to 0^\pm: the cusp from Module 6.
8.3The inverse trigonometric functions
Theorem 8.5Derivatives of arcsin, arccos, arctan
\frac{d}{dx}\arcsin x = \frac{1}{\sqrt{1 - x^2}}, \qquad \frac{d}{dx}\arccos x = -\frac{1}{\sqrt{1-x^2}} \qquad (-1 < x < 1), \qquad \frac{d}{dx}\arctan x = \frac{1}{1 + x^2}.
Proof.arcsin. On [-\frac\pi2, \frac\pi2], \sin is continuous and strictly increasing, and its derivative \cos\theta is positive on (-\frac\pi2, \frac\pi2). For -1 < x < 1 let \theta = \arcsin x \in (-\frac\pi2, \frac\pi2). By the inverse function rule and Exercise 2.5,
arccos. On [0,\pi], \cos is strictly decreasing with derivative -\sin\theta < 0 on (0,\pi), and \sin(\arccos x) = \sqrt{1-x^2} because \sin \ge 0 there. So the derivative is \frac{1}{-\sin\theta} = -\frac{1}{\sqrt{1-x^2}}.
arctan. On (-\frac\pi2,\frac\pi2), \tan is strictly increasing with derivative \sec^2\theta = 1 + \tan^2\theta > 0. With \theta = \arctan x the derivative is \frac{1}{1 + \tan^2\theta} = \frac{1}{1 + x^2}. ∎
Two things are worth noticing. The derivatives of \arcsin and \arccos differ only in sign, so \arcsin x + \arccos x has derivative 0; Module 10 shows it is the constant \frac\pi2. And these transcendental functions have algebraic derivatives, which is why they turn up so often as answers to integrals.
Corollary 8.6Scaled versions (AHL 5.15)
For a constant a > 0:
\frac{d}{dx}\arcsin\frac xa = \frac{1}{\sqrt{a^2 - x^2}} \quad (|x| < a), \qquad \frac{d}{dx}\arctan\frac xa = \frac{a}{a^2 + x^2}.
Read backwards, these give \int\frac{dx}{\sqrt{a^2-x^2}} = \arcsin\frac xa + C and \int\frac{dx}{a^2+x^2} = \frac1a\arctan\frac xa + C in Module 15.
8.4Implicit differentiation
Many curves are given by an equation in x and y rather than a formula y = f(x): circles, ellipses, and curves like x^3 + y^3 = 6xy. Near most points such a curve is still the graph of a differentiable function y(x), even if we cannot write it down. The method (AHL 5.14) is:
differentiate both sides of the equation with respect to x, treating y as a function of x and using the chain rule wherever y appears;
solve the resulting equation for y'.
The chain rule gives, for example, \frac{d}{dx}y^3 = 3y^2y', \ \frac{d}{dx}\sin y = \cos y\cdot y', and by the product rule \frac{d}{dx}(xy) = y + xy'.
Example 8.7A circle
For x^2 + y^2 = 25: \ 2x + 2yy' = 0, so y' = -\frac xy. At (3, 4) the slope is -\frac34 and the tangent is y - 4 = -\frac34(x - 3). The radius to (3,4) has slope \frac43, so the tangent is perpendicular to the radius, as geometry says it should be. One formula covers both the upper and the lower semicircle.
At (3,3), which is on the curve since 27 + 27 = 54, the slope is \frac{6 - 9}{9 - 6} = -1.
Example 8.9An equation you cannot solve
For y^5 + y = x: \ 5y^4y' + y' = 1, so y' = \dfrac{1}{5y^4 + 1}. Here y is the inverse of the strictly increasing function y \mapsto y^5 + y, so the inverse function rule guarantees that y really is a differentiable function of x, and the implicit computation agrees with it.
Example 8.10A second derivative, implicitly
From y' = -\frac xy on the circle x^2 + y^2 = 25, the quotient rule gives
The last step uses the equation of the curve again. On the upper semicircle y > 0 and y'' < 0: concave down, as expected.
Taken on trustWhy is y a function of x at all?
Not every equation defines y as a differentiable function of x: the equation x^2 + y^2 = 0 describes a single point. The implicit function theorem, which you will meet in multivariable analysis in your second semester, guarantees that near a point of the curve F(x,y) = 0 where the coefficient of y' in the differentiated equation is non-zero, the curve is the graph of a differentiable function y(x). For the folium that coefficient is 3y^2 - 6x, which vanishes at the origin, and indeed the curve crosses itself there.
NoteThe rational power rule, implicitly
If y = x^{p/q} then y^q = x^p. Differentiating, qy^{q-1}y' = px^{p-1}, so y' = \frac pq\cdot\frac{x^{p-1}}{y^{q-1}} = \frac pq\cdot\frac{x^{p-1}}{x^{p - p/q}} = \frac pq\,x^{\frac pq - 1}, in agreement with Theorem 8.3. The implicit method assumes that y is differentiable; the inverse function rule proves it.
Key results
(f^{-1})'(b) = \frac{1}{f'(f^{-1}(b))} when f'(f^{-1}(b)) \ne 0: slopes of inverses are reciprocals.
For the curve x^2 + xy + y^2 = 7: find the tangent at (1, 2), and find the points where the tangent is horizontal.
Solution
At (1,2): y' = -\frac{2 + 2}{1 + 4} = -\frac45, so the tangent is y - 2 = -\frac45(x - 1).
Horizontal tangent: y' = 0 needs 2x + y = 0, i.e. y = -2x. Substituting: x^2 - 2x^2 + 4x^2 = 3x^2 = 7, so x = \pm\sqrt{7/3}, giving the points \left(\sqrt{7/3}, -2\sqrt{7/3}\right) and \left(-\sqrt{7/3}, 2\sqrt{7/3}\right). (At these points x + 2y \ne 0, so the formula for y' is valid.)
8.4Fluency
(a) For f(x) = x^3 + x + 1, find (f^{-1})'(3) and (f^{-1})'(1). (b) For g(x) = 2x + \cos x, explain why g has an inverse and find (g^{-1})'(1).
Solution
(a) f(1) = 3 and f'(1) = 4, so (f^{-1})'(3) = \frac14. \ f(0) = 1 and f'(0) = 1, so (f^{-1})'(1) = 1.
(b) g'(x) = 2 - \sin x \ge 1 > 0, so g is strictly increasing (Module 10 proves that a positive derivative implies this) and has an inverse. g(0) = 1 and g'(0) = 2, so (g^{-1})'(1) = \frac12.
8.5Understanding
Show that the derivative of \arcsin x + \arccos x is 0 on (-1, 1). What do you expect the function to be?
Solution
\frac{1}{\sqrt{1-x^2}} - \frac1{\sqrt{1-x^2}} = 0. We expect a constant, and its value at 0 is 0 + \frac\pi2. So \arcsin x + \arccos x = \frac\pi2; Module 10 proves that zero derivative on an interval forces a constant. (Geometrically: in a right-angled triangle with hypotenuse 1 and a side x, the two acute angles are \arcsin x and \arccos x.)
8.6Understanding
For the curve x^3 + y^3 = 1, find y' and y'' in terms of x and y, simplifying with the equation of the curve.
Show that h(x) = \arctan x + \arctan\frac1x has h'(x) = 0 for every x \ne 0. Evaluate h(1) and h(-1). What does this tell you about functions with zero derivative?
h(1) = \frac\pi4 + \frac\pi4 = \frac\pi2 and h(-1) = -\frac\pi2. So h is not constant, although its derivative is zero wherever it is defined. The domain \R\setminus\{0\} is not an interval, and “zero derivative implies constant” only holds on intervals (Module 10). On each half-line, h is constant.
8.8Understanding
Let f(x) = \tan x on (-\frac\pi2, \frac\pi2). Using only the inverse function rule, find the derivative of \arctan at 1 and at \sqrt3, and check your answers against the formula \frac{1}{1+x^2}.
Solution
\tan\frac\pi4 = 1 and \tan'\frac\pi4 = \sec^2\frac\pi4 = 2, so (\arctan)'(1) = \frac12 = \frac{1}{1+1}. \ \tan\frac\pi3 = \sqrt3 and \sec^2\frac\pi3 = 4, so (\arctan)'(\sqrt3) = \frac14 = \frac{1}{1+3}.
8.9Challenge
Let f(x) = x^5 + x and let g = f^{-1}. Explain why g : \R \to \R exists and is differentiable, and find g'(2) and g''(2).
Solution
f'(x) = 5x^4 + 1 > 0, so f is strictly increasing; it is continuous and unbounded in both directions, so by the IVT its range is \R. The inverse function rule applies everywhere since f' \ne 0.
f(1) = 2, so g'(2) = \frac{1}{f'(1)} = \frac16. Differentiating g'(y) = \frac{1}{f'(g(y))} with the chain rule:
g''(y) = -\frac{f''(g(y))\,g'(y)}{f'(g(y))^2} = -\frac{f''(x)}{f'(x)^3}\quad\text{where } x = g(y).
With x = 1: f''(1) = 20 and f'(1) = 6, so g''(2) = -\frac{20}{216} = -\frac{5}{54}.
8.10Challenge
Find the points where the folium of Descartes x^3 + y^3 = 6xy has a horizontal tangent.
Solution
From Example 8.8, y' = 0 needs 2y - x^2 = 0 with y^2 - 2x \ne 0. Substitute y = \frac{x^2}2: x^3 + \frac{x^6}8 = 3x^3, so x^3\left(\frac{x^3}{8} - 2\right) = 0. The root x = 0 gives the origin, where y^2 - 2x = 0 too and the formula fails (the curve crosses itself). The other root is x^3 = 16, i.e. x = 2^{4/3}, with y = \frac{x^2}{2} = 2^{5/3}. There y^2 - 2x = 2^{10/3} - 2^{7/3} \ne 0. So the only horizontal tangent is at \left(2^{4/3}, 2^{5/3}\right) \approx (2.52, 3.17).
8.11Challenge
Show that for the astroid x^{2/3} + y^{2/3} = 1, the part of any tangent line (at a point with x, y > 0) that lies between the coordinate axes has length 1.
Solution
Differentiating, \frac23x^{-1/3} + \frac23y^{-1/3}y' = 0, so y' = -\left(\frac yx\right)^{1/3}. At (x_0, y_0) the tangent meets the x-axis where
and similarly the y-axis at y = y_0^{1/3}. The segment between these intercepts has length \sqrt{x_0^{2/3} + y_0^{2/3}} = 1. (A ladder of length 1 sliding down a wall sweeps out exactly this curve; see Module 13.)
Part II · The derivative · Module 9
Exponentials and logarithms
Eksponential- og logaritmefunksjoner
Big questionWhich function is its own derivative, and why does the number e turn up everywhere?
In IB you were told that e^x is its own derivative and that \ln x has derivative \frac1x. Here we earn those facts. We define a^x for every real x, show that the derivative of any exponential function is proportional to the function itself, find the one base for which the constant of proportionality is 1, and check that it is the same e that appeared in Module 3.
9.1Powers with real exponents
Fix a base a > 0. Integer powers need no comment. Module 5 gave us nth roots, so a^{1/n} is defined, and then a^{p/q} = \left(a^{1/q}\right)^p. The laws of exponents
hold for all rational r and s; they follow from the integer case by straightforward algebra. What does 2^{\sqrt2} or 3^\pi mean? For a > 1 the function q \mapsto a^q is increasing on the rationals, so it is natural to define, for real x,
a^x = \sup\{a^q : q \in \Q,\ q \le x\}.
The set is bounded above (by a^m for any integer m \ge x), so completeness provides the supremum. For 0 < a < 1 put a^x = 1/(1/a)^x, and 1^x = 1.
Taken on trustThe laws of real exponents
This definition agrees with the old one when x is rational. The laws of exponents remain true for all real exponents, and for a > 1 the function a^x is continuous and strictly increasing, with a^x \to \infty as x \to \infty and a^x \to 0 as x\to-\infty. The proofs are routine but long (Spivak’s Calculus has them), and Module 15 gives a cleaner route in which they come for free. We take them on trust here.
The second factor does not involve x at all. So everything depends on one number per base:
L(a) = \lim_{h\to0}\frac{a^h - 1}{h},
the slope of y = a^x at x = 0. If this limit exists, then for every x
\frac{d}{dx}a^x = L(a)\,a^x .
The derivative of an exponential function is a constant multiple of the function itself. Numerically:
a
h = 0.1
h = 0.001
h = -0.001
2
0.717735
0.693387
0.692907
2.7
1.044254
0.993745
0.992759
2.8
1.084492
1.030150
1.029090
3
1.161232
1.099216
1.098009
The table suggests L(2) \approx 0.693 and L(3) \approx 1.099, and that the base with L(a) = 1 lies between 2.7 and 2.8. But does the limit exist at all?
Theorem 9.1The exponential slope exists
For every a > 0 the limit L(a) = \lim_{h\to0}\frac{a^h - 1}{h} exists. For a > 1 it is positive.
Proof. (Sketch.) Take a > 1; the case a < 1 follows from L(1/a) = -L(a) (Exercise 9.5), and L(1) = 0.
Step 1: a^x is convex. For rationals p and q, the AM–GM inequality gives a^{(p+q)/2} = \sqrt{a^p a^q} \le \frac{a^p + a^q}{2}: the midpoint of any chord lies above the graph. With continuity this upgrades to full convexity: every chord lies above the graph.
Step 2: chord slopes increase. For a convex function, the slope of the chord from the fixed point (0, 1) to (h, a^h), namely s(h) = \frac{a^h - 1}{h}, is an increasing function of h on \R\setminus\{0\}. (Draw three points on a convex curve: the chord to the farther point is steeper.)
Step 3: completeness. As h \to 0^+, s(h) decreases and is bounded below by s(-1) = 1 - \frac1a > 0, so it converges to its infimum. As h \to 0^-, s(h) increases and is bounded above by s(1) = a - 1, so it converges to its supremum. (This is the Monotone Convergence Theorem for functions.)
Step 4: the sides agree.s(-h) = \frac{a^{-h} - 1}{-h} = a^{-h}\cdot\frac{a^h - 1}{h} = a^{-h}s(h), and a^{-h} \to 1. So the left and right limits are equal, and their common value is at least 1 - \frac1a > 0. ∎
Proposition 9.2L behaves like a logarithm
For a, b > 0 and real k: \quad L(ab) = L(a) + L(b) \quad and \quad L(a^k) = k\,L(a).
Proof.\frac{(ab)^h - 1}{h} = a^h\cdot\frac{b^h - 1}{h} + \frac{a^h - 1}{h} \to 1\cdot L(b) + L(a), using a^h \to 1. For k \ne 0, \ \frac{(a^k)^h - 1}{h} = k\cdot\frac{a^{kh} - 1}{kh} \to k\,L(a), because kh \to 0 as h \to 0. For k = 0 both sides are 0. ∎
9.3The number e
Since L(2^t) = t\,L(2) with L(2) > 0, as t runs through \R the slope L(2^t) runs through every real number, each exactly once. Exactly one value, t = \frac{1}{L(2)}, gives slope 1. Call that base e:
Theorem 9.3The exponential function is its own derivative
\frac{d}{dx}e^x = e^x .
So e is the unique base whose exponential has slope exactly 1 where it crosses the y-axis. The table puts it between 2.7 and 2.8. In Section 9.7 we show it is the same number \lim(1 + \frac1n)^n as in Module 3. With the chain rule:
In Module 10 we will prove the converse: e^x is the only function with f' = f and f(0) = 1. That makes e^x the basic solution of the simplest differential equation, which is why it appears in every model of growth, decay, oscillation and diffusion you will meet in physics.
9.4The natural logarithm
e^x is continuous and strictly increasing from \R onto (0,\infty), so it has an inverse function, the natural logarithm\ln : (0,\infty) \to \R:
\ln x = y \iff e^y = x.
den naturlige logaritmen The laws \ln(xy) = \ln x + \ln y, \ \ln(x^r) = r\ln x, \ \ln 1 = 0 and \ln e = 1 follow from the laws of exponents.
Proof. The function e^y has derivative e^y \ne 0, so by the inverse function rule (Theorem 8.1), \ (\ln)'(x) = \frac{1}{e^{\ln x}} = \frac1x. For x < 0, \ln|x| = \ln(-x), and the chain rule gives \frac{1}{-x}\cdot(-1) = \frac1x. ∎
By the chain rule, \frac{d}{dx}\ln|g(x)| = \frac{g'(x)}{g(x)}. A transcendental function with the simplest possible algebraic derivative: this fills the one gap in the power rule. Every power x^n with n \ne -1 is the derivative of \frac{x^{n+1}}{n+1}, and \ln|x| is exactly the missing function whose derivative is x^{-1}.
9.5Other bases and real powers
Since e^{x\ln a} = \left(e^{\ln a}\right)^x = a^x, every exponential is an exponential of base e in disguise:
So the mysterious constant is L(a) = \ln a: \ L(2) = \ln 2 = 0.693147\ldots and L(3) = \ln 3 = 1.098612\ldots, matching the table. For logarithms to base a, \ \log_a x = \frac{\ln x}{\ln a}, so
\frac{d}{dx}\log_a x = \frac{1}{x\ln a}.
These are the AHL 5.15 derivatives of a^x and \log_a x. Finally, for x > 0 and any real r, x^r = e^{r\ln x}, so
The power rule now holds for every real exponent, x^{\pi} and x^{\sqrt2} included.
9.6Logarithmic differentiation
To differentiate a complicated product, quotient or power, take logarithms first, then differentiate implicitly.
Example 9.5A variable base and a variable exponent
Let y = x^x for x > 0. This is neither a power x^n (the exponent varies) nor an exponential a^x (the base varies), so neither rule applies. Take logs: \ln y = x\ln x. Differentiate: \frac{y'}{y} = \ln x + 1. So y' = x^x(\ln x + 1).
Example 9.6Products and quotients
y = \dfrac{(x^2+1)^3\sqrt{x-1}}{(2x+5)^4} for x > 1. Then \ln y = 3\ln(x^2+1) + \tfrac12\ln(x-1) - 4\ln(2x+5), so
This is a difference quotient of \ln at 1 with step h = \frac1n \to 0, so by Theorem 4.6 it tends to (\ln)'(1) = 1. Since e^x is continuous, \left(1 + \frac1n\right)^n = e^{n\ln(1 + 1/n)} \to e^1 = e. ∎
More generally \left(1 + \frac xn\right)^n \to e^x for every real x (Exercise 9.10). With interest rate x compounded n times a year, this is the balance after one year, and e^x is the result of compounding continuously.
NoteA second, complete route
We assumed the laws of real exponents and only sketched why L(a) exists. Module 15 gives a fully rigorous alternative that needs neither: define\ln x = \int_1^x \frac{dt}{t}, prove its properties from the Fundamental Theorem of Calculus, and define e^x as its inverse. Everything in this module then follows.
9.8Beyond IB: hyperbolic functions
Beyond IBcosh, sinh and tanh
The hyperbolic functions are on the NTNU syllabus:
\cosh x = \frac{e^x + e^{-x}}{2}, \qquad \sinh x = \frac{e^x - e^{-x}}{2}, \qquad \tanh x = \frac{\sinh x}{\cosh x}.
They behave like the trigonometric functions with some signs changed: (\cosh x)' = \sinh x, (\sinh x)' = \cosh x, and \cosh^2x - \sinh^2x = 1, so the point (\cosh t, \sinh t) lies on the hyperbola x^2 - y^2 = 1. A hanging chain takes the shape of y = a\cosh(x/a), the catenary. The connection with \cos and \sin is exact once complex numbers are allowed: \cos x = \cosh(ix) (Module 19).
Key results
\frac{d}{dx}a^x = L(a)\,a^x with L(a) = \lim_{h\to0}\frac{a^h-1}{h}, and L(a) = \ln a.
e is the base with L(e) = 1, so (e^x)' = e^x; it equals \lim(1 + \frac1n)^n.
(\ln|x|)' = \frac1x, \ (\log_a x)' = \frac{1}{x\ln a}, \ (x^r)' = rx^{r-1} for real r.
Logarithmic differentiation handles x^x and messy products and quotients.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
(c) \ln y = x\ln(\ln x), so \frac{y'}y = \ln(\ln x) + x\cdot\frac{1}{\ln x}\cdot\frac1x and y' = (\ln x)^x\left(\ln(\ln x) + \frac{1}{\ln x}\right).
9.3Fluency
Find the equation of the tangent to y = \ln x that passes through the origin.
Solution
The tangent at (a, \ln a) is y - \ln a = \frac1a(x - a). It passes through (0,0) when -\ln a = -1, so a = e. The tangent is y = \frac xe, touching at (e, 1).
9.4Fluency
A population grows as P(t) = 2000e^{0.03t} (t in years). Find the growth rate when t = 10, and when P = 5000.
Solution
P'(t) = 0.03\cdot2000e^{0.03t} = 0.03P. At t = 10: 60e^{0.3} \approx 81 per year. When P = 5000: 0.03 \cdot 5000 = 150 per year. The rate is proportional to the current size, which is what “exponential growth” means.
9.5Understanding
Working directly from L(a) = \lim_{h\to0}\frac{a^h-1}h, prove that L(1/a) = -L(a).
Solution
\frac{(1/a)^h - 1}{h} = \frac{a^{-h} - 1}{h} = -\frac{a^{-h} - 1}{-h}. As h \to 0, also -h \to 0, so this tends to -L(a). (Equivalently, L(a) + L(1/a) = L(1) = 0 by Proposition 9.2.)
9.6Understanding
Show that y = e^{-x^2/2} satisfies y' = -xy, and find the points where y'' = 0.
Solution
y' = -xe^{-x^2/2} = -xy. Then y'' = -y - xy' = -y + x^2y = (x^2 - 1)e^{-x^2/2}, which vanishes at x = \pm1. These are the inflexion points of the bell curve; for the normal distribution they sit one standard deviation from the mean.
9.7Understanding
Prove that (\cosh x)' = \sinh x, (\sinh x)' = \cosh x and \cosh^2x - \sinh^2 x = 1. Then show that \sinh has inverse \operatorname{arsinh}x = \ln\left(x + \sqrt{x^2+1}\right), and find its derivative.
Solution
The derivatives come straight from (e^{\pm x})' = \pm e^{\pm x}. And \cosh^2 x - \sinh^2 x = \frac{(e^x + e^{-x})^2 - (e^x - e^{-x})^2}{4} = \frac{4}{4} = 1.
Solve x = \frac{e^y - e^{-y}}2 for y: multiplying by 2e^y gives e^{2y} - 2xe^y - 1 = 0, a quadratic in e^y, so e^y = x \pm\sqrt{x^2+1}. Since e^y > 0 we need the plus sign, and y = \ln\left(x + \sqrt{x^2+1}\right). Its derivative is
Prove that \displaystyle\lim_{x\to0}\frac{\ln(1+x)}{x} = 1, and deduce that \displaystyle\lim_{x\to0}(1+x)^{1/x} = e.
Solution
\frac{\ln(1 + x) - \ln 1}{x} is a difference quotient of \ln at 1, so its limit is \ln'(1) = 1. Then (1+x)^{1/x} = e^{\ln(1+x)/x} \to e^1 by continuity of the exponential.
9.9Understanding
Find where f(x) = x^x (x > 0) has a horizontal tangent, and the value of f there.
Solution
f'(x) = x^x(\ln x + 1) = 0 exactly when \ln x = -1, i.e. x = \frac1e. There f = e^{-1/e} \approx 0.692. (Module 12 shows this is the global minimum.)
9.10Challenge
Prove that \left(1 + \frac xn\right)^n \to e^x as n \to \infty, for every real x.
Solution
For x = 0 it is trivial. Otherwise, for n > |x|, \ \ln\left(1 + \frac xn\right)^n = x\cdot\frac{\ln\left(1 + \frac xn\right) - \ln1}{x/n}. The fraction is a difference quotient of \ln at 1 with step \frac xn \to 0, so it tends to 1, and the whole expression tends to x. By continuity of the exponential, \left(1 + \frac xn\right)^n \to e^x.
9.11Challenge
Fill in Step 1 of Theorem 9.1: prove that for a > 0 and rationals p, q, \ a^{(p+q)/2} \le \frac{a^p + a^q}{2}, with equality only if p = q or a = 1.
Solution
Let u = a^{p/2} and v = a^{q/2}, both positive. Then \frac{a^p + a^q}{2} - a^{(p+q)/2} = \frac{u^2 + v^2}{2} - uv = \frac{(u - v)^2}{2} \ge 0, with equality only if u = v, which means a^{p/2} = a^{q/2}, i.e. p = q or a = 1.
9.12Challenge
Differentiate y = x^{x^x} for x > 0. (Here x^{x^x} means x^{(x^x)}.)
Solution
\ln y = x^x\ln x. Using (x^x)' = x^x(\ln x + 1) and the product rule,
\frac{y'}{y} = x^x(\ln x + 1)\ln x + \frac{x^x}x, \qquad y' = x^{x^x}\,x^x\left(\ln^2 x + \ln x + \frac1x\right).
Part II · The derivative · Module 10
The Mean Value Theorem
Sekantsetningen
Big questionHow does information about f′ at single points turn into information about f on a whole interval?
The derivative is defined one point at a time, yet we constantly use it to draw conclusions about whole intervals: a positive derivative means increasing, a zero derivative means constant. Those conclusions are not obvious, and they are false on sets with gaps. The bridge from points to intervals is the Mean Value Theorem. After the Fundamental Theorem, which it also proves, it is the most important theorem in this course.
10.1Local extrema and Fermat’s theorem
Definition 10.1Local and global extrema
f has a local maximum at c if f(c) \ge f(x) for all x in some open interval around c, and a global maximum on a set S if f(c) \ge f(x) for all x \in S. Minima are defined the same way. An extremum is a maximum or a minimum. toppunktbunnpunkt
Theorem 10.2Fermat’s theorem on interior extrema
If f has a local extremum at an interior point c of its domain and f'(c) exists, then f'(c) = 0.
Proof. Suppose c is a local maximum. For small h > 0 we have f(c+h) \le f(c), so \frac{f(c+h) - f(c)}{h} \le 0, and letting h \to 0^+ gives f'(c) \le 0 (limits preserve \le). For small h < 0 the numerator is still \le 0 but the denominator is negative, so the quotient is \ge 0 and f'(c) \ge 0. Hence f'(c) = 0. For a minimum, apply this to -f. ∎
Definition 10.3Critical and stationary points
A critical point of f is a point c of its domain where f'(c) = 0 or f'(c) does not exist. A point with f'(c) = 0 is a stationary point (the IB term). kritisk punktstasjonært punkt
Fermat’s theorem says: interior local extrema can only occur at critical points. It does not say that every critical point is an extremum.
PitfallThree ways to misuse Fermat’s theorem
The converse is false: x^3 has f'(0) = 0 but no extremum at 0.
Endpoints are not interior: f(x) = x on [0,1] has its maximum at 1, where f' = 1.
The derivative must exist: |x| has a minimum at 0, where it is not differentiable.
10.2Rolle’s theorem
Theorem 10.4Rolle’s theorem
If f is continuous on [a,b], differentiable on (a,b), and f(a) = f(b), then f'(c) = 0 for some c \in (a,b).
Proof. By the Extreme Value Theorem (Theorem 5.7), f attains a maximum M and a minimum m on [a,b]. If both are attained only at the endpoints, then M = m = f(a), so f is constant and f'(c) = 0 for every c \in (a,b). Otherwise one of them is attained at some c \in (a, b). That point is a local extremum and f'(c) exists, so f'(c) = 0 by Fermat’s theorem. ∎
Notice what was used: completeness (through the EVT) and the definition of the derivative (through Fermat). Every hypothesis matters: |x| on [-1, 1] is not differentiable at 0 and has no horizontal tangent, and the function equal to x on [0,1) with f(1) = 0 is not continuous at 1 and also has none.
10.3The Mean Value Theorem
Theorem 10.5Mean Value Theorem (MVT)
If f is continuous on [a,b] and differentiable on (a, b), then for some c \in (a, b)
Somewhere between a and b the tangent is parallel to the secant. Here there are two such points.
Proof. Let \ell(x) = f(a) + \frac{f(b) - f(a)}{b - a}(x - a) be the secant line through (a, f(a)) and (b, f(b)), and let g = f - \ell. Then g is continuous on [a,b], differentiable on (a,b), and g(a) = g(b) = 0. By Rolle’s theorem g'(c) = 0 for some c \in (a,b). Since g'(c) = f'(c) - \frac{f(b) - f(a)}{b - a}, we are done. ∎
Norwegian lectures usually call this result sekantsetningen, the secant theorem, after exactly this picture. Physically: if a journey has average velocity v, then at some instant the velocity was exactly v. Norway’s average-speed cameras (streknings-ATK) rely on this. They only measure the time between two cameras, but if your average speed over the stretch exceeds the limit, the Mean Value Theorem proves that your speedometer showed more than the limit at some moment.
The second form, f(b) - f(a) = f'(c)(b - a), is how the theorem is used: it turns information about f' into information about differences of f. We never know where c is, and we almost never need to.
10.4Consequences
Theorem 10.6Zero derivative means constant
If f'(x) = 0 for every x in an interval I, then f is constant on I.
Proof. Let x < y be in I. By the MVT on [x, y], f(y) - f(x) = f'(c)(y - x) = 0 for some c between them. ∎
Corollary 10.7Functions with the same derivative
If f' = g' on an interval, then f - g is constant there.
This is the theorem behind the “+C” in every indefinite integral (Module 15): two antiderivatives of the same function on an interval differ by a constant. The word interval matters. On \R\setminus\{0\}, the function \arctan x + \arctan\frac1x has derivative 0 but takes the values \frac\pi2 and -\frac\pi2 (Module 8).
Theorem 10.8The monotonicity test (SL 5.2)
Let f be continuous on an interval I and differentiable at every interior point.
If f' > 0 at every interior point, f is strictly increasing on I. If f' \ge 0, it is increasing.
If f' < 0 at every interior point, f is strictly decreasing on I. If f' \le 0, it is decreasing.
Proof. For x < y in I, the MVT gives f(y) - f(x) = f'(c)(y - x) with c interior. The sign of f(y) - f(x) is the sign of f'(c). ∎
The converse holds only partly. If f is increasing and differentiable then every difference quotient is \ge 0, so f' \ge 0. But strictly increasing does not give f' > 0: x^3 is strictly increasing with f'(0) = 0.
PitfallA positive derivative at one point is not enough
f'(c) > 0 at a single point does not make f increasing on any interval around c. The function x + 2x^2\sin(1/x) (value 0 at 0) has derivative 1 at 0 but wiggles up and down infinitely often near 0. The test needs f' > 0 on a whole interval.
Three applications
Example 10.9The exponential is the only solution of f′ = kf
Claim. If f'(x) = kf(x) for all real x, then f(x) = f(0)e^{kx}.
Proof. Let g(x) = f(x)e^{-kx}. Then g'(x) = f'(x)e^{-kx} - kf(x)e^{-kx} = 0, so g is constant, equal to g(0) = f(0).
This solves the simplest differential equation and, just as importantly, proves that it has no other solutions. Radioactive decay, continuously compounded interest and the early stages of population growth are all this equation. Module 18 continues the story.
Example 10.10Proving inequalities
e^x \ge 1 + x for all x, with equality only at x = 0. Let g(x) = e^x - 1 - x. Then g'(x) = e^x - 1, which is negative for x < 0 and positive for x > 0. So g is strictly decreasing on (-\infty, 0] and strictly increasing on [0,\infty), with minimum value g(0) = 0.
|\sin a - \sin b| \le |a - b|. By the MVT, \sin a - \sin b = \cos c\,(a - b) for some c, and |\cos c| \le 1.
Example 10.11Error control
If |f'(x)| \le M on an interval, then |f(x) - f(y)| \le M|x - y| there. For example, |\sqrt{x} - \sqrt{100}| \le \frac{1}{2\cdot 10}|x - 100| for x \ge 100, since \frac{1}{2\sqrt t} \le \frac1{20} when t \ge 100. So \sqrt{101} is within 0.05 of 10. Numerical analysts use this kind of bound constantly.
10.5Cauchy’s Mean Value Theorem
Theorem 10.12Cauchy’s Mean Value Theorem
If f and g are continuous on [a, b] and differentiable on (a, b), then for some c \in (a, b)
If also g' \ne 0 on (a, b), this can be written \ \dfrac{f(b) - f(a)}{g(b) - g(a)} = \dfrac{f'(c)}{g'(c)}.
Proof. Let h(x) = \big(f(b) - f(a)\big)g(x) - \big(g(b) - g(a)\big)f(x). Expanding shows h(a) = f(b)g(a) - g(b)f(a) = h(b). By Rolle’s theorem h'(c) = 0 for some c, which is the claim. If g' \ne 0 on (a,b), then g(b) \ne g(a) (otherwise Rolle would give a zero of g'), so we may divide. ∎
Taking g(x) = x recovers the ordinary MVT. Geometrically, if a point moves along the curve t \mapsto (g(t), f(t)), then at some time its direction of motion is parallel to the chord joining the start and the end. Cauchy’s version is the key to L’Hôpital’s rule (Module 11) and to Taylor’s theorem (Module 19).
Key results
Fermat: an interior extremum where f' exists has f' = 0.
Rolle: f(a) = f(b) gives a point with f'(c) = 0. Proof: EVT plus Fermat.
MVT: f(b) - f(a) = f'(c)(b - a) for some c \in (a,b).
On an interval: f' = 0 \Rightarrow constant; f' = g' \Rightarrow f - g constant; f' > 0 \Rightarrow strictly increasing.
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
10.1Fluency
Verify the Mean Value Theorem for f(x) = x^3 - x on [0, 2] by finding every value of c it promises.
Solution
\frac{f(2) - f(0)}{2 - 0} = \frac{6}{2} = 3. Solve f'(c) = 3c^2 - 1 = 3: c^2 = \frac43, so c = \frac{2}{\sqrt3} \approx 1.155, which lies in (0,2). (The other root, -\frac2{\sqrt3}, does not.)
10.2Fluency
Find the intervals on which f is increasing and decreasing: (a) x^3 - 3x^2 - 9x + 5 (b) xe^{-x} (c) x - 2\sin x on [0, 2\pi].
Solution
(a) f' = 3x^2 - 6x - 9 = 3(x-3)(x+1): increasing on (-\infty, -1] and [3, \infty), decreasing on [-1, 3].
(b) f' = (1 - x)e^{-x}: increasing on (-\infty, 1], decreasing on [1,\infty).
(c) f' = 1 - 2\cos x > 0 \iff \cos x < \frac12 \iff x \in (\frac\pi3, \frac{5\pi}3). Increasing on [\frac\pi3, \frac{5\pi}{3}], decreasing on [0, \frac\pi3] and [\frac{5\pi}3, 2\pi].
Closed endpoints are allowed: the test only needs the sign of f' at interior points.
10.3Fluency
Two average-speed cameras are 12 km apart on a road with an 80 km/h limit. A car passes them 6 minutes apart. Prove that at some moment the car was travelling at more than 110 km/h.
Solution
The average speed is \frac{12\text{ km}}{0.1\text{ h}} = 120 km/h. If the position s(t) is differentiable (cars do not teleport), the MVT gives an instant where s'(t) = 120 > 110 km/h.
10.4Fluency
Show that x^5 + 3x + 1 = 0 has exactly one real root.
Solution
Existence: f(-1) = -3 < 0 < 1 = f(0), so the IVT gives a root in (-1, 0). Uniqueness: f'(x) = 5x^4 + 3 > 0, so f is strictly increasing and cannot take the value 0 twice. (Alternatively, two roots would give a zero of f' between them by Rolle.)
10.5Understanding
Prove that |\arctan a - \arctan b| \le |a - b| for all real a, b. Is the constant 1 the best possible?
Solution
By the MVT, \arctan a - \arctan b = \frac{1}{1 + c^2}(a - b) for some c, and 0 < \frac1{1+c^2} \le 1. The constant cannot be improved: \frac{\arctan h - \arctan 0}{h} \to 1 as h \to 0.
10.6Understanding
Using e^x > 1 + x for x \ne 0, prove that \left(1 + \frac1n\right)^n < e < \left(1 + \frac1n\right)^{n+1} for every n \in \N. What does n = 10 give?
Solution
With x = \frac1n: e^{1/n} > 1 + \frac1n, so e > (1 + \frac1n)^n. With x = -\frac{1}{n+1}: e^{-1/(n+1)} > 1 - \frac{1}{n+1} = \frac{n}{n+1}, so e^{1/(n+1)} < \frac{n+1}{n} = 1 + \frac1n and e < (1 + \frac1n)^{n+1}.
For n = 10: 2.5937 < e < 2.8531.
10.7Understanding
Prove that \arcsin x + \arccos x = \frac\pi2 for all x \in [-1,1].
Solution
The derivative of the left side is 0 on (-1, 1) (Module 8), so the function is constant on (-1,1), with value \arcsin 0 + \arccos 0 = \frac\pi2. At x = \pm1 check directly: \frac\pi2 + 0 and -\frac\pi2 + \pi. (Or use continuity at the endpoints.)
10.8Understanding
Which is larger, e^\pi or \pi^e? (Hint: study f(x) = \frac{\ln x}{x}.)
Solution
f'(x) = \frac{1 - \ln x}{x^2} is positive for x < e and negative for x > e, so f is strictly decreasing on [e, \infty). Since \pi > e, \frac{\ln\pi}{\pi} < \frac{\ln e}{e} = \frac1e, so e\ln\pi < \pi, i.e. \pi^e < e^\pi. (Numerically 22.46 < 23.14.)
10.9Understanding
Use Rolle’s theorem to prove that a polynomial of degree n \ge 1 has at most n real roots.
Solution
Induction on n. A polynomial of degree 1 has exactly one root. Suppose the claim holds for degree n - 1, and let p have degree n. If p had n + 1 distinct roots x_0 < x_1 < \cdots < x_n, Rolle’s theorem on each [x_{i-1}, x_i] would give n distinct roots of p', which has degree n - 1, contradicting the induction hypothesis.
10.10Challenge
Suppose f is differentiable on \R with f(0) = 0 and |f'(x)| \le |f(x)| for every x. Prove that f(x) = 0 for all x. (Hint: consider g(x) = e^{-2x}f(x)^2 for x \ge 0.)
Solution
For x \ge 0: g'(x) = 2e^{-2x}\big(f(x)f'(x) - f(x)^2\big) \le 2e^{-2x}\big(|f(x)||f'(x)| - f(x)^2\big) \le 0. So g is decreasing on [0,\infty) with g(0) = 0 and g \ge 0, which forces g = 0 there. For x \le 0 use k(x) = e^{2x}f(x)^2: k'(x) = 2e^{2x}\big(f f' + f^2\big) \ge 2e^{2x}\big(f^2 - |f||f'|\big) \ge 0, so k is increasing on (-\infty,0] with k(0) = 0 and k \ge 0, forcing k = 0. Hence f = 0 everywhere. (This is a simple case of Grönwall’s inequality, which underlies the uniqueness of solutions of differential equations.)
10.11Challenge
(The racetrack principle.) Prove that if f(a) = g(a) and f'(x) \le g'(x) for all x > a, then f(x) \le g(x) for all x \ge a. Use it three times to show that for x \ge 0:
\sin x \le x, \qquad \cos x \ge 1 - \frac{x^2}{2}, \qquad \sin x \ge x - \frac{x^3}{6}.Solution
h = g - f has h(a) = 0 and h' \ge 0 on (a, \infty), so h is increasing and h(x) \ge 0 for x \ge a.
(1) \sin 0 = 0 and (\sin x)' = \cos x \le 1 = (x)'. (2) \cos 0 = 1 = 1 - 0, and (\cos x)' = -\sin x \ge -x = \left(1 - \frac{x^2}2\right)' by (1). (3) Both sides are 0 at 0, and (\sin x)' = \cos x \ge 1 - \frac{x^2}2 = \left(x - \frac{x^3}{6}\right)' by (2).
These polynomials are the first Maclaurin polynomials of \sin and \cos (Module 19). Continuing the pattern traps \sin x between ever better polynomials.
10.12Challenge
(Darboux’s theorem.) Suppose f is differentiable on [a, b] (one-sided at the endpoints) with f'(a) < 0 < f'(b). Prove that f'(c) = 0 for some c \in (a, b), even though f' need not be continuous. Deduce that a derivative has the intermediate value property.
Solution
f is continuous on [a,b], so by the EVT it attains a minimum at some c. Since f'(a) < 0, the quotient \frac{f(a+h) - f(a)}{h} is negative for small h > 0 (Exercise 4.8), so f(a + h) < f(a) and a is not the minimum. Similarly f'(b) > 0 gives points just left of b with smaller values, so b is not the minimum either. So c \in (a,b), and Fermat gives f'(c) = 0.
For any k strictly between f'(a) and f'(b), apply this to f(x) - kx. So a derivative can jump around (as for x^2\sin\frac1x) but can never skip a value; in particular, a function like \operatorname{sgn} x is not the derivative of anything.
Part II · The derivative · Module 11
L’Hôpital’s rule
L’Hôpitals regel
Big questionHow do we compare two quantities that both vanish, or both blow up?
Limits of the form \frac00 and \frac\infty\infty are everywhere in calculus: every derivative is one. L’Hôpital’s rule compares two vanishing quantities by comparing how fast they vanish. This module proves the rule from Cauchy’s Mean Value Theorem, shows where it misleads, and uses it to rank the growth of logarithms, powers and exponentials.
11.1Indeterminate forms
If f(x) \to 0 and g(x) \to 0, the limit of \frac{f}{g} can be anything. As x \to 0^+:
That is what “indeterminate” means: knowing that numerator and denominator both tend to 0 tells you nothing about the quotient. The same goes for the forms
For instance 1^\infty: \left(1 + \frac1n\right)^n \to e, but \left(1 + \frac1n\right)^{n^2} = \left[\left(1 + \frac1n\right)^n\right]^n \to \infty and \left(1 + \frac{1}{n^2}\right)^n \to 1. Everything depends on the relative rates.
11.2The idea: compare the rates
Theorem 11.1L’Hôpital’s rule, simple version
Suppose f(a) = g(a) = 0, both f'(a) and g'(a) exist, and g'(a) \ne 0. Then
(The denominator is non-zero for x near a, because it tends to g'(a) \ne 0.) ∎
The picture: near a, f(x) \approx f'(a)(x - a) and g(x) \approx g'(a)(x - a), so their ratio is roughly the ratio of the slopes. For example \lim_{x\to0}\frac{e^x - 1}{\sin x} = \frac{e^0}{\cos 0} = 1.
11.3L’Hôpital’s rule
The simple version fails when f'(a) and g'(a) are both 0, which is exactly when the limit is hardest. The full rule compares the derivatives neara instead.
Theorem 11.2L’Hôpital’s rule (0/0 form)
Suppose f and g are differentiable on an open interval around a, except possibly at a, with g'(x) \ne 0 there. If f(x) \to 0 and g(x) \to 0 as x \to a, and
\lim_{x\to a}\frac{f'(x)}{g'(x)} = L \quad (L \text{ a real number, or } \pm\infty), \qquad\text{then}\qquad \lim_{x\to a}\frac{f(x)}{g(x)} = L .
The same holds for one-sided limits and for x \to \pm\infty. L’Hôpitals regel
Proof. Consider x \to a^+; the left-hand case is the same. Redefine f(a) = g(a) = 0 (this changes neither the hypotheses nor the limit). Then f and g are continuous on [a, x] and differentiable on (a, x) for every x slightly bigger than a. Also g(x) \ne 0, since otherwise Rolle’s theorem would give a zero of g' in (a, x). By Cauchy’s Mean Value Theorem (Theorem 10.12) there is c_x \in (a, x) with
Let \eps > 0 and choose \delta so that \left|\frac{f'(c)}{g'(c)} - L\right| < \eps whenever a < c < a + \delta. If a < x < a + \delta then a < c_x < x < a + \delta, so \left|\frac{f(x)}{g(x)} - L\right| < \eps. (For L = \pm\infty the same argument works with “> M” in place of “within \eps”.)
For x \to \infty, substitute x = \frac1t and let t \to 0^+. The chain rule gives \frac{d}{dt}f(1/t) = -\frac{f'(1/t)}{t^2}, and the factors -\frac1{t^2} cancel in the quotient, so the case already proved applies. ∎
Taken on trustThe ∞/∞ form
The rule also holds when f(x) \to \pm\infty and g(x) \to \pm\infty, with the other hypotheses unchanged. The proof is a more delicate use of Cauchy’s theorem, and we take it on trust (it is in Adams and Essex and in Spivak).
\displaystyle\lim_{x\to0}\frac{x + 1}{x + 2} = \frac12 by substitution. Differentiating top and bottom would give \frac11 = 1, which is wrong: the form is not \frac00, and the rule does not apply.
PitfallCircular reasoning
“\lim_{x\to0}\frac{\sin x}{x} = \lim_{x\to0}\frac{\cos x}{1} = 1” is circular in our development. The formula (\sin x)' = \cos x was proved in Module 6 using\frac{\sin x}{x} \to 1. L’Hôpital’s rule can only reuse knowledge you already have.
PitfallThe rule can be silent
\displaystyle\lim_{x\to\infty}\frac{x + \sin x}{x} = \lim_{x\to\infty}\left(1 + \frac{\sin x}x\right) = 1. But \frac{f'}{g'} = 1 + \cos x has no limit. The rule says: if\frac{f'}{g'} has a limit then so does \frac fg. When \frac{f'}{g'} has no limit, it says nothing.
Algebra is quicker: \frac{\sqrt{x^2+1}}{x} = \sqrt{1 + \frac1{x^2}} \to 1.
11.5The other indeterminate forms
Every other form can be turned into \frac00 or \frac\infty\infty.
0\cdot\infty: write fg as \frac{f}{1/g} or \frac{g}{1/f}. For example
\lim_{x\to0^+}x\ln x = \lim_{x\to0^+}\frac{\ln x}{1/x} \overset{\infty/\infty}{=} \lim_{x\to0^+}\frac{1/x}{-1/x^2} = \lim_{x\to0^+}(-x) = 0.
\infty - \infty: combine into one fraction. For example
\lim_{x\to0}\left(\frac{1}{\sin x} - \frac1x\right) = \lim_{x\to0}\frac{x - \sin x}{x\sin x} \overset{0/0}{=} \lim_{x\to0}\frac{1 - \cos x}{\sin x + x\cos x} \overset{0/0}{=} \lim_{x\to0}\frac{\sin x}{2\cos x - x\sin x} = 0.
1^\infty, 0^0, \infty^0: take logarithms. If y = f(x)^{g(x)} then \ln y = g(x)\ln f(x), which is a 0\cdot\infty form. Find its limit \ell; then y \to e^\ell because the exponential is continuous.
Example 11.5Exponential forms
\lim_{x\to0^+}x^x: \ \ln y = x\ln x \to 0, so x^x \to e^0 = 1. (This is one reason the convention 0^0 = 1 is natural.)
\lim_{x\to\infty}\left(1 + \frac ax\right)^x: \ \ln y = \frac{\ln(1 + a/x)}{1/x} \overset{0/0}{=} \frac{\frac{-a/x^2}{1 + a/x}}{-1/x^2} = \frac{a}{1 + a/x} \to a, so the limit is e^a.
\lim_{x\to\infty}x^{1/x}: \ \ln y = \frac{\ln x}{x} \to 0, so the limit is 1 (compare Module 3).
Proof. (1) For a positive integer n, n applications of the rule give \lim\frac{x^n}{e^x} = \lim\frac{n!}{e^x} = 0. For general p > 0 pick an integer n \ge p; then 0 < \frac{x^p}{e^x} \le \frac{x^n}{e^x} for x \ge 1, and squeeze.
(2) \frac{1/x}{px^{p-1}} = \frac{1}{px^p} \to 0.
(3) Put x = \frac1t: \ x^p\ln x = -\frac{\ln t}{t^p} \to 0 as t \to \infty, by (2). ∎
So, as x \to \infty, for any p > 0 and any a > 1:
\ln x \ \ll\ x^p \ \ll\ a^x \ \ll\ x^x .
“Eventually” can take a long time. x^{100} is far bigger than 1.01^x for a very long while; the exponential only overtakes it near x \approx 117\,000. But it does overtake, and then the gap grows without bound. This hierarchy decides which terms matter in physics approximations and in the analysis of algorithms.
11.7A preview: limits by series
AHL 5.13 allows limits like these to be found with Maclaurin series instead. In Module 19 you will see that \sin x = x - \frac{x^3}{6} + \frac{x^5}{120} - \cdots, so
Find \displaystyle\lim_{x\to0}\frac{\sin x - x\cos x}{x^3}.
Solution
The derivative of the numerator is \cos x - \cos x + x\sin x = x\sin x, so the limit is \lim\frac{x\sin x}{3x^2} = \lim\frac{\sin x}{3x} = \frac13.
11.4Understanding
A student writes \displaystyle\lim_{x\to0}\frac{x^2 + 1}{x + 1} = \lim_{x\to0}\frac{2x}{1} = 0. Find the error and the correct value.
Solution
The form is \frac11, not indeterminate, so the rule does not apply. By substitution the limit is 1.
11.5Understanding
Explain precisely why “\lim_{x\to0}\frac{\sin x}{x} = \lim_{x\to0}\cos x = 1 by L’Hôpital” is not a valid proof in this course, even though every step is a true statement.
Solution
The step needs \frac{d}{dx}\sin x = \cos x at x = 0, i.e. \lim_{h\to0}\frac{\sin h - \sin 0}{h} = 1. That is exactly the limit we are trying to compute. The argument assumes its conclusion. (It is valid if \sin is defined some other way, for example by a power series, and its derivative computed independently.)
11.6Understanding
Show that \displaystyle\lim_{x\to\infty}\frac{x + \sin x}{x - \sin x} = 1, and explain why L’Hôpital’s rule cannot be used to find it.
Solution
Divide by x: \frac{1 + \frac{\sin x}x}{1 - \frac{\sin x}x} \to \frac{1+0}{1-0} = 1. The quotient of derivatives, \frac{1 + \cos x}{1 - \cos x}, is undefined whenever \cos x = 1 and has no limit, so the hypotheses of the rule fail (g' = 1 - \cos x vanishes at points arbitrarily far out).
11.7Understanding
Prove that \displaystyle\lim_{x\to\infty}\frac{(\ln x)^k}{x} = 0 for every k > 0.
Solution
Substitute x = e^t: \frac{(\ln x)^k}{x} = \frac{t^k}{e^t} \to 0 as t \to \infty by Theorem 11.6. (Any power of the logarithm loses to x.)
11.8Understanding
Find the constants a and b for which \displaystyle\lim_{x\to0}\frac{\sin 3x + ax + bx^3}{x^3} = 0.
Solution
For the limit to be finite the numerator must vanish to third order. First application: \frac{3\cos 3x + a + 3bx^2}{3x^2}; the numerator must tend to 0, so a = -3. Then two more applications: \frac{-9\sin3x + 6bx}{6x} \to \frac{-27\cos3x + 6b}{6} \to \frac{-27 + 6b}{6}, which is 0 when b = \frac92. (With series: \sin 3x = 3x - \frac{9}{2}x^3 + \cdots, giving the same answer at once.)
11.9Challenge
Show that \displaystyle\lim_{x\to\infty}\left(1 + \frac1x\right)^{x^2}e^{-x} = e^{-1/2}. (So \left(1 + \frac1x\right)^x approaches e only slowly.)
Solution
The logarithm is x^2\ln\left(1 + \frac1x\right) - x. With t = \frac1x \to 0^+ this is
So the limit is e^{-1/2}. In other words \left(1 + \frac1x\right)^x \approx e\cdot e^{-1/(2x)} \approx e\left(1 - \frac{1}{2x}\right): the error is about \frac{e}{2x}, matching the slow convergence you saw in Module 3.
11.10Challenge
Let f(x) = e^{-1/x^2} for x \ne 0 and f(0) = 0. Show that f'(0) = 0. Then show that for x \ne 0 every derivative has the form f^{(n)}(x) = P_n(1/x)\,e^{-1/x^2} for a polynomial P_n, and deduce that f^{(n)}(0) = 0 for every n.
Solution
\frac{f(h) - f(0)}{h} = \frac{e^{-1/h^2}}{h}. With t = \frac1h this is t\,e^{-t^2}, and |t|e^{-t^2} \le \frac{|t|}{1 + t^2} \to 0 (using e^{s} \ge 1 + s). So f'(0) = 0.
For x \ne 0: f'(x) = \frac{2}{x^3}e^{-1/x^2}, of the stated form with P_1(u) = 2u^3. If f^{(n)} = P_n(1/x)e^{-1/x^2}, then differentiating gives \left(-\frac{1}{x^2}P_n'(1/x) + \frac{2}{x^3}P_n(1/x)\right)e^{-1/x^2}, again of the form. Now if f^{(n)}(0) = 0, then \frac{f^{(n)}(h) - 0}{h} = \frac1hP_n(1/h)e^{-1/h^2}, which is a polynomial in t = \frac1h times e^{-t^2}, and tends to 0 because e^{t^2} beats every power of t. By induction all derivatives at 0 vanish.
This function matters in Module 19: all its Maclaurin coefficients are 0, yet it is not the zero function.
11.11Challenge
Write out the proof of L’Hôpital’s rule for the left-hand limit x \to a^- in full, including the reason why g(x) \ne 0 for x just below a.
Solution
Set f(a) = g(a) = 0. For x slightly less than a, f and g are continuous on [x, a] and differentiable on (x,a), with g' \ne 0 there. If g(x) = 0 = g(a), Rolle would give a zero of g' in (x, a), so g(x) \ne 0. Cauchy’s theorem on [x,a] gives c_x \in (x, a) with \frac{f(a) - f(x)}{g(a) - g(x)} = \frac{f'(c_x)}{g'(c_x)}, and the left side equals \frac{f(x)}{g(x)}. Given \eps, choose \delta with \left|\frac{f'(c)}{g'(c)} - L\right| < \eps for a - \delta < c < a. For a - \delta < x < a we have a - \delta < c_x < a, so \left|\frac{f(x)}{g(x)} - L\right| < \eps.
Part II · The derivative · Module 12
The shape of a graph
Funksjonsdrøfting
Big questionWhat do f′ and f″ tell us about the graph of f, and how do we read one graph from another?
The Mean Value Theorem turned the sign of f' into information about where f increases. Applied to f' itself, it turns the sign of f'' into information about how the graph bends. This module assembles those facts into reliable tests for maxima, minima and inflexion points, and into a method for sketching any graph and reading one graph from another.
12.1The first derivative test
Theorem 12.1First derivative test
Let c be a critical point of f, with f continuous at c and differentiable near c (except possibly at c).
If f' > 0 just to the left of c and f' < 0 just to the right, f has a local maximum at c.
If f' < 0 just to the left and f' > 0 just to the right, f has a local minimum at c.
If f' has the same sign on both sides, c is not a local extremum.
Proof. In the first case, by the monotonicity test (Theorem 10.8) f is increasing on [c - \delta, c] and decreasing on [c, c + \delta] for some \delta > 0; continuity at c lets us include the endpoint c in both intervals. So f(x) \le f(c) for all x within \delta of c. The other cases are similar. ∎
The test works even where f'(c) does not exist: |x| has f' = -1 to the left of 0 and f' = 1 to the right, so 0 is a local minimum.
12.2Concavity and points of inflexion
Definition 12.2Concavity
A differentiable function f is concave up (or convex) on an interval if f' is increasing there, and concave down (or concave) if f' is decreasing. konvekskonkav
Concave up means the slope keeps increasing, so the graph bends upwards like y = x^2; concave down means it bends downwards like y = -x^2. Applying the monotonicity test to f' gives the working test:
Theorem 12.3Concavity test
If f'' > 0 on an interval, f is concave up there. If f'' < 0, f is concave down.
Definition 12.4Point of inflexion
A point (c, f(c)) is a point of inflexion if f is continuous at c and the concavity of f changes there, from up to down or from down to up. If moreover f'(c) = 0 it is a stationary point of inflexion. vendepunkt
Theorem 12.5Second derivative at an inflexion point
If (c, f(c)) is a point of inflexion and f''(c) exists, then f''(c) = 0.
Proof. At an inflexion point f' changes from increasing to decreasing (or the reverse), so f' has a local extremum at c. Fermat’s theorem applied to f' gives f''(c) = 0. ∎
Pitfallf″(c) = 0 does not make an inflexion point
f(x) = x^4 has f''(0) = 0, but f''(x) = 12x^2 \ge 0 on both sides, so the concavity does not change and (0,0) is a minimum, not an inflexion point. Always check that f''changes sign.
The IB distinguishes inflexion points with zero and non-zero gradient (SL 5.8). For x^3 at 0 the tangent is horizontal: a stationary inflexion, where the graph flattens and carries on rising. For \sin x at 0 the tangent has slope 1: the graph crosses its tangent line there, which is what every inflexion point looks like up close.
so \frac{f'(x)}{x - c} > 0 for all x \ne c near c (Exercise 4.8). Hence f'(x) < 0 just left of c and f'(x) > 0 just right of c, and the first derivative test gives a strict minimum. The case f''(c) < 0 is the same with signs reversed. ∎
When f''(c) = 0 anything can happen: x^4 has a minimum at 0, -x^4 a maximum, and x^3 neither. Then go back to the first derivative test, which never fails for a function differentiable near c.
12.4Reading f, f′ and f″ together
The IB asks you to move between the graphs of f, f' and f'' (SL 5.7). Everything follows from two facts: the sign of f' tells you where f rises and falls, and the sign of f'' tells you where f' rises and falls.
On the graph of f
On the graph of f'
On the graph of f''
increasing
above the axis
(no information)
stationary point
meets the axis
(no information)
local maximum
crosses the axis from + to -
usually negative
local minimum
crosses the axis from - to +
usually positive
concave up
increasing
above the axis
point of inflexion
local maximum or minimum
crosses the axis
Going the other way, from the graph of f' back to f, determines f only up to adding a constant, which shifts the graph vertically (Corollary 10.7). To pin it down you need one point on the graph.
12.5Sketching a graph
A reliable order of work:
Domain, and any points where f is undefined.
Intercepts with the axes, if they are easy to find.
Symmetry: is f even, odd or periodic?
Asymptotes and end behaviour: limits as x \to \pm\infty and at the edges of the domain.
First derivative: its sign gives the intervals of increase and decrease, and the local extrema.
Second derivative: its sign gives concavity and the points of inflexion.
Plot the key points and join them consistently with all of the above.
Example 12.7f(x) = x/(x² + 1)
(1) Domain \R. (2) Only intercept (0,0). (3) Odd. (4) f(x) \to 0 as x \to \pm\infty: horizontal asymptote y = 0.
(5) f'(x) = \dfrac{(x^2+1) - 2x^2}{(x^2+1)^2} = \dfrac{1 - x^2}{(x^2+1)^2}. Positive on (-1, 1), negative outside. So f decreases on (-\infty, -1], increases on [-1, 1] and decreases on [1,\infty): local minimum (-1, -\frac12), local maximum (1, \frac12). With the asymptote, these are the global extrema.
(6) f''(x) = \dfrac{2x(x^2 - 3)}{(x^2+1)^3}, with zeros at 0 and \pm\sqrt3. The sign pattern is -,+,-,+ on the four intervals they create, so f is concave down on (-\infty,-\sqrt3) and (0,\sqrt3), concave up on (-\sqrt3, 0) and (\sqrt3, \infty). Inflexion points: \left(-\sqrt3, -\frac{\sqrt3}{4}\right), (0,0) and \left(\sqrt3, \frac{\sqrt3}{4}\right). Choose “x/(x² + 1)” in the graph above to check the picture.
Example 12.8f(x) = x e⁻ˣ
Domain \R, intercept (0,0). As x \to\infty, f(x) \to 0 (exponentials beat powers), and as x \to -\infty, f(x) \to -\infty. f'(x) = (1 - x)e^{-x}, so there is a global maximum \left(1, \frac1e\right). f''(x) = (x - 2)e^{-x}, so f is concave down on (-\infty,2) and concave up on (2,\infty), with inflexion point \left(2, \frac{2}{e^2}\right). The graph rises from -\infty, peaks at x = 1, then decays towards the asymptote y = 0, bending upwards after x = 2.
12.6Beyond IB: convexity and inequalities
Theorem 12.9A convex graph lies above its tangents
If f is concave up on an interval I and a \in I, then f(x) \ge f(a) + f'(a)(x - a) for all x \in I. If f is concave down, the inequality reverses.
Proof. Let g(x) = f(x) - f(a) - f'(a)(x - a). Then g(a) = 0 and g'(x) = f'(x) - f'(a). Since f' is increasing, g' \le 0 for x < a and g' \ge 0 for x > a, so g has its minimum at a and g \ge 0. ∎
Two inequalities you will use for years follow at once: e^x \ge 1 + x (the tangent at 0 to a convex function) and \ln x \le x - 1 (the tangent at 1 to a concave function). More generally, convexity gives Jensen’s inequalityf\left(\frac{x_1 + \cdots + x_n}{n}\right) \le \frac{f(x_1) + \cdots + f(x_n)}{n} for convex f, which contains the AM–GM inequality as a special case (Exercise 12.10). Convexity is also the central idea of optimisation theory, which you will meet again in later courses.
Key results
First derivative test: f' changes from + to - at a maximum, from - to + at a minimum.
Second derivative test: f'(c) = 0 with f''(c) > 0 is a minimum, with f''(c) < 0 a maximum; f''(c) = 0 is inconclusive.
Concave up \ifff' increasing \Leftarrow f'' > 0. Inflexion means the concavity changes, which forces f''(c) = 0 where f'' exists, but not conversely.
Zeros of f' mark candidate turning points of f; extrema of f' mark inflexion points of f.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
12.1Fluency
For f(x) = x^4 - 4x^3, find and classify all stationary points, and find all points of inflexion. (Check your answer with the “x⁴ − 4x³” option in the graph above.)
Solution
f'(x) = 4x^3 - 12x^2 = 4x^2(x - 3), zero at x = 0 and x = 3. f''(x) = 12x^2 - 24x = 12x(x-2).
At x = 3: f''(3) = 36 > 0, a local minimum (3, -27). At x = 0: f''(0) = 0, so use the first derivative test: 4x^2(x - 3) < 0 on both sides of 0, so f decreases through 0. It is a stationary point of inflexion.
f'' changes sign at x = 0 and x = 2, so the inflexion points are (0, 0) (stationary) and (2, -16) (non-stationary).
12.2Fluency
Sketch y = x^2e^{-x}, showing extrema, inflexion points and asymptotes.
Solution
y \ge 0, with y = 0 only at 0. As x \to\infty, y \to 0; as x \to -\infty, y \to \infty.
y' = (2x - x^2)e^{-x} = x(2 - x)e^{-x}: local minimum (0,0) (also the global minimum), local maximum (2, 4e^{-2}) \approx (2, 0.541).
y'' = (x^2 - 4x + 2)e^{-x}, zero at x = 2 \pm\sqrt2 with a sign change at each: inflexion points at x \approx 0.586 and x \approx 3.414. Concave up, then down between them, then up again as the curve settles onto the asymptote y = 0.
Domain (0,\infty). As x \to 0^+, f \to -\infty (vertical asymptote x = 0); as x \to\infty, f \to 0 (horizontal asymptote).
f'(x) = \frac{1 - \ln x}{x^2}: increasing on (0, e], decreasing on [e, \infty), global maximum (e, \frac1e). f''(x) = \frac{2\ln x - 3}{x^3}: concave down on (0, e^{3/2}), concave up after, inflexion at \left(e^{3/2}, \frac32e^{-3/2}\right).
12.4Fluency
The graph shows y = f'(x) (not f). Determine where f is increasing, where f has local extrema, and the x-coordinates of the points of inflexion of f.
The graph of y = f'(x) = (x+1)(x-2)^2.Solution
f' < 0 for x < -1 and f' \ge 0 for x > -1, so f is decreasing on (-\infty, -1] and increasing on [-1, \infty). At x = -1, f' changes from - to +: a local minimum. At x = 2, f' touches the axis without changing sign: a stationary point of inflexion, not an extremum.
Inflexion points of f are where f' has turning points: the local maximum of f' at x = 0 and the local minimum at x = 2. (Indeed f''(x) = 3x(x-2).)
12.5Fluency
Find the global maximum and minimum of f(x) = x + 2\cos x on [0, 2\pi], and its points of inflexion.
Solution
f'(x) = 1 - 2\sin x = 0 at x = \frac\pi6 and \frac{5\pi}6. f''(x) = -2\cos x: f''(\frac\pi6) < 0 (local max, f = \frac\pi6 + \sqrt3 \approx 2.26) and f''(\frac{5\pi}6) > 0 (local min, f = \frac{5\pi}6 - \sqrt3 \approx 0.886).
Endpoints: f(0) = 2 and f(2\pi) = 2\pi + 2 \approx 8.28. So the global maximum is 2\pi + 2 at x = 2\pi, and the global minimum is \frac{5\pi}{6} - \sqrt3 at x = \frac{5\pi}6. Inflexion points where \cos x changes sign: \left(\frac\pi2, \frac\pi2\right) and \left(\frac{3\pi}{2}, \frac{3\pi}{2}\right).
12.6Understanding
Show that the second derivative test gives no information for x^3, x^4 and -x^4 at 0, and classify each point another way. Then state a test using the first non-zero derivative at c that covers all three.
Solution
All three have f'(0) = f''(0) = 0. First derivative test: 3x^2 \ge 0 on both sides (no extremum, an inflexion); 4x^3 changes from - to + (minimum); -4x^3 from + to - (maximum).
Higher derivative test: if f'(c) = \cdots = f^{(n-1)}(c) = 0 and f^{(n)}(c) \ne 0, then for even n there is a minimum if f^{(n)}(c) > 0 and a maximum if it is negative; for odd n there is no extremum (an inflexion). Here x^3 has n = 3; \pm x^4 have n = 4 with f^{(4)}(0) = \pm24. Module 19 proves this test with Taylor’s theorem.
12.7Understanding
Find the cubic f(x) = ax^3 + bx^2 + cx + d with a local maximum at (-1, 4) and a local minimum at (1, 0).
Solution
f'(x) = 3ax^2 + 2bx + c must vanish at \pm 1, so f'(x) = 3a(x^2 - 1): b = 0, c = -3a. Then f(-1) = 2a + d = 4 and f(1) = -2a + d = 0, so d = 2 and a = 1: f(x) = x^3 - 3x + 2. Check: f''(-1) = -6 < 0 (maximum) and f''(1) = 6 > 0 (minimum).
12.8Understanding
Show that every cubic f(x) = ax^3 + bx^2 + cx + d (a \ne 0) has exactly one point of inflexion, at x_0 = -\frac{b}{3a}, and that its graph is symmetric under a half-turn about that point: f(x_0 + t) + f(x_0 - t) = 2f(x_0).
Solution
f''(x) = 6ax + 2b is linear with a single zero x_0 = -\frac b{3a}, where it changes sign. Expanding the cubic about x_0 (exact, since f is a cubic) gives f(x_0 + t) = f(x_0) + f'(x_0)t + \frac{f''(x_0)}{2}t^2 + at^3, and f''(x_0) = 0. So f(x_0 + t) - f(x_0) = f'(x_0)t + at^3 is an odd function of t, which is the claimed symmetry.
12.9Understanding
Use Theorem 12.9 to prove that \ln x \le x - 1 for all x > 0, with equality only at x = 1.
Solution
\ln is concave down on (0,\infty) since (\ln x)'' = -\frac1{x^2} < 0, so its graph lies below its tangent at x = 1, which is y = x - 1. Equality only at 1: g(x) = x - 1 - \ln x has g'(x) = 1 - \frac1x, negative on (0,1) and positive on (1, \infty), so g > 0 except at x = 1.
12.10Challenge
(Weighted AM–GM.) Let a, b > 0 and 0 < t < 1, and put A = ta + (1-t)b. Apply \ln x \le x - 1 to x = \frac aA and to x = \frac bA to prove a^tb^{1-t} \le ta + (1 - t)b. Deduce \sqrt{ab} \le \frac{a+b}{2}.
Solution
t\ln\frac aA + (1-t)\ln\frac bA \le t\left(\frac aA - 1\right) + (1-t)\left(\frac bA - 1\right) = \frac{ta + (1-t)b}{A} - 1 = 0. The left side is t\ln a + (1-t)\ln b - \ln A, so \ln\left(a^tb^{1-t}\right) \le \ln A, and exponentiating gives the result. With t = \frac12: \sqrt{ab} \le \frac{a+b}2.
12.11Challenge
Show that x^3 + px + q = 0 has three distinct real roots if and only if 4p^3 + 27q^2 < 0.
Solution
If p \ge 0 then f'(x) = 3x^2 + p \ge 0 with equality at most at one point, so f is strictly increasing and has exactly one root; and 4p^3 + 27q^2 \ge 0. So suppose p < 0. Then f has a local maximum at -s and a local minimum at s, where s = \sqrt{-p/3}, and three real roots exist exactly when f(-s) > 0 > f(s), i.e. f(-s)f(s) < 0. Using s^2 = -\frac p3: f(\pm s) = \pm s(s^2 + p) + q = \pm\frac{2p}{3}s + q. So
This module puts the theory to work. The Extreme Value Theorem and Fermat’s theorem together give a complete method for finding the largest and smallest values of a function. The chain rule links quantities that change together in time. And the derivative is velocity, so motion along a line is calculus in its original setting. At the end, Newton’s method turns tangent lines into one of the fastest root-finding algorithms there is.
13.1Global extrema
Theorem 13.1The closed interval method
Let f be continuous on [a, b]. Then f has a global maximum and a global minimum on [a,b], and each occurs either at an endpoint or at a critical point in (a, b). So to find them: list the critical points in (a,b), evaluate f there and at a and b, and pick the largest and smallest values.
Proof. The extrema exist by the Extreme Value Theorem. An extremum at an interior point c is in particular a local extremum, so either f'(c) does not exist or f'(c) = 0 by Fermat’s theorem. Either way c is a critical point. ∎
Example 13.2A first example
f(x) = x^3 - 3x on [0, 2]: f'(x) = 3x^2 - 3 = 0 at x = 1 (the root x = -1 is outside the interval). Compare f(0) = 0, f(1) = -2, f(2) = 2. The global maximum is 2 at x = 2 and the global minimum is -2 at x = 1.
On an open or unbounded interval the extrema need not exist, and you have to argue. Look at the behaviour of f at the ends of the interval, and use the following principle, which covers most textbook problems.
Theorem 13.3A single critical point
Let f be differentiable on an interval I with exactly one critical point c. If c is a local minimum, it is the global minimum on I; if it is a local maximum, it is the global maximum.
Proof. Take the minimum case. f' is non-zero on I except at c. A derivative cannot change sign without passing through 0: this is Darboux’s theorem (Exercise 10.12), or simply the IVT when f' is continuous. So f' has constant sign on the part of I left of c, and constant sign on the part right of c. If f' were positive to the left, f would be strictly increasing there and values just left of c would be smaller than f(c), contradicting the local minimum. So f' < 0 left of c and, similarly, f' > 0 right of c: f decreases all the way to c and increases all the way after it. ∎
13.2Optimisation
A reliable procedure for word problems (SL 5.8, AHL 5.14):
Draw a picture and name the variables.
Write the quantity to optimise, and any constraint linking the variables.
Use the constraint to express the quantity as a function of one variable, and state its domain.
Find the critical points.
Justify that you have the global optimum: closed interval method, single critical point, or the behaviour at the ends of the domain.
Example 13.4The cheapest can
A closed cylindrical can must hold volume V. Which shape uses the least metal? With radius r and height h, the constraint is \pi r^2h = V and the surface area is S = 2\pi r^2 + 2\pi rh. Eliminating h = \frac{V}{\pi r^2}:
S(r) = 2\pi r^2 + \frac{2V}{r}, \qquad r > 0, \qquad S'(r) = 4\pi r - \frac{2V}{r^2}.
S'(r) = 0 exactly when r^3 = \frac{V}{2\pi}. This is the only critical point, S \to \infty as r \to 0^+ and as r \to \infty, and S'' = 4\pi + \frac{4V}{r^3} > 0, so it is the global minimum. Then h = \frac{V}{\pi r^2} = \frac{2\pi r^3}{\pi r^2} = 2r: the best can is as tall as it is wide. (Real cans are taller, because the lids are made of thicker metal and the seams cost extra.)
Example 13.5The largest rectangle in a semicircle
A rectangle has its base on the diameter of a semicircle of radius R and its top corners on the arc. With half-width x, its height is \sqrt{R^2 - x^2}, so the area is A(x) = 2x\sqrt{R^2 - x^2} on [0, R], and
The only critical point in (0,R) is x = \frac{R}{\sqrt2}, where A = R^2. At both endpoints A = 0, so the maximum area is R^2.
Example 13.6Fermat’s principle and Snell’s law
Light travels from a point A in air, at height a above a flat water surface, to a point B in the water, at depth b and horizontal distance d from A. Light moves at speed v_1 in air and v_2 in water, and (Fermat’s principle) it takes the path of least time. If it crosses the surface at horizontal position x, the time is
T(x) = \frac{\sqrt{a^2 + x^2}}{v_1} + \frac{\sqrt{b^2 + (d-x)^2}}{v_2}, \qquad 0 \le x \le d.
Differentiating, and writing \theta_1, \theta_2 for the angles the two segments make with the vertical (the normal to the surface),
Since T'(0) < 0 < T'(d), the IVT gives a critical point, and T'' > 0 (each square root term is convex), so T' is increasing, the critical point is unique, and it is the global minimum. At the optimum
which is Snell’s law of refraction. You will derive it again from wave optics at NTNU; here it falls out of one derivative.
13.3Related rates
When several quantities change with time and are tied together by an equation, differentiating the equation with respect to t (implicitly, with the chain rule) ties their rates together. The method (AHL 5.14):
Write an equation relating the quantities, valid at all times.
Differentiate both sides with respect to t.
Only now substitute the values at the instant of interest, and solve for the unknown rate.
PitfallSubstitute last
If you substitute the instantaneous values before differentiating, the quantities become constants and their derivatives vanish. The equation must hold over an interval of time to be differentiated.
Example 13.7A sliding ladder
A 5 m ladder leans against a wall. Its foot slides away from the wall at 0.5 m/s. How fast is the top sliding down when the foot is 3 m from the wall?
With x the distance of the foot from the wall and y the height of the top: x^2 + y^2 = 25 at all times. Differentiate: 2x\dot x + 2y\dot y = 0. Now substitute x = 3, y = 4, \dot x = 0.5: \ \dot y = -\frac{x\dot x}{y} = -\frac{3(0.5)}{4} = -0.375. The top slides down at 0.375 m/s.
Example 13.8Filling a cone
Water flows at 2 m³/min into an inverted conical tank of height 6 m and top radius 2 m. How fast is the level rising when the water is 3 m deep?
By similar triangles the water surface has radius r = \frac h3, so the volume is V = \frac13\pi r^2h = \frac{\pi h^3}{27}. Differentiate: \dot V = \frac{\pi h^2}{9}\dot h. At h = 3 with \dot V = 2: \dot h = \frac{9\cdot 2}{9\pi} = \frac2\pi \approx 0.64 m/min. The level rises more slowly as the cone widens.
13.4Motion along a line
For an object moving along a line with displacement s(t) from a fixed origin (SL 5.9):
The object is at rest when v = 0, and changes direction where v changes sign.
It is speeding up when v and a have the same sign, and slowing down when they have opposite signs, since \frac{d}{dt}v^2 = 2va.
By the chain rule, a = \frac{dv}{dt} = \frac{dv}{ds}\cdot\frac{ds}{dt} = v\frac{dv}{ds}. This form is useful when acceleration is given as a function of position, as for a spring.
Example 13.9Reading a motion
s(t) = t^3 - 6t^2 + 9t metres for t \ge 0. Then v = 3t^2 - 12t + 9 = 3(t-1)(t-3) and a = 6t - 12.
At rest at t = 1 and t = 3. Moving forwards on [0,1), backwards on (1,3), forwards after t = 3. Speeding up when v and a agree in sign: on (1, 2) (both negative) and for t > 3 (both positive). Slowing down on (0,1) and (2,3).
Distance travelled in the first 4 seconds: the positions are s(0) = 0, s(1) = 4, s(3) = 0, s(4) = 4, so the object travels 4 + 4 + 4 = 12 m, although its displacement is only 4 m. Module 17 computes distances like this with integrals, \int |v|\,dt.
13.5Newton’s method
To solve f(x) = 0, start from a guess x_0 and replace the curve by its tangent line there. The tangent y = f(x_0) + f'(x_0)(x - x_0) crosses the axis at a new, usually better, guess. Repeating gives
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} .
Example 13.10Newton’s method for √2
With f(x) = x^2 - 2: \ x_{n+1} = x_n - \frac{x_n^2 - 2}{2x_n} = \frac12\left(x_n + \frac2{x_n}\right), the Babylonian method from Module 3. From x_0 = 1:
The number of correct digits roughly doubles each step (“quadratic convergence”). Module 19 explains why: the error after a step is proportional to the square of the error before it.
def newton(f, df, x, steps=6):
for _ in range(steps):
x = x - f(x) / df(x)
print(x)
return x
newton(lambda x: x**3 + x - 1, lambda x: 3*x**2 + 1, 1.0) # 0.6823278038...
Compare this with bisection (Module 5), which gains only one binary digit per step. Newton’s method can also fail: if f'(x_n) = 0 the next step is undefined, a bad start can jump to a different root or cycle forever, and near a multiple root it slows down. Bisection is slow but always works; Newton is fast but needs a good start. Practical software combines the two.
Key results
On [a,b], global extrema occur at endpoints or critical points; compare the values.
A single critical point that is a local extremum is a global one.
Optimisation: one variable, a domain, critical points, and a justification.
Related rates: differentiate the equation that holds at all times, then substitute.
v = \dot s, a = \dot v = v\frac{dv}{ds}; speeding up when va > 0.
Newton: x_{n+1} = x_n - f(x_n)/f'(x_n).
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
13.1Fluency
Find the global maximum and minimum of f(x) = x - 2\sin x on [0, \pi].
Solution
f'(x) = 1 - 2\cos x = 0 at x = \frac\pi3. Values: f(0) = 0, f(\frac\pi3) = \frac\pi3 - \sqrt3 \approx -0.685, f(\pi) = \pi. Maximum \pi at x = \pi; minimum \frac\pi3 - \sqrt3 at x = \frac\pi3.
13.2Fluency
An open box is made from a 30 cm by 30 cm sheet by cutting equal squares of side x from the corners and folding up the sides. Find the largest possible volume.
Solution
V(x) = x(30 - 2x)^2 on [0, 15]. V'(x) = (30 - 2x)^2 - 4x(30 - 2x) = (30 - 2x)(30 - 6x), zero at x = 5 and x = 15. V(0) = V(15) = 0 and V(5) = 5\cdot 20^2 = 2000. The maximum volume is 2000 cm³.
13.3Fluency
A spherical balloon is inflated at 100 cm³/s. How fast is the radius increasing when r = 10 cm? How fast is the surface area increasing then?
Solution
V = \frac43\pi r^3, so \dot V = 4\pi r^2\dot r and \dot r = \frac{100}{400\pi} = \frac{1}{4\pi} \approx 0.080 cm/s. S = 4\pi r^2, so \dot S = 8\pi r\dot r = 8\pi\cdot10\cdot\frac{1}{4\pi} = 20 cm²/s.
13.4Fluency
A particle moves with s(t) = te^{-t} metres, t \ge 0. When is it at rest? What is its greatest displacement? When is its acceleration zero?
Solution
v = (1 - t)e^{-t}: at rest at t = 1, where s = \frac1e m. Since v > 0 before and v < 0 after, this is the greatest displacement. a = (t - 2)e^{-t} = 0 at t = 2.
13.5Fluency
A particle has s = 3\sin 2t. Show that a = -4s, and that v^2 = 36 - 4s^2. What does the second equation tell you about where the particle moves fastest?
Solution
v = 6\cos 2t and a = -12\sin 2t = -4s. Then v^2 = 36\cos^2 2t = 36 - 36\sin^2 2t = 36 - 4s^2. Speed is greatest (|v| = 6) at s = 0, the centre of the oscillation, and zero at the ends s = \pm3. This is simple harmonic motion.
13.6Understanding
(Reflection.) A light ray travels from A = (0, a) to the mirror along the x-axis and on to B = (d, b), with a, b > 0. Show that the path of least length makes equal angles with the mirror.
Solution
If it hits the mirror at (x, 0), the length is L(x) = \sqrt{a^2 + x^2} + \sqrt{b^2 + (d-x)^2}. Then L'(x) = \frac{x}{\sqrt{a^2+x^2}} - \frac{d-x}{\sqrt{b^2 + (d-x)^2}} = \sin\theta_1 - \sin\theta_2 (angles from the normal). As in Example 13.6, L is convex with a unique critical point, the global minimum, where \sin\theta_1 = \sin\theta_2, so \theta_1 = \theta_2: the angle of incidence equals the angle of reflection.
13.7Understanding
Find the point on the line 2x + y = 5 closest to the origin, and check that the segment from the origin to it is perpendicular to the line.
Solution
Minimise D^2 = x^2 + (5 - 2x)^2 (minimising D^2 is equivalent and avoids square roots). \frac{d}{dx}D^2 = 2x - 4(5 - 2x) = 10x - 20 = 0 at x = 2, so the point is (2, 1). This is a global minimum since D^2 is a parabola opening upwards. The segment has slope \frac12, the line has slope -2, and \frac12\cdot(-2) = -1.
13.8Understanding
Find the points on the parabola y = x^2 closest to (0, 2).
Solution
D^2 = x^2 + (x^2 - 2)^2 = x^4 - 3x^2 + 4, with derivative 4x^3 - 6x = 2x(2x^2 - 3). Critical points: x = 0 (D^2 = 4) and x = \pm\sqrt{3/2} (D^2 = \frac94 - \frac92 + 4 = \frac74). Since D^2 \to \infty as |x|\to\infty, the closest points are \left(\pm\sqrt{3/2}, \frac32\right), at distance \frac{\sqrt7}{2}. The point (0,0) is a local maximum of the distance.
13.9Understanding
A lighthouse stands 2 km from a straight shore. Its beam turns at 3 revolutions per minute. How fast does the spot of light move along the shore at a point 1 km from the point P on the shore nearest the lighthouse?
Solution
With \theta the angle between the beam and the line to P, the spot is at distance x = 2\tan\theta from P, so \dot x = 2\sec^2\theta\,\dot\theta, with \dot\theta = 3\cdot2\pi = 6\pi rad/min. At x = 1, \tan\theta = \frac12 and \sec^2\theta = \frac54, so \dot x = 2\cdot\frac54\cdot6\pi = 15\pi \approx 47 km/min.
13.10Understanding
A person 1.8 m tall walks away from a 6 m lamp post at 1.5 m/s. How fast does the tip of the shadow move? How fast does the shadow lengthen?
Solution
Let the person be at distance x and the shadow tip at distance T from the post. Similar triangles: \frac{T}{6} = \frac{T - x}{1.8}, so 1.8T = 6T - 6x and T = \frac{10}{7}x. Hence \dot T = \frac{10}7\cdot1.5 = \frac{15}{7} \approx 2.14 m/s, and the shadow length T - x grows at \frac{15}7 - \frac32 = \frac{9}{14} \approx 0.64 m/s, whatever the distance.
13.11Challenge
Apply Newton’s method to f(x) = x^3 - 2x - 5 from x_0 = 2, and compute x_1, x_2, x_3. (Newton himself used this example in 1669.) Then show that for f(x) = x^{1/3} Newton’s method diverges from every starting point x_0 \ne 0.
For f(x) = x^{1/3}: \frac{f(x)}{f'(x)} = \frac{x^{1/3}}{\frac13x^{-2/3}} = 3x, so x_{n+1} = x_n - 3x_n = -2x_n. The iterates double in size and alternate in sign, moving away from the root at 0. The tangent at a point of a steep curve overshoots badly; the vertical tangent at the root is the culprit.
13.12Challenge
A ladder is carried horizontally round a right-angled corner from a corridor of width a into a corridor of width b. Show that the longest ladder that fits has length \left(a^{2/3} + b^{2/3}\right)^{3/2}.
Solution
The ladder fits if it is no longer than every segment touching the inner corner with its ends on the outer walls. If such a segment makes angle \theta with the far wall of the first corridor, its length is L(\theta) = \frac{a}{\sin\theta} + \frac{b}{\cos\theta} for 0 < \theta < \frac\pi2, and we need its minimum. L'(\theta) = -\frac{a\cos\theta}{\sin^2\theta} + \frac{b\sin\theta}{\cos^2\theta} = 0 gives \tan^3\theta = \frac ab. With \tan\theta = (a/b)^{1/3}: \sin\theta = \frac{a^{1/3}}{\sqrt{a^{2/3} + b^{2/3}}} and \cos\theta = \frac{b^{1/3}}{\sqrt{a^{2/3}+b^{2/3}}}, so
It is the global minimum because L \to \infty at both ends of the interval and there is only one critical point. With a = b = 1 this is 2^{3/2}, and the extremal segments trace out the astroid of Module 8.
Part III · The integral · Module 14
Area and the Riemann integral
Areal og Riemann-integralet
Big questionWhat is “the area under a curve”, and how can we compute it exactly?
Differentiation is about rates. Integration is about accumulation: area, distance from velocity, mass from density, work from force. This module defines the integral from scratch as a limit of sums, computes a few integrals straight from the definition (as Archimedes did), and proves the basic properties. The next module shows the astonishing fact that integration undoes differentiation.
14.1The area problem
What is the area under y = x^2 between x = 0 and x = 1? We have no formula for the area of a curved region, so we trap it between areas we can compute. Divide [0,1] into n equal strips of width \frac1n. On the strip \left[\frac{k-1}n, \frac kn\right] the function is increasing, so the rectangle of height \left(\frac kn\right)^2 covers the region over that strip, and the rectangle of height \left(\frac{k-1}{n}\right)^2 fits inside it.
Upper and lower rectangles for y = x^2 on [0,1] with five strips. The true area lies between the two totals.
We need the sums of powers, which you proved by induction in AHL 1.15:
Both tend to \frac13 as n \to\infty, and the area lies between them for every n. So the area is exactly \frac13. Archimedes found the area of a parabolic segment by essentially this argument around 250 BC, nineteen centuries before calculus.
14.2Partitions and the definition of the integral
To turn the argument into a definition that works for any bounded function, allow strips of unequal width, and use infima and suprema in place of the values at the endpoints.
Definition 14.1Partitions, upper and lower sums
Let f be bounded on [a,b]. A partition of [a,b] is a finite set P = \{x_0, x_1, \dots, x_n\} with a = x_0 < x_1 < \cdots < x_n = b. Write \Delta x_k = x_k - x_{k-1}, and
m_k = \inf\{f(x) : x_{k-1} \le x \le x_k\}, \qquad M_k = \sup\{f(x) : x_{k-1} \le x \le x_k\}.
Clearly L(f,P) \le U(f,P). A partition Q that contains every point of P (and maybe more) is a refinement of P.
Lemma 14.2Refining improves both sums
If Q refines P, then L(f,P) \le L(f,Q) \le U(f,Q) \le U(f,P). Consequently L(f,P) \le U(f,Q) for any two partitions P and Q.
Proof. It suffices to add one point y to P, inside some [x_{k-1}, x_k]. The infimum of f over each of the two halves is at least the infimum over the whole subinterval, so the lower sum can only increase; similarly the upper sum can only decrease. For two arbitrary partitions P and Q, compare both with their common refinement P \cup Q: \ L(f,P) \le L(f, P\cup Q) \le U(f, P\cup Q) \le U(f,Q). ∎
So every lower sum is below every upper sum. By completeness the lower integral\sup_P L(f,P) and the upper integral\inf_P U(f,P) both exist, and the lower integral is at most the upper integral.
Definition 14.3The Riemann integral
A bounded function f is integrable on [a,b] if its lower and upper integrals are equal. Their common value is the definite integral
\int_a^b f(x)\,dx .
bestemt integralintegrerbar
The notation is Leibniz’s: \int is a stretched S for summa, and f(x)\,dx recalls the area f(x_k)\,\Delta x_k of a thin rectangle. The variable x is a dummy: \int_a^b f(x)\,dx = \int_a^b f(t)\,dt.
A Riemann sum uses any sample point t_k in each subinterval: S = \sum f(t_k)\,\Delta x_k. Since m_k \le f(t_k) \le M_k, every Riemann sum lies between L(f,P) and U(f,P). So for an integrable function, Riemann sums with fine enough partitions are close to the integral, whatever the sample points. Left endpoints, right endpoints and midpoints are all special cases.
Theorem 14.4Riemann’s criterion
A bounded function f is integrable on [a,b] if and only if for every \eps > 0 there is a partition P with U(f,P) - L(f,P) < \eps.
Proof. (\Leftarrow) For every P, lower integral \ge L(f,P) and upper integral \le U(f,P), so their difference is at most U(f,P) - L(f,P) < \eps. As \eps is arbitrary, the difference is 0.
(\Rightarrow) Let I be the integral. By the ε-test for suprema and infima there are partitions P_1, P_2 with L(f,P_1) > I - \frac\eps2 and U(f,P_2) < I + \frac\eps2. For P = P_1 \cup P_2, refinement gives U(f,P) - L(f,P) \le U(f,P_2) - L(f,P_1) < \eps. ∎
14.3Which functions are integrable?
Theorem 14.5Monotone functions are integrable
Every monotone function on [a,b] is integrable.
Proof. Suppose f is increasing, and use the partition into n equal pieces of width \frac{b-a}{n}. On each piece the infimum is the value at the left end and the supremum the value at the right end, so the difference telescopes:
U - L = \sum_{k=1}^n\big(f(x_k) - f(x_{k-1})\big)\frac{b - a}{n} = \frac{\big(f(b) - f(a)\big)(b - a)}{n},
which is less than any given \eps for large n. Apply Riemann’s criterion. ∎
Theorem 14.6Continuous functions are integrable
Every continuous function on [a,b] is integrable. So is every bounded function with finitely many discontinuities.
Taken on trustWhy continuity is enough
The proof uses uniform continuity (Module 5): on a closed bounded interval, for every \eps > 0 there is one \delta > 0 such that |f(x) - f(y)| < \frac{\eps}{b - a} whenever |x - y| < \delta. Then for any partition whose pieces are shorter than \delta, each M_k - m_k < \frac{\eps}{b-a}, so U - L < \eps. That a continuous function on [a,b] is uniformly continuous is Heine’s theorem, which we take on trust; it is proved with Bolzano–Weierstrass, much like the Extreme Value Theorem.
Example 14.7A function that is not integrable
For the Dirichlet function D on [0,1], every subinterval contains rationals and irrationals, so every m_k = 0 and every M_k = 1. Hence L(D,P) = 0 and U(D,P) = 1 for every partition: the lower integral is 0, the upper is 1, and D is not Riemann integrable. (A more powerful integral, the Lebesgue integral, gives it the value 0. You will meet it if you go on in analysis or probability.)
14.4Computing integrals from the definition
For an integrable function, the integral is the limit of any sequence of Riemann sums whose partitions get finer. For monotone and continuous functions on equal partitions, that is easy to use:
As n \to \infty, e^{1/n} \to 1 and \frac{e^{1/n} - 1}{1/n} \to 1 (that is L(e) = 1 from Module 9). So \int_0^1 e^x\,dx = e - 1.
It works, but it takes a clever sum every time, and most functions have no such sum. The Fundamental Theorem of Calculus in Module 15 will turn all of these into one-line computations.
14.5Properties of the integral
Theorem 14.9Properties of the integral
Let f and g be integrable on [a,b], and \alpha, \beta constants.
Linearity:\int_a^b(\alpha f + \beta g) = \alpha\int_a^b f + \beta\int_a^b g.
Additivity: if a < c < b, then \int_a^b f = \int_a^c f + \int_c^b f.
Monotonicity: if f \le g on [a,b], then \int_a^b f \le \int_a^b g. In particular, if m \le f \le M then m(b - a) \le \int_a^b f \le M(b-a).
Proof. (3) On every subinterval \sup f \le \sup g, so U(f,P) \le U(g,P) for every P; taking infima over P gives the claim. (1) On each subinterval \sup(f+g) \le \sup f + \sup g and \inf(f + g) \ge \inf f + \inf g, so L(f,P) + L(g,P) \le L(f+g,P) \le U(f+g,P) \le U(f,P) + U(g,P), and both outer quantities can be made close to \int f + \int g. Constant multiples are similar (a negative constant swaps sup and inf). (2) Adding the point c to a partition only refines it, and partitions of [a,b] containing c split into partitions of [a,c] and [c,b]. (4) follows from (3) applied to -|f| \le f \le |f|, once one knows |f| is integrable, which we take on trust. ∎
We also define\int_a^a f = 0 and \int_b^a f = -\int_a^b f. With these conventions, additivity holds for a, b, c in any order.
The integral measures signed area (SL 5.11): area above the x-axis counts as positive and area below as negative. For instance \int_{-1}^{1}x^3\,dx = 0, though the region between the curve and the axis has positive area. The actual area between the graph and the axis is \int_a^b |f(x)|\,dx; in practice, split the interval at the zeros of f. Symmetry helps too: if f is odd, the signed areas on [-a, 0] and [0,a] cancel, so \int_{-a}^a f = 0, and if f is even, \int_{-a}^a f = 2\int_0^af.
14.6The Mean Value Theorem for integrals
Theorem 14.10Mean Value Theorem for integrals
If f is continuous on [a,b], then for some c \in [a,b]
\int_a^b f(x)\,dx = f(c)\,(b - a).
Proof. By the Extreme Value Theorem, f has a minimum m = f(p) and a maximum M = f(q) on [a,b]. By monotonicity of the integral, m \le \frac{1}{b-a}\int_a^b f \le M. By the Intermediate Value Theorem, f takes this middle value at some c between p and q. ∎
The number \frac{1}{b-a}\int_a^b f(x)\,dx is the average value of f on [a,b]: the height of the rectangle with the same base and the same area. The theorem says a continuous function attains its average. For example, the average of \sin on [0,\pi] is \frac{2}{\pi} (you will compute \int_0^\pi\sin x\,dx = 2 in Module 15). This theorem is the key step in the proof of the Fundamental Theorem.
14.7Beyond IB: numerical integration
Beyond IBMidpoint, trapezoid and Simpson
When no formula is available, as for \int_0^1 e^{-x^2}dx, integrals are computed numerically, and numerical integration is on the NTNU syllabus. With n equal pieces of width h, the midpoint ruleM_n uses midpoints, and the trapezoidal ruleT_n = \frac{L_n + R_n}{2} joins neighbouring points with straight lines. For \int_0^1 e^x\,dx = e - 1:
n
left L_n
midpoint M_n
trapezoid T_n
Simpson \frac{2M_n + T_n}{3}
10
error -8.4\times10^{-2}
-7.2\times10^{-4}
1.4\times10^{-3}
6.0\times10^{-8}
100
-8.6\times10^{-3}
-7.2\times10^{-6}
1.4\times10^{-5}
6.0\times10^{-12}
Multiplying n by 10 divides the error of the endpoint rules by 10, of the midpoint and trapezoidal rules by 100, and of Simpson’s rule by 10 000: errors proportional to h, h^2 and h^4. Notice also that the midpoint error is about half the trapezoid error with the opposite sign; Simpson’s rule is the combination that cancels them. Taylor’s theorem (Module 19) explains all of this.
Key results
L(f,P) \le any Riemann sum \le U(f,P); refining raises L and lowers U; every L is below every U.
\int_a^b f exists when \sup_P L = \inf_P U; equivalently, U - L can be made smaller than any \eps.
Monotone and continuous functions are integrable; the Dirichlet function is not.
The integral is linear, additive over intervals and monotone, and measures signed area.
A continuous function attains its average value: \int_a^b f = f(c)(b-a).
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
Compute the lower and upper sums for f(x) = \frac1x on [1,2] with four equal pieces, and use them to bound \int_1^2\frac{dx}{x}. (Module 15 shows this integral is \ln 2.)
Solution
The points are 1, 1.25, 1.5, 1.75, 2 and f is decreasing, so the upper sum uses left endpoints and the lower sum right endpoints: U = \frac14\left(1 + 0.8 + 0.6667 + 0.5714\right) \approx 0.7595 and L = \frac14\left(0.8 + 0.6667 + 0.5714 + 0.5\right) \approx 0.6345. So 0.634 < \int_1^2\frac{dx}x < 0.760, consistent with \ln 2 \approx 0.693.
14.4Fluency
Use geometry or symmetry to evaluate: (a) \int_{-2}^2\sqrt{4 - x^2}\,dx (b) \int_{-1}^3(2x - 2)\,dx (c) \int_{-\pi}^{\pi}x^2\sin^3x\,dx.
Solution
(a) The upper half of a disc of radius 2: \frac12\pi\cdot 4 = 2\pi. (b) The line crosses the axis at x = 1; the triangle below on [-1, 1] has area 4 and the triangle above on [1,3] has area 4, so the signed area is 0. (c) The integrand is odd, so the integral is 0.
14.5Understanding
Prove directly from upper and lower sums that f(x) = x is integrable on [0, b] with \int_0^b x\,dx = \frac{b^2}2.
Solution
With n equal pieces, m_k = \frac{(k-1)b}{n} and M_k = \frac{kb}{n}. So L = \frac{b^2}{n^2}\sum_{k=1}^n(k-1) = \frac{b^2(n-1)}{2n} and U = \frac{b^2}{n^2}\sum_{k=1}^n k = \frac{b^2(n+1)}{2n}. Then U - L = \frac{b^2}{n} \to 0, so f is integrable, and the integral lies between L and U for every n, both of which tend to \frac{b^2}2.
14.6Understanding
Prove that \int_0^b e^x\,dx = e^b - 1 from the definition, adapting Example 14.8.
Solution
With h = \frac bn: \ R_n = h\sum_{k=1}^n e^{kh} = h e^h\frac{e^{nh} - 1}{e^h - 1} = (e^b - 1)\,e^h\cdot\frac{h}{e^h - 1}. As n\to\infty, h \to 0, e^h \to 1 and \frac{h}{e^h - 1} \to 1, so R_n \to e^b - 1. Since e^x is increasing, it is integrable and the integral is this limit.
14.7Understanding
Show that \frac23 \le \int_0^1 e^{-x^2}\,dx \le 1. (Hint: e^t \ge 1 + t.)
Solution
For 0 \le x \le 1: e^{-x^2} \le 1, and e^{-x^2} \ge 1 - x^2. By monotonicity, \int_0^1(1 - x^2)\,dx \le \int_0^1e^{-x^2}dx \le \int_0^1 1\,dx. The left integral is 1 - \frac13 = \frac23 (using \int_0^1x^2 = \frac13). The true value is 0.7468\ldots, and this integral has no elementary antiderivative (Module 16).
14.8Understanding
Given that \int_0^\pi\sin x\,dx = 2, find the average value of \sin on [0, \pi] and every c promised by the Mean Value Theorem for integrals.
Solution
Average = \frac{2}{\pi} \approx 0.637. Solve \sin c = \frac2\pi on [0,\pi]: c = \arcsin\frac2\pi \approx 0.690 or c = \pi - \arcsin\frac2\pi \approx 2.451.
14.9Challenge
Prove by induction that \sum_{k=1}^n k^3 = \left(\frac{n(n+1)}{2}\right)^2, and use it to show \int_0^b x^3\,dx = \frac{b^4}4 from the definition.
Solution
For n = 1 both sides are 1. The step: \left(\frac{n(n+1)}2\right)^2 + (n+1)^3 = \frac{(n+1)^2}{4}\left(n^2 + 4n + 4\right) = \left(\frac{(n+1)(n+2)}{2}\right)^2.
Right endpoints: R_n = \sum_{k=1}^n\left(\frac{kb}{n}\right)^3\frac bn = \frac{b^4}{n^4}\cdot\frac{n^2(n+1)^2}{4} \to \frac{b^4}{4}. (Pattern: \int_0^bx^m\,dx = \frac{b^{m+1}}{m+1}. The FTC will prove it for every m at once.)
14.10Challenge
Let f be continuous on [a,b] with f \ge 0 and \int_a^b f = 0. Prove that f(x) = 0 for every x. Show by example that continuity is needed.
Solution
Suppose f(c) > 0. By continuity there is a closed interval J \subseteq [a,b] of positive length \ell containing c on which f \ge \frac{f(c)}{2}. Take a partition that has J as one of its pieces. Its lower sum is at least \frac{f(c)}{2}\ell > 0 (the other pieces contribute \ge 0). So \int_a^b f \ge \frac{f(c)}2\ell > 0, a contradiction.
Without continuity: f(x) = 0 except f(\frac12) = 1 on [0,1] has integral 0 (a single point contributes nothing) but is not the zero function.
14.11Challenge
(Thomae’s function.) Let f(x) = \frac1q if x = \frac pq in lowest terms with q \ge 1, and f(x) = 0 if x is irrational. Show that f is integrable on [0,1] with integral 0, although it is discontinuous at every rational point.
Solution
Every lower sum is 0, since each subinterval contains irrationals. Fix \eps > 0. Only finitely many points of [0,1] have f(x) \ge \frac\eps2 (those \frac pq with q \le \frac2\eps), say N of them. Choose a partition in which each of these points lies in a piece of length less than \frac{\eps}{2N}, so these pieces have total length less than \frac\eps2. On those pieces M_k \le 1, contributing less than \frac\eps2; on all other pieces M_k < \frac\eps2, contributing less than \frac\eps2\cdot 1. So U < \eps. Hence the upper integral is 0, equal to the lower integral.
(At a rational \frac pq, irrationals nearby have value 0 \ne \frac1q, so f is discontinuous there. In fact f is continuous at every irrational point.)
Part III · The integral · Module 15
The Fundamental Theorem of Calculus
Analysens fundamentalteorem
Big questionWhy on earth should areas be computed by running derivatives backwards?
This is the theorem that makes calculus one subject instead of two. Areas, defined as limits of sums, can be computed by running derivatives backwards. We prove both halves of the Fundamental Theorem, use them to build the table of standard integrals, and then pay the debt from Module 9 by rebuilding the logarithm and the exponential function rigorously from an integral.
15.1The area function
Fix a continuous function f on [a,b] and let the upper limit vary:
A(x) = \int_a^x f(t)\,dt, \qquad a \le x \le b .
A(x) is the signed area under the graph from a up to x. For f(t) = t and a = 0 the region is a triangle and A(x) = \frac{x^2}{2}; for f(t) = t^2, Module 14 gave A(x) = \frac{x^3}{3}. In both cases A'(x) = f(x). That is not a coincidence.
When x increases by h, the area grows by a thin strip whose area is about f(x)\cdot h. So the rate of change of the area is the height of the graph.
15.2The Fundamental Theorem, part 1
Theorem 15.1Fundamental Theorem of Calculus, part 1
If f is continuous on [a,b], then A(x) = \int_a^x f(t)\,dt is differentiable on [a, b] (one-sided at the endpoints) and
A'(x) = f(x).
analysens fundamentalteorem
Proof. Let h \ne 0 be small, with x + h \in [a,b]. By additivity of the integral (with the conventions of Module 14 when h < 0),
A(x+h) - A(x) = \int_x^{x+h} f(t)\,dt .
By the Mean Value Theorem for integrals (Theorem 14.10) this equals f(c_h)\cdot h for some c_h between x and x + h. Therefore
\frac{A(x + h) - A(x)}{h} = f(c_h).
As h \to 0, c_h is squeezed towards x, so f(c_h) \to f(x) because f is continuous. ∎
Corollary 15.2Every continuous function has an antiderivative
If f is continuous on an interval, then f = F' for some function F: for instance F(x) = \int_a^x f(t)\,dt for any fixed a in the interval.
This includes functions like e^{-x^2} and \frac{\sin x}{x} whose antiderivatives cannot be written in terms of elementary functions (Module 16). The integral itself defines them; the error function \operatorname{erf}(x) = \frac{2}{\sqrt\pi}\int_0^xe^{-t^2}dt of probability and statistics is the best-known example.
Combined with the chain rule, part 1 differentiates integrals with variable limits:
Proof. The area function A from part 1 and the given F are both antiderivatives of f on [a,b], so by Corollary 10.7 they differ by a constant: F = A + C. Hence F(b) - F(a) = A(b) - A(a) = \int_a^b f - 0. ∎
A second proof shows what is really going on, and it works whenever f is integrable and has an antiderivative, continuous or not. Take any partition P of [a,b]. The total change of F is the sum of its changes over the pieces, and the Mean Value Theorem rewrites each one:
The right-hand side is a Riemann sum, so L(f,P) \le F(b) - F(a) \le U(f,P) for every partition. For an integrable function the only number between all lower and all upper sums is the integral. In words: the total change of a quantity is the sum of its small changes, and each small change is approximately rate times step.
Example 15.5One-line integrals
\displaystyle\int_0^b x^n\,dx = \left[\frac{x^{n+1}}{n+1}\right]_0^b = \frac{b^{n+1}}{n+1} for every n \ge 0, replacing all the sums of powers in Module 14.
\displaystyle\int_0^1\frac{dx}{1+x^2} = \Big[\arctan x\Big]_0^1 = \frac\pi4. So \pi = 4\displaystyle\int_0^1\frac{dx}{1 + x^2}, an area under a rational function.
15.4Antiderivatives and indefinite integrals
Definition 15.6Antiderivative, indefinite integral
F is an antiderivative of f on an interval I if F' = f on I. The indefinite integral\int f(x)\,dx = F(x) + C denotes the family of all antiderivatives on I. By Corollary 10.7 every antiderivative has this form. ubestemt integralantiderivert
Each line of the table below is a derivative from Modules 6–9 read backwards. Check every line by differentiating the right-hand side.
\int f(x)\,dx
F(x) + C
\int f(x)\,dx
F(x) + C
\int x^n\,dx, n \ne -1
\frac{x^{n+1}}{n+1}
\int\sec^2 x\,dx
\tan x
\int\frac{dx}{x}
\ln|x|
\int\csc^2x\,dx
-\cot x
\int e^x\,dx
e^x
\int\sec x\tan x\,dx
\sec x
\int a^x\,dx
\frac{a^x}{\ln a}
\int\csc x\cot x\,dx
-\csc x
\int\sin x\,dx
-\cos x
\int\frac{dx}{1+x^2}
\arctan x
\int\cos x\,dx
\sin x
\int\frac{dx}{\sqrt{1-x^2}}
\arcsin x
PitfallThe +C in ∫dx/x
\ln|x| is an antiderivative of \frac1x on each of the intervals (0,\infty) and (-\infty,0). On their union the most general antiderivative is \ln|x| + C_1 for x > 0 and \ln|x| + C_2 for x < 0, with independent constants, because \R\setminus\{0\} is not an interval. In practice we work on one interval at a time. Never integrate \frac1x across 0: \int_{-1}^1\frac{dx}{x} is not defined.
Linear composites (SL 5.10, AHL 5.15). If \int f(x)\,dx = F(x) + C and a \ne 0, then
\int f(ax + b)\,dx = \frac1a F(ax+b) + C,
because by the chain rule \frac{d}{dx}\frac1aF(ax+b) = f(ax+b). For example
\int\frac{dx}{a^2 + x^2} = \frac1a\arctan\frac xa + C, \qquad \int\frac{dx}{\sqrt{a^2-x^2}} = \arcsin\frac xa + C .
Example 15.7Using an initial condition
If f'(x) = 6x^2 - 4x and the graph passes through (1,3), then f(x) = 2x^3 - 2x^2 + C and f(1) = C = 3. So f(x) = 2x^3 - 2x^2 + 3. One point fixes the constant. In kinematics the same idea recovers velocity from acceleration and position from velocity, given the initial values (Module 17).
PitfallDifferent-looking answers can both be right
\int 2\sin x\cos x\,dx equals \sin^2 x + C (substitute u = \sin x), or -\cos^2 x + C (substitute u = \cos x), or -\frac12\cos 2x + C (use 2\sin x\cos x = \sin 2x). All three are correct, because \sin^2 x, -\cos^2 x and -\frac12\cos 2x differ by constants. To check an antiderivative, differentiate it.
15.5Definite integrals and area
The FTC computes signed area (SL 5.11). For the actual area between a graph and the x-axis, split the interval at the zeros of f and add the absolute values of the pieces.
Example 15.8Signed area versus area
\int_{-1}^1(x^3 - x)\,dx = \left[\frac{x^4}4 - \frac{x^2}2\right]_{-1}^1 = 0, by symmetry: the function is odd. The area enclosed between y = x^3 - x and the axis is
In Module 9 we assumed the laws of real exponents and only sketched why \lim\frac{a^h - 1}{h} exists. Here is a complete construction that needs neither. It starts from the one thing we know for certain: \frac1t is continuous on (0,\infty), so by the FTC it has an antiderivative.
Definition 15.9The logarithm, defined by an integral
For x > 0, \displaystyle \ln x = \int_1^x\frac{dt}{t}.
Theorem 15.10Properties of the integral logarithm
\ln is differentiable with (\ln x)' = \frac1x, \ln 1 = 0, and \ln is strictly increasing.
\ln(ab) = \ln a + \ln b for all a, b > 0.
\ln(a^r) = r\ln a for every a > 0 and rational r.
\ln is a bijection from (0, \infty) onto \R.
Proof. (1) FTC part 1, and (\ln x)' = \frac1x > 0.
(2) Fix a > 0 and let g(x) = \ln(ax) - \ln x for x > 0. By the chain rule g'(x) = \frac{a}{ax} - \frac1x = 0, so g is constant on the interval (0,\infty), and g(x) = g(1) = \ln a. Put x = b.
(3) The same trick: h(x) = \ln(x^r) - r\ln x has h'(x) = \frac{rx^{r-1}}{x^r} - \frac rx = 0 and h(1) = 0.
(4) \ln 2 > 0, so \ln(2^n) = n\ln 2 \to \infty and \ln(2^{-n}) = -n\ln2 \to -\infty. Since \ln is continuous and strictly increasing, the IVT shows it takes every real value exactly once. ∎
Now define \exp as the inverse of \ln, a function from \R onto (0,\infty), and let e = \exp(1): the number with \int_1^e\frac{dt}{t} = 1.
Theorem 15.11The exponential function, rebuilt
\exp' = \exp.
\exp(x + y) = \exp(x)\exp(y).
\exp(r) = e^r for every rational r.
Proof. (1) By the inverse function rule, \exp'(y) = \frac{1}{\ln'(\exp y)} = \exp y. (2) Apply \ln to both sides and use property (2) of \ln. (3) By property (3), \ln(e^r) = r\ln e = r, so e^r = \exp(r). ∎
Part (3) says \exp agrees with “e to the power x” whenever that already had a meaning, so it is natural to definee^x = \exp(x) for every real x, and a^x = e^{x\ln a} for a > 0. The laws of exponents for real powers now follow from (2), and \frac{d}{dx}a^x = (\ln a)a^x follows from the chain rule. Everything in Module 9 is proved, without suprema of rational powers or convexity arguments. Many university texts, Adams and Essex among them, take exactly this route.
Historically, logarithms were first recognised as areas under the hyperbola y = \frac1t in the 1640s, three decades after Napier published them as an aid to computation (1614) and a generation before Newton and Leibniz.
Key results
FTC 1: \frac{d}{dx}\int_a^xf(t)\,dt = f(x) for continuous f. Every continuous function has an antiderivative.
FTC 2: \int_a^bf = F(b) - F(a) for any antiderivative F. Total change is the sum of small changes.
Indefinite integrals: \int f = F + C on an interval; check by differentiating. \int f(ax+b)\,dx = \frac1aF(ax+b) + C.
\ln x = \int_1^x\frac{dt}t gives a complete foundation for \ln, \exp and real powers.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
(h) \frac12\ln|2x+1| + C. (i) \arcsin\frac x2 + C.
15.2Fluency
Find: (a) \frac{d}{dx}\int_1^x\sqrt{1 + t^3}\,dt (b) \frac{d}{dx}\int_x^3\sin(t^2)\,dt (c) \frac{d}{dx}\int_0^{x^2}e^{-t^2}dt (d) \frac{d}{dx}\int_x^{2x}\frac{dt}{t} for x > 0. Explain the answer to (d).
(d) \frac{1}{2x}\cdot 2 - \frac1x = 0. The integral is constant: \int_x^{2x}\frac{dt}t = \ln 2x - \ln x = \ln 2 for every x > 0. (Scaling the interval and the integrand together leaves the area under \frac1t unchanged; this is the property \ln(ab) = \ln a + \ln b in disguise.)
15.3Fluency
Find the total area between y = \sin x and the x-axis for 0 \le x \le 2\pi, and compare with \int_0^{2\pi}\sin x\,dx.
Solution
\int_0^\pi\sin x\,dx = 2 and \int_\pi^{2\pi}\sin x\,dx = -2, so the area is 2 + 2 = 4, while the integral is 0.
(c) \tan^2 x = \sec^2x - 1, so the answer is \tan x - x + C.
15.5Fluency
The gradient of a curve is f'(x) = 6x^2 - 4x, and the curve passes through (1, 3). Find f.
Solution
f(x) = 2x^3 - 2x^2 + C and f(1) = C = 3, so f(x) = 2x^3 - 2x^2 + 3.
15.6Understanding
Find a function f and a number a such that \displaystyle 6 + \int_a^x\frac{f(t)}{t^2}\,dt = 2\sqrt x for all x > 0.
Solution
Differentiate: \frac{f(x)}{x^2} = \frac{1}{\sqrt x}, so f(x) = x^{3/2}. Put x = a: the integral vanishes, so 6 = 2\sqrt a and a = 9.
15.7Understanding
Using only the definition \ln x = \int_1^x\frac{dt}{t} and monotonicity of the integral, prove that 1 - \frac1x \le \ln x \le x - 1 for all x > 0.
Solution
For x \ge 1: on [1, x] we have \frac1x \le \frac1t \le 1, so \frac{x-1}{x} \le \int_1^x\frac{dt}{t} \le x - 1. For 0 < x < 1: \ln x = -\int_x^1\frac{dt}t, and on [x,1] we have 1 \le \frac1t \le \frac1x, so 1 - x \le \int_x^1\frac{dt}t \le \frac{1 - x}{x}. Negating gives 1 - \frac1x \le \ln x \le x - 1 again.
15.8Understanding
Using the definition \ln x = \int_1^x\frac{dt}t and the derivative trick of Theorem 15.10, prove that \ln\frac1x = -\ln x.
Solution
Let k(x) = \ln\frac1x + \ln x. Then k'(x) = x\cdot\left(-\frac1{x^2}\right) + \frac1x = 0, so k is constant on (0,\infty), and k(1) = 0. (Or: \ln x + \ln\frac1x = \ln 1 = 0 by property (2).)
15.9Understanding
Let F(x) = \int_0^x\frac{\sin t}{t}\,dt, where the integrand is given the value 1 at t = 0. Find all local maxima and minima of F on (0, \infty).
Solution
F'(x) = \frac{\sin x}{x}, which is zero at x = k\pi and changes sign at each. At odd multiples \pi, 3\pi, 5\pi, \dots it changes from + to - (local maxima); at even multiples 2\pi, 4\pi, \dots from - to + (local minima). (In fact F(x) \to \frac\pi2 as x \to \infty, a famous result that needs more advanced methods.)
15.10Challenge
Recognise Riemann sums: show that \displaystyle\lim_{n\to\infty}\left(\frac{1}{n+1} + \frac1{n+2} + \cdots + \frac{1}{2n}\right) = \ln 2 and \displaystyle\lim_{n\to\infty}\frac{1^p + 2^p + \cdots + n^p}{n^{p+1}} = \frac{1}{p+1} for p > 0.
Solution
\sum_{j=1}^n\frac{1}{n + j} = \frac1n\sum_{j=1}^n\frac{1}{1 + j/n} is a right-endpoint Riemann sum for \int_0^1\frac{dx}{1+x} = \ln 2. And \frac{1}{n}\sum_{j=1}^n\left(\frac jn\right)^p is a Riemann sum for \int_0^1x^p\,dx = \frac1{p+1}. Both integrands are continuous, so the Riemann sums converge to the integrals.
15.11Challenge
Show that 0 \le \int_0^1\frac{x^n}{1+x}dx \le \frac{1}{n+1}. By integrating the identity \frac{1}{1+x} = 1 - x + x^2 - \cdots + (-x)^{n-1} + \frac{(-x)^n}{1+x}, prove that
Adapt the argument to prove 1 - \frac13 + \frac15 - \frac17 + \cdots = \frac\pi4.
Solution
On [0,1], 0 \le \frac{x^n}{1+x} \le x^n, and \int_0^1x^n\,dx = \frac{1}{n+1}. The identity is the geometric sum \sum_{k=0}^{n-1}(-x)^k = \frac{1 - (-x)^n}{1 + x} rearranged. Integrating from 0 to 1:
The last term tends to 0, so the partial sums converge to \ln 2. For \frac\pi4, use \frac{1}{1+x^2} = \sum_{k=0}^{n-1}(-x^2)^k + \frac{(-x^2)^n}{1+x^2} and \int_0^1\frac{x^{2n}}{1+x^2}dx \le \frac{1}{2n+1}, with \int_0^1\frac{dx}{1+x^2} = \frac\pi4.
15.12Challenge
Let F(x) = x^2\sin(1/x^2) for x \ne 0 and F(0) = 0. Show that F is differentiable on [0,1], but that F' is unbounded on [0,1]. Why does this not contradict the FTC?
Solution
F'(0) = \lim h\sin(1/h^2) = 0. For x \ne 0, F'(x) = 2x\sin(1/x^2) - \frac{2}{x}\cos(1/x^2). At x_n = \frac{1}{\sqrt{2\pi n}} the cosine is 1 and the sine is 0, so F'(x_n) = -2\sqrt{2\pi n} \to -\infty. An unbounded function is not Riemann integrable, so \int_0^1F' does not exist as a Riemann integral, even though F(1) - F(0) = \sin 1 does. The FTC part 2 assumes f is integrable (or continuous); that hypothesis fails here.
Part III · The integral · Module 16
Techniques of integration
Integrasjonsteknikker
Big questionEvery rule of differentiation, run backwards, becomes a method of integration. Which ones, and how?
Differentiation is mechanical: every elementary function has an elementary derivative, found by rules. Integration is not. There is no product rule or chain rule for antiderivatives. Instead, each rule of differentiation, run backwards, becomes a technique: the chain rule becomes substitution, the product rule becomes integration by parts, and algebra (partial fractions, trigonometric identities, completing the square) prepares integrands for the table of Module 15.
16.1Substitution: the chain rule backwards
Theorem 16.1Substitution rule
Let g be differentiable and let F' = f. Then
\int f\big(g(x)\big)\,g'(x)\,dx = F\big(g(x)\big) + C .
In other words: put u = g(x), so that “du = g'(x)\,dx”, compute \int f(u)\,du = F(u) + C, and substitute back. substitusjon
Proof. By the chain rule, \frac{d}{dx}F(g(x)) = F'(g(x))g'(x) = f(g(x))g'(x). ∎
The notation du = g'(x)\,dx is shorthand for the chain rule; it is not an equation between numbers. It works because Leibniz’s notation was designed to make it work. The thing to look for is an inner function whose derivative is also present, up to a constant factor. The IB calls spotting this “integration by inspection” (SL 5.10).
Example 16.2Spotting the inner derivative
\displaystyle\int x\cos(x^2)\,dx: with u = x^2, du = 2x\,dx, so this is \frac12\int\cos u\,du = \frac12\sin(x^2) + C.
\displaystyle\int\frac{f'(x)}{f(x)}\,dx = \ln|f(x)| + C, with u = f(x). For example \displaystyle\int\frac{x}{x^2+1}\,dx = \frac12\ln(x^2+1) + C, and
\int\tan x\,dx = \int\frac{\sin x}{\cos x}\,dx = -\ln|\cos x| + C = \ln|\sec x| + C .
\displaystyle\int x\sqrt{x+1}\,dx: with u = x + 1, x = u - 1 and du = dx:
The substitution x = -u also proves the symmetry facts from Module 14: if f is odd, \int_{-a}^0 f(x)\,dx = \int_a^0f(-u)(-du) = -\int_0^af(u)\,du, so \int_{-a}^af = 0.
Substituting for x
Sometimes it helps to substitute in the other direction, x = g(t) with g invertible, so that dx = g'(t)\,dt. For \sqrt{a^2 - x^2} the substitution x = a\sin\theta with \theta\in[-\frac\pi2,\frac\pi2] gives \sqrt{a^2 - x^2} = a\cos\theta (non-negative on that interval). In IB exams this kind of substitution is usually given to you; at university you will be expected to find it.
Example 16.4The area of a quarter circle
With x = \sin\theta, dx = \cos\theta\,d\theta, and the limits x = 0, 1 become \theta = 0, \frac\pi2:
using the identity for \cos^2 below. A quarter of a unit disc has area \frac\pi4, as it must.
16.2Trigonometric integrals
Even powers: use the double-angle identities \sin^2x = \frac{1 - \cos2x}{2} and \cos^2 x = \frac{1 + \cos 2x}{2}:
\int\sin^2x\,dx = \frac x2 - \frac{\sin 2x}{4} + C, \qquad \int\cos^2x\,dx = \frac x2 + \frac{\sin2x}{4} + C .
Odd powers: keep one factor for du and convert the rest with \sin^2 + \cos^2 = 1:
\int\sin^3x\,dx = \int(1 - \cos^2x)\sin x\,dx = -\cos x + \frac{\cos^3 x}{3} + C \qquad (u = \cos x).
Squares of tan and sec:\int\tan^2x\,dx = \int(\sec^2 x - 1)\,dx = \tan x - x + C.
Secant: multiplying top and bottom by \sec x + \tan x makes the numerator the derivative of the denominator:
\int\sec x\,dx = \int\frac{\sec^2 x + \sec x\tan x}{\sec x + \tan x}\,dx = \ln|\sec x + \tan x| + C .
Beyond IBOrthogonality of sines
The product-to-sum identity \sin mx\sin nx = \frac12\big(\cos(m-n)x - \cos(m+n)x\big) shows that \int_0^{2\pi}\sin mx\sin nx\,dx = 0 for distinct positive integers m and n. This “orthogonality” is the foundation of Fourier series, which decompose a signal into pure frequencies. You will use them in physics at NTNU for waves, heat flow and quantum mechanics.
16.3Completing the square
A quadratic under a root or in a denominator can be turned into one of the two standard forms of Module 15 by completing the square:
In Leibniz notation, \int u\,dv = uv - \int v\,du. delvis integrasjon
Proof. The product rule says (uv)' = u'v + uv', so uv is an antiderivative of u'v + uv'. Rearranging, \int uv' = uv - \int u'v. The definite version follows from the FTC. ∎
The aim is to trade \int uv' for an easier \int u'v. So choose u to be a factor that gets simpler when differentiated, and v' a factor you can integrate. A useful order of preference for u is L–I–A–T–E: Logarithms, Inverse trig functions, Algebraic (powers of x), Trigonometric, Exponentials.
Example 16.6Three classics
\displaystyle\int xe^x\,dx: u = x, v' = e^x. Then xe^x - \int e^x\,dx = (x - 1)e^x + C.
\displaystyle\int\ln x\,dx: there seems to be only one factor, so take u = \ln x and v' = 1. Then x\ln x - \int x\cdot\frac1x\,dx = x\ln x - x + C.
\displaystyle\int\arctan x\,dx: u = \arctan x, v' = 1. Then x\arctan x - \int\frac{x}{1+x^2}\,dx = x\arctan x - \frac12\ln(1+x^2) + C.
Example 16.7Repeated integration by parts (AHL 5.16)
Each application lowers the power of x by one:
\int x^2\sin x\,dx = -x^2\cos x + \int 2x\cos x\,dx = -x^2\cos x + 2x\sin x - \int2\sin x\,dx = -x^2\cos x + 2x\sin x + 2\cos x + C .
Example 16.8Going round in a circle, usefully
Let I = \int e^x\sin x\,dx. Two integrations by parts, both with u the trigonometric factor, give
I = e^x\sin x - \int e^x\cos x\,dx = e^x\sin x - e^x\cos x - \int e^x\sin x\,dx = e^x(\sin x - \cos x) - I .
The original integral reappears, and we can solve for it: I = \frac{e^x}{2}(\sin x - \cos x) + C.
16.5Partial fractions
A rational function \frac{P(x)}{Q(x)} can always be integrated, once it is split into simple pieces.
If \deg P \ge \deg Q, divide first, leaving a polynomial plus a fraction whose numerator has smaller degree.
Factor the denominator.
Write the fraction as a sum of simple fractions, one for each factor, and find the constants.
Example 16.9Distinct linear factors (AHL 1.11 and 5.15)
Write \dfrac{3x + 5}{(x-1)(x+3)} = \dfrac{A}{x - 1} + \dfrac{B}{x+3}. Multiplying out: 3x + 5 = A(x+3) + B(x-1). Put x = 1: 8 = 4A, so A = 2. Put x = -3: -4 = -4B, so B = 1. Hence
\int\frac{3x+5}{(x-1)(x+3)}\,dx = 2\ln|x - 1| + \ln|x+3| + C .
The quick version (“cover-up”): to find A, cover the factor (x - 1) in the original fraction and evaluate what is left at x = 1: \frac{3 + 5}{1 + 3} = 2.
Example 16.10Divide first
\dfrac{x^2 + 1}{x^2 - 1} = 1 + \dfrac{2}{x^2-1} = 1 + \dfrac{1}{x - 1} - \dfrac1{x+1}, so \displaystyle\int\frac{x^2+1}{x^2-1}\,dx = x + \ln\left|\frac{x-1}{x+1}\right| + C.
Beyond IBWhy every rational function can be integrated
The IB only uses distinct linear factors. In general, every real polynomial factors into linear factors and irreducible quadratic factors (a consequence of the fundamental theorem of algebra). A repeated factor (x - a)^2 contributes \frac{A}{x-a} + \frac{B}{(x-a)^2}, and an irreducible quadratic x^2 + px + q contributes \frac{Bx + C}{x^2 + px + q}, which completing the square turns into a logarithm plus an arctangent. For example
So the antiderivative of every rational function is built from rational functions, logarithms and arctangents. All of this is standard in the first semester at NTNU.
16.6A strategy
Simplify. Expand, cancel, split fractions, use an identity. Many integrals become table integrals.
Is it in the table, possibly with ax + b in place of x?
Is there an inner function whose derivative is also present? Substitute. This includes \frac{f'}{f}.
Is it a product of two different kinds of function (a power times an exponential, a logarithm, an inverse trigonometric function)? Integrate by parts.
Is it a rational function? Divide if necessary, then partial fractions.
Powers of trigonometric functions? Double-angle identities for even powers, save a factor for odd powers.
\sqrt{a^2 - x^2}? Try x = a\sin\theta. A quadratic? Complete the square.
And always check an answer by differentiating it.
16.7Not every integral can be done
Some innocent-looking integrands have no elementary antiderivative at all:
This is not a failure of ingenuity. Joseph Liouville proved in the 1830s that no combination of elementary functions differentiates to these. They still have antiderivatives (by FTC part 1, every continuous function does), and those antiderivatives are perfectly good functions that are computed numerically (Module 14) or by series (Module 19). The normal distribution of statistics, built on \int e^{-x^2/2}\,dx, is the most important example.
Key results
Substitution: \int f(g(x))g'(x)\,dx = \int f(u)\,du; in definite integrals, change the limits.
Parts: \int uv' = uv - \int u'v; choose u by L–I–A–T–E; repeat or go round in a circle if needed.
Partial fractions: divide if needed, factor, split, integrate to logarithms (and arctangents).
Trigonometric powers: double-angle identities, or save a factor. Quadratics: complete the square.
Some integrals have no elementary answer.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
(a) u = x^3 + 1: \frac{(x^3+1)^6}{18} + C. (b) u = \sqrt x: 2e^{\sqrt x} + C. (c) u = \ln x: \frac{(\ln x)^2}{2} + C. (d) u = \cos x: -\frac{\cos^4x}{4} + C. (e) u = \ln x: \ln|\ln x| + C. (f) u = \tan x: \frac{\tan^4x}{4} + C.
(g) u = x^2: \frac12\int_0^1e^{-u}du = \frac12(1 - e^{-1}). (h) u = 1 + \sin x: \int_1^2\frac{du}{u} = \ln 2. (i) u = e^x: \int\frac{du}{1 + u^2} = \arctan(e^x) + C.
(a) (x+1)^2 + 4: \frac12\arctan\frac{x+1}{2} + C. (b) 9 - (x - 1)^2: \arcsin\frac{x - 1}{3} + C.
16.6Understanding
Use x = 2\sin\theta to evaluate \int_0^2\sqrt{4 - x^2}\,dx and to find \int\frac{x^2}{\sqrt{4 - x^2}}dx.
Solution
dx = 2\cos\theta\,d\theta and \sqrt{4 - x^2} = 2\cos\theta. First: \int_0^{\pi/2}4\cos^2\theta\,d\theta = 4\cdot\frac\pi4 = \pi, a quarter of a disc of radius 2.
Second: \int\frac{4\sin^2\theta\cdot2\cos\theta}{2\cos\theta}d\theta = \int4\sin^2\theta\,d\theta = 2\theta - \sin2\theta + C = 2\theta - 2\sin\theta\cos\theta + C. Back in x: \sin\theta = \frac x2, \cos\theta = \frac{\sqrt{4-x^2}}2, so the answer is 2\arcsin\frac x2 - \frac x2\sqrt{4-x^2} + C.
16.7Understanding
Verify \int\sec x\,dx = \ln|\sec x + \tan x| + C by differentiating, and explain how the trick in the text was found.
Solution
\frac{d}{dx}\ln|\sec x + \tan x| = \frac{\sec x\tan x + \sec^2 x}{\sec x + \tan x} = \frac{\sec x(\tan x + \sec x)}{\sec x + \tan x} = \sec x. The trick: the derivatives of \sec x and \tan x are \sec x\tan x and \sec^2 x, and their sum is \sec x times (\sec x + \tan x). So multiplying \sec x by \frac{\sec x + \tan x}{\sec x + \tan x} produces a fraction of the form \frac{f'}{f}.
16.8Understanding
Let I_n = \int_0^{\pi/2}\sin^nx\,dx. Use integration by parts to show I_n = \frac{n-1}{n}I_{n-2} for n \ge 2, and evaluate I_4 and I_5.
Solution
Write \sin^nx = \sin^{n-1}x\cdot\sin x with u = \sin^{n-1}x and v' = \sin x. Then
Write \frac{2x^2+3}{x(x-1)^2} = \frac Ax + \frac{B}{x-1} + \frac{C}{(x-1)^2}, i.e. 2x^2 + 3 = A(x-1)^2 + Bx(x-1) + Cx. At x = 0: A = 3. At x = 1: C = 5. Comparing x^2 coefficients: 2 = A + B, so B = -1. The integral is 3\ln|x| - \ln|x - 1| - \frac{5}{x - 1} + C.
\frac{x+3}{x(x^2+1)} = \frac Ax + \frac{Bx + C}{x^2+1}, so x + 3 = A(x^2+1) + (Bx + C)x. At x = 0: A = 3. Coefficients of x^2: 0 = A + B, so B = -3. Coefficients of x: C = 1. The integral is 3\ln|x| - \frac32\ln(x^2+1) + \arctan x + C.
16.11Understanding
Prove with the substitution x = -u that \int_{-a}^af = 2\int_0^af for continuous even f. Evaluate \int_{-1}^1(x^5\cos x + 3x^2)\,dx.
Solution
\int_{-a}^0f(x)\,dx = \int_a^0f(-u)(-du) = \int_0^af(u)\,du when f is even, so \int_{-a}^a f = 2\int_0^af. In the example x^5\cos x is odd (integral 0) and 3x^2 is even, so the answer is 2\int_0^13x^2dx = 2.
16.12Challenge
Use the substitution x = \frac\pi2 - u to show \int_0^{\pi/2}\frac{\sin x}{\sin x + \cos x}dx = \frac\pi4. Then use x = \pi - u to show \int_0^\pi\frac{x\sin x}{1 + \cos^2x}dx = \frac{\pi^2}{4}.
Solution
Call the first integral I. The substitution swaps \sin and \cos, so I = \int_0^{\pi/2}\frac{\cos u}{\cos u + \sin u}du. Adding the two forms, 2I = \int_0^{\pi/2}1\,dx = \frac\pi2.
For the second, call it J. With x = \pi - u, \sin x = \sin u and \cos^2 x = \cos^2u, so J = \int_0^\pi\frac{(\pi - u)\sin u}{1 + \cos^2u}du = \pi\int_0^\pi\frac{\sin u}{1 + \cos^2u}du - J. The remaining integral, with w = \cos u, is \int_{-1}^1\frac{dw}{1 + w^2} = \frac\pi2. So 2J = \frac{\pi^2}{2} and J = \frac{\pi^2}4. Neither integrand has an antiderivative you could find easily; symmetry does the work.
16.13Challenge
Use x = \tan\theta to find \displaystyle\int\frac{dx}{(1+x^2)^2}.
Solution
dx = \sec^2\theta\,d\theta and 1 + x^2 = \sec^2\theta, so the integral is \int\cos^2\theta\,d\theta = \frac\theta2 + \frac{\sin2\theta}{4} + C. Now \sin 2\theta = 2\sin\theta\cos\theta = \frac{2x}{1 + x^2}, so the answer is \frac12\arctan x + \frac{x}{2(1+x^2)} + C. Differentiate to check.
16.14Challenge
(The Wallis product.) Using Exercise 16.8, show that I_{2n+1} \le I_{2n} \le I_{2n-1} and \frac{I_{2n-1}}{I_{2n+1}} \to 1. Deduce that \frac{I_{2n}}{I_{2n+1}} \to 1 and hence
On [0,\frac\pi2], 0 \le \sin x \le 1, so \sin^{2n+1}x \le \sin^{2n}x \le \sin^{2n-1}x, and integrating preserves this. The reduction formula gives \frac{I_{2n-1}}{I_{2n+1}} = \frac{2n+1}{2n} \to 1. Dividing the sandwich by I_{2n+1}: 1 \le \frac{I_{2n}}{I_{2n+1}} \le \frac{2n+1}{2n}, so the ratio tends to 1.
Iterating the reduction formula: I_{2n} = \frac\pi2\prod_{k=1}^n\frac{2k-1}{2k} and I_{2n+1} = \prod_{k=1}^n\frac{2k}{2k+1}. So \frac{I_{2n}}{I_{2n+1}} = \frac\pi2\prod_{k=1}^n\frac{(2k-1)(2k+1)}{(2k)^2} \to 1, which rearranges to the stated product. (Wallis found it in 1656; it is one of the first exact formulas for \pi as a limit.)
Part III · The integral · Module 17
Areas, volumes and motion
Areal, volum og bevegelse
Big questionHow does “slice, approximate, add up, take a limit” become formulas for real quantities?
The integral was defined as a limit of sums of thin rectangles. The same idea, slicing a quantity into thin pieces, approximating each piece, adding up and taking a limit, turns into formulas for areas between curves, volumes of solids, distances travelled, lengths of curves and the work done by forces. Learning to set up these integrals yourself, rather than recalling formulas, is the most useful skill for physics at NTNU.
17.1The slicing principle
Theorem 17.1Slice, approximate, add, take the limit
Suppose a quantity Q built over an interval [a,b] is the sum of its pieces over the subintervals of any partition, and the piece over [x, x + \Delta x] is q(x)\,\Delta x up to an error that is small even compared with \Delta x. If q is continuous, then
Q = \int_a^b q(x)\,dx .
The reason: Q equals the sum of its pieces, which is a Riemann sum for \int q plus a total error. If each error is at most \eps\,\Delta x_k, the total error is at most \eps(b-a), which tends to 0 as the partition gets finer. In practice we write the piece as dQ = q(x)\,dx and integrate. This is exactly how physicists set up integrals, and with this principle behind it, it is rigorous.
17.2Area between curves
If f(x) \ge g(x) on [a,b], a thin vertical strip at x has height f(x) - g(x) and width dx, so
A = \int_a^b\big(f(x) - g(x)\big)\,dx .
If the curves cross, the area is \int_a^b|f(x) - g(x)|\,dx: split the interval at the intersection points and subtract in the right order on each piece (SL 5.11).
The region between y = 2x and y = x^2. A vertical strip at x has height 2x - x^2.
Example 17.2Between a line and a parabola
y = 2x and y = x^2 meet where x^2 = 2x, at x = 0 and x = 2, and the line is above in between:
Sometimes horizontal strips are simpler. A region between the curves x = g(y) and x = h(y) with g \le h, for c \le y \le d, has area \int_c^d\big(h(y) - g(y)\big)\,dy. In particular, the area between a curve x = g(y) \ge 0 and the y-axis is \int_c^d g(y)\,dy (AHL 5.17).
Example 17.3Slicing horizontally
The region between the parabola x = y^2 and the line x = y + 2: they meet where y^2 = y + 2, at y = -1 and y = 2, and the line is to the right. With horizontal strips,
With vertical strips the lower boundary changes formula at x = 1, and you would need two integrals.
17.3Volumes of revolution
Rotate the region under y = f(x) \ge 0, a \le x \le b, about the x-axis. Slice the solid perpendicular to the axis. The slice at x is a thin disc of radius f(x) and thickness dx, so its volume is dV = \pi f(x)^2\,dx, and
V = \pi\int_a^bf(x)^2\,dx .
Example 17.4The volume of a ball, from first principles
A ball of radius r is the solid of revolution of y = \sqrt{r^2 - x^2}, -r \le x \le r:
The formula you have used since primary school, in two lines. Archimedes asked for a sphere inside a cylinder to be carved on his tomb, because he regarded this result as his finest.
Example 17.5A cone
The line y = \frac rhx, 0 \le x \le h, sweeps out a cone of base radius r and height h: \ V = \pi\frac{r^2}{h^2}\int_0^hx^2\,dx = \frac13\pi r^2h.
Washers. If the region lies between y = f(x) and y = g(x) with f \ge g \ge 0, each slice is a disc with a hole, of area \pi f^2 - \pi g^2:
V = \pi\int_a^b\big(f(x)^2 - g(x)^2\big)\,dx .
PitfallSquare first, then subtract
The washer area is \pi(f^2 - g^2), not \pi(f - g)^2. For the region between y = x and y = x^2 on [0,1] rotated about the x-axis, V = \pi\int_0^1(x^2 - x^4)\,dx = \pi\left(\frac13 - \frac15\right) = \frac{2\pi}{15}.
About the y-axis (AHL 5.17). If the region is bounded by the y-axis and a curve x = g(y) \ge 0 for c \le y \le d, horizontal slices are discs of radius g(y):
V = \pi\int_c^d g(y)^2\,dy .
Example 17.6A paraboloid
Rotate the part of y = x^2 with 0 \le y \le 4 about the y-axis. Here x^2 = y, so V = \pi\int_0^4y\,dy = 8\pi. That is exactly half the volume of the cylinder of radius 2 and height 4 that encloses it, another result Archimedes knew.
Beyond IBShells and cross-sections
Shells. Rotating the region under y = f(x), 0 \le a \le x \le b, about the y-axis can also be sliced into thin cylindrical shells. The shell at radius x has height f(x) and thickness dx; unrolled, it is nearly a flat sheet of area 2\pi x f(x), so V = 2\pi\int_a^bxf(x)\,dx. This avoids solving for x in terms of y.
Any cross-section. More generally, if a solid’s cross-section at position x has area A(x), then V = \int_a^bA(x)\,dx (Cavalieri’s principle). A pyramid of height h with a square base of side s has cross-sections of side \frac{sx}{h} at distance x from the apex, so V = \int_0^h\frac{s^2x^2}{h^2}\,dx = \frac13s^2h.
17.4Displacement and distance
If v(t) = s'(t) is velocity, then by the FTC the displacement over [t_1, t_2] is
s(t_2) - s(t_1) = \int_{t_1}^{t_2}v(t)\,dt,
and the total distance travelled is \int_{t_1}^{t_2}|v(t)|\,dt (SL 5.9). Displacement can be zero after a long journey; distance cannot. In the same way, velocity is recovered from acceleration: v(t) = v(0) + \int_0^ta(\tau)\,d\tau.
Example 17.7Displacement versus distance
v(t) = 2t - 4 m/s for 0 \le t \le 5. Displacement: \int_0^5(2t - 4)\,dt = \left[t^2 - 4t\right]_0^5 = 5 m. The velocity changes sign at t = 2, so the distance is
If a(t) = g is constant, then v(t) = v_0 + gt and s(t) = s_0 + v_0t + \frac12gt^2. The “suvat” equations of school physics are two integrations.
17.5Beyond IB: length, surface area and work
Beyond IBArc length and surface area
A small piece of the curve y = f(x) over [x, x + \Delta x] is nearly a straight segment with horizontal run \Delta x and rise \Delta y \approx f'(x)\Delta x, so its length is about \sqrt{1 + f'(x)^2}\,\Delta x. Hence the arc length is
L = \int_a^b\sqrt{1 + f'(x)^2}\,dx .
For y = \frac23x^{3/2} on [0, 3]: f'(x) = \sqrt x and L = \int_0^3\sqrt{1 + x}\,dx = \frac23\left(4^{3/2} - 1\right) = \frac{14}{3}. Rotating the curve about the x-axis, each piece sweeps out a thin band of area about 2\pi f(x)\cdot\sqrt{1 + f'(x)^2}\,\Delta x, giving the surface area of revolutionS = 2\pi\int_a^bf(x)\sqrt{1 + f'(x)^2}\,dx. Both are on the NTNU syllabus.
Beyond IBWork
A constant force F moving an object a distance d does work Fd. If the force varies with position, the work over a small step is about F(x)\,dx, so W = \int_a^bF(x)\,dx. For a spring with F = kx (Hooke’s law), stretching it from 0 to x takes W = \int_0^xkt\,dt = \frac12kx^2: the elastic potential energy of mechanics.
17.6Beyond IB: improper integrals
So far integrals have been over bounded intervals of bounded functions. Both restrictions can be relaxed by taking one more limit.
Definition 17.9Improper integrals
\displaystyle\int_a^\infty f(x)\,dx = \lim_{R\to\infty}\int_a^Rf(x)\,dx, and if f is unbounded near a, \ \displaystyle\int_a^bf(x)\,dx = \lim_{\eps\to0^+}\int_{a+\eps}^bf(x)\,dx. The integral converges if the limit exists, and diverges otherwise. uegentlig integral
Theorem 17.10p-integrals
\displaystyle\int_1^\infty\frac{dx}{x^p} converges exactly when p > 1, with value \frac{1}{p-1}. \ \displaystyle\int_0^1\frac{dx}{x^p} converges exactly when p < 1, with value \frac1{1-p}.
Proof. For p \ne 1: \int_1^R x^{-p}dx = \frac{R^{1-p} - 1}{1 - p}, which has a limit as R \to\infty exactly when 1 - p < 0. For p = 1: \int_1^R\frac{dx}x = \ln R \to \infty. The second statement is the same computation on [\eps, 1] with \eps \to 0^+. ∎
Other examples: \int_0^\infty e^{-x}\,dx = \lim_{R\to\infty}(1 - e^{-R}) = 1, and \int_{-\infty}^\infty\frac{dx}{1+x^2} = \frac\pi2 - \left(-\frac\pi2\right) = \pi. As for series, if 0 \le f \le g and \int g converges, so does \int f: for example \int_1^\infty e^{-x^2}dx converges because e^{-x^2} \le e^{-x} for x \ge 1. (Its relative \int_{-\infty}^\infty e^{-x^2}dx = \sqrt\pi is computed with double integrals in your second semester.) Comparing sums with integrals also gives the integral test: \sum\frac{1}{k^p} converges exactly when p > 1.
Example 17.11Gabriel’s horn
Rotate y = \frac1x, x \ge 1, about the x-axis. The volume is \pi\int_1^\infty\frac{dx}{x^2} = \pi, finite. But the surface area is 2\pi\int_1^\infty\frac1x\sqrt{1 + \frac{1}{x^4}}\,dx \ge 2\pi\int_1^\infty\frac{dx}{x} = \infty. You could fill the horn with \pi litres of paint but never paint its inside. (The paradox dissolves once you remember that paint has thickness.) Choose “y = 1/x” in the disc graph above to see the start of the horn.
Key results
Set up integrals by slicing: dQ = q(x)\,dx, then Q = \int q.
Area between curves: \int(\text{top} - \text{bottom})\,dx or \int(\text{right} - \text{left})\,dy; split where they cross.
Discs: \pi\int f^2\,dx; washers \pi\int(f^2 - g^2)\,dx; about the y-axis \pi\int g(y)^2\,dy.
Displacement \int v\,dt, distance \int|v|\,dt.
Improper integrals are limits; \int_1^\infty x^{-p}dx converges iff p > 1.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
17.1Fluency
Find the area enclosed by y = x^2 - 4 and y = 2 - x.
Solution
They meet where x^2 + x - 6 = 0, at x = -3 and x = 2, with the line on top: \int_{-3}^2(6 - x - x^2)\,dx = \left[6x - \frac{x^2}2 - \frac{x^3}3\right]_{-3}^2 = \frac{22}3 + \frac{27}{2} = \frac{125}{6}.
17.2Fluency
Find the area between y = \sin x and y = \cos x for 0 \le x \le \pi.
Solution
They cross at x = \frac\pi4. \int_0^{\pi/4}(\cos x - \sin x)\,dx + \int_{\pi/4}^\pi(\sin x - \cos x)\,dx = (\sqrt2 - 1) + (1 + \sqrt2) = 2\sqrt2.
17.3Fluency
Find the area of the region bounded by y = \ln x, the y-axis, and the lines y = 0 and y = 1.
Solution
With horizontal strips, x = e^y, so the area is \int_0^1e^y\,dy = e - 1.
17.4Fluency
The region under y = \sqrt x, 0 \le x \le 4, is rotated about the x-axis. Find the volume. Then find the volume when the region between y = \sqrt x, the y-axis and y = 2 is rotated about the y-axis.
Solution
About the x-axis: \pi\int_0^4x\,dx = 8\pi. About the y-axis: x = y^2, so \pi\int_0^2y^4\,dy = \frac{32\pi}{5}.
17.5Fluency
The region between y = x^2 and y = 2x is rotated about the x-axis. Find the volume.
Solution
Washers with outer radius 2x and inner radius x^2: \pi\int_0^2(4x^2 - x^4)\,dx = \pi\left(\frac{32}3 - \frac{32}5\right) = \frac{64\pi}{15}.
17.6Fluency
A particle has velocity v(t) = t^2 - 4t + 3 m/s for 0 \le t \le 4. Find its displacement and the total distance it travels.
Solution
An antiderivative is F(t) = \frac{t^3}3 - 2t^2 + 3t, with F(0) = 0, F(1) = \frac43, F(3) = 0, F(4) = \frac43. Displacement = F(4) - F(0) = \frac43 m. The velocity changes sign at t = 1 and t = 3, so the distance is \frac43 + \frac43 + \frac43 = 4 m.
17.7Understanding
Derive the volume of a frustum (a cone with its top cut off) with end radii r and R and height h: V = \frac{\pi h}{3}\left(R^2 + Rr + r^2\right).
Solution
Rotate y = r + \frac{R - r}{h}x, 0 \le x \le h. With u = r + \frac{R-r}hx (if R \ne r), dx = \frac{h}{R - r}du and
(If R = r it is a cylinder, and the formula gives \pi r^2h.)
17.8Understanding
A hemispherical bowl of radius 10 cm holds water to depth h. Show that the volume of water is V = \pi h^2\left(10 - \frac h3\right). If water leaks out at 2 cm³/s, how fast is the depth falling when h = 5?
Solution
Put the bowl’s bottom at y = 0 and its centre at y = 10. The horizontal slice at height y is a disc of radius \sqrt{100 - (10 - y)^2} = \sqrt{20y - y^2}, so V = \pi\int_0^h(20y - y^2)\,dy = \pi\left(10h^2 - \frac{h^3}3\right).
By the FTC, \frac{dV}{dh} = \pi(20h - h^2), which is 75\pi at h = 5. So \dot h = \frac{\dot V}{75\pi} = -\frac{2}{75\pi} \approx -0.0085 cm/s. (This is a related-rates problem where the relation itself comes from an integral.)
17.9Understanding
Show that the region under y = \frac1x for x \ge 1 has infinite area, but that the solid formed by rotating it about the x-axis has finite volume.
Solution
Area: \int_1^R\frac{dx}x = \ln R \to \infty. Volume: \pi\int_1^R\frac{dx}{x^2} = \pi\left(1 - \frac1R\right) \to \pi. Squaring makes the integrand decay fast enough (p = 2 > 1).
17.10Understanding
For which p does \int_0^\infty\frac{dx}{x^p} converge? Evaluate \int_0^1\ln x\,dx as an improper integral.
Solution
Never: the piece on [1,\infty) needs p > 1 and the piece on (0,1] needs p < 1.
(Shell method.) Derive V = 2\pi\int_a^bxf(x)\,dx for rotating the region under y = f(x), 0 \le a \le x \le b, about the y-axis, and use it to find the volume when the region under y = x - x^2 (0 \le x \le 1) is rotated about the y-axis.
Solution
The strip over [x, x + \Delta x] sweeps out a thin cylindrical shell. Its volume is \pi\big((x + \Delta x)^2 - x^2\big)f(c) = \pi(2x + \Delta x)\Delta x\,f(c) for some c in the strip, which is 2\pi xf(x)\Delta x up to an error small compared with \Delta x. The slicing principle gives the formula.
V = 2\pi\int_0^1x(x - x^2)\,dx = 2\pi\left(\frac13 - \frac14\right) = \frac\pi6. (With discs you would have to solve y = x - x^2 for x, giving two branches.)
17.12Challenge
Find the arc length of y = \cosh x from x = 0 to x = 1, and of y = \frac23x^{3/2} from 0 to 3.
Solution
For \cosh: 1 + \sinh^2x = \cosh^2x, so L = \int_0^1\cosh x\,dx = \sinh 1 \approx 1.175. (A hanging chain is one of the few curves whose length integral is easy.) For \frac23x^{3/2}: \frac{14}{3}, as in the text.
17.13Challenge
A cylindrical tank of radius 1 m and height 3 m is full of water (density 1000 kg/m³). How much work is needed to pump all the water out over the top? Use g = 9.81 m/s².
Solution
The thin layer at height y has volume \pi\,dy and mass 1000\pi\,dy, and must be lifted 3 - y metres. So W = \int_0^31000\cdot9.81\cdot\pi(3 - y)\,dy = 9810\pi\cdot\frac92 \approx 1.39\times10^5 J. (Equivalently: the whole mass lifted from the centre of mass at 1.5 m to the top.)
Part IV · Differential equations · Module 18
First-order differential equations
Differensiallikninger av første orden
Big questionMany laws of nature say how a quantity changes, not what it is. How do we recover the quantity?
Many laws of nature do not say what a quantity is, but how it changes: the rate of radioactive decay is proportional to the amount present; a cooling cup loses heat in proportion to its excess temperature; force equals mass times the rate of change of velocity. An equation involving an unknown function and its derivatives is a differential equation. This module covers the first-order equations of AHL 5.18: what solutions are, how to approximate them numerically, and the three classes that can be solved exactly.
18.1What a differential equation is
Definition 18.1Differential equation, solution, initial value problem
A first-order differential equation has the form \frac{dy}{dx} = f(x, y). A solution on an interval I is a differentiable function y(x) with y'(x) = f(x, y(x)) for every x \in I. An initial value problem adds a condition y(x_0) = y_0. differensiallikninginitialverdiproblem
A first-order equation typically has a one-parameter family of solutions, the general solution; an initial condition picks out one particular solution. You can always check a proposed solution by substituting it, and you should.
Example 18.2Checking a solution
Is y = Ce^{-x} + x - 1 a solution of y' + y = x? We have y' = -Ce^{-x} + 1, so y' + y = -Ce^{-x} + 1 + Ce^{-x} + x - 1 = x. Yes, for every constant C. The initial condition y(0) = 2 forces C - 1 = 2, so C = 3.
Some models you will meet constantly:
Model
Equation
Read as
Growth or decay
y' = ky
rate proportional to amount
Newton’s law of cooling
T' = -k(T - T_{\text{env}})
rate proportional to temperature excess
Logistic growth
P' = rP\left(1 - \frac PK\right)
growth that slows near a capacity K
Falling with air resistance
mv' = mg - kv
Newton’s second law with drag
18.2Slope fields
The equation y' = f(x,y) assigns a slope to every point of the plane. Drawing a short segment with that slope at many points gives a slope field. A solution curve must be tangent to the field everywhere it goes, so you can sketch solutions by following the segments, before solving anything.
Taken on trustExistence and uniqueness
If f and \frac{\partial f}{\partial y} (the derivative of f with respect to y, holding x fixed) are continuous near (x_0,y_0), the initial value problem y' = f(x,y), y(x_0) = y_0 has exactly one solution near x_0. This is the Picard–Lindelöf theorem; existence and uniqueness of solutions is on the NTNU first-semester syllabus. Geometrically it says that solution curves never cross. Without the hypothesis, uniqueness can fail (Exercise 18.8).
18.3Euler’s method
Most differential equations cannot be solved by formula, so we approximate. The tangent-line approximation of Module 6 says y(x + h) \approx y(x) + h\,y'(x), and the equation tells us y'(x) = f(x, y). Stepping forward repeatedly gives Euler’s method (AHL 5.18): starting from (x_0, y_0), with step size h,
So y(0.3) \approx 1.362. The exact solution (found below) is y = 2e^x - x - 1, with y(0.3) = 1.39972\ldots, so the error is about 0.038. With h = 0.05 (six steps) the estimate is 1.38019, with error 0.0195: halving h roughly halves the error.
That last observation is general: Euler’s method is a first-order method, with error at a fixed x roughly proportional to h. (Each step makes an error of order h^2, from the curvature of the solution, and there are about \frac1h steps.) Its errors also have a visible direction: when the solution curve is concave up, every tangent line lies below the curve, so Euler underestimates. Try it in the graph above. In your first semester at NTNU you will analyse such errors properly, meet higher-order methods such as Runge–Kutta (used for the “accurate solution” in the graph), and see why some equations, called stiff, defeat Euler’s method unless h is tiny.
def euler(f, x, y, h, steps):
for _ in range(steps):
y = y + h * f(x, y)
x = x + h
return y
print(euler(lambda x, y: x + y, 0.0, 1.0, 0.1, 3)) # 1.362
18.4Separable equations
An equation is separable if it has the form \frac{dy}{dx} = g(x)\,h(y). The familiar recipe, “divide by h(y), multiply by dx and integrate both sides,” is really the substitution rule:
Theorem 18.4Solving separable equations
If y(x) solves y' = g(x)h(y) on an interval where h(y(x)) \ne 0, then
\int\frac{dy}{h(y)} = \int g(x)\,dx + C,
where the left side means an antiderivative of \frac1h evaluated at y = y(x). separabel
Proof. Divide the equation by h(y(x)): \frac{y'(x)}{h(y(x))} = g(x). Both sides are functions of x, so their antiderivatives differ by a constant. By the substitution rule with u = y(x), an antiderivative of the left side is H(y(x)), where H is an antiderivative of \frac1h. ∎
PitfallDo not lose the constant solutions
Dividing by h(y) assumes h(y) \ne 0. If h(c) = 0, the constant function y = c is a solution, and it may not be in your general formula. For y' = y^2, the formula y = -\frac{1}{x + C} misses the solution y = 0.
Example 18.5Exponential growth, again
y' = ky: \int\frac{dy}{y} = \int k\,dx gives \ln|y| = kx + C, so |y| = e^Ce^{kx} and y = Ae^{kx} with A = \pm e^C. The constant solution y = 0 corresponds to A = 0. Module 10 proved there are no other solutions.
Example 18.6A solution that blows up
y' = xy^2, y(0) = 1: \ \int\frac{dy}{y^2} = \int x\,dx gives -\frac1y = \frac{x^2}{2} + C, and y(0) = 1 gives C = -1. So y = \dfrac{2}{2 - x^2}, which tends to infinity as x \to \sqrt2. A perfectly smooth equation can have a solution that ceases to exist in finite time. The solution of the initial value problem lives only on (-\sqrt2, \sqrt2).
Example 18.7Newton’s law of cooling
T' = -k(T - T_e) with T(0) = T_0. Separating, \int\frac{dT}{T - T_e} = -\int k\,dt, so \ln|T - T_e| = -kt + C and
T(t) = T_e + (T_0 - T_e)e^{-kt}.
The temperature approaches the surroundings exponentially, never quite reaching them.
Example 18.8The logistic equation
P' = rP\left(1 - \frac PK\right) with 0 < P_0 < K. Separating and using partial fractions (Module 16):
The population grows almost exponentially at first, then levels off at the carrying capacity K. Choose “y′ = y(1 − y)” in the graph above to see the S-shaped curve.
18.5Homogeneous equations: y = vx
An equation of the form \frac{dy}{dx} = f\!\left(\frac yx\right), where the right side depends only on the ratio \frac yx, is called homogeneous (AHL 5.18). The substitution y = vx, with v a new unknown function of x, makes it separable: y' = v + xv', so
Solve xy' = x + 2y for x > 0. Dividing by x: y' = 1 + 2\frac yx, so f(v) = 1 + 2v. Then v + xv' = 1 + 2v gives xv' = 1 + v, and
\int\frac{dv}{1+v} = \int\frac{dx}{x} \quad\Longrightarrow\quad \ln|1 + v| = \ln x + C \quad\Longrightarrow\quad 1 + v = Ax .
Since v = \frac yx: \ y = Ax^2 - x. Check: xy' = 2Ax^2 - x and x + 2y = 2Ax^2 - x. (This equation is also linear, and the next method gives the same answer.)
Example 18.10Another one
y' = \frac{x^2 + y^2}{xy} = \frac xy + \frac yx, so f(v) = \frac1v + v and xv' = \frac1v. Separating, \int v\,dv = \int\frac{dx}x, so \frac{v^2}2 = \ln|x| + C and y^2 = 2x^2\big(\ln|x| + C\big).
18.6Linear equations: the integrating factor
A first-order linear equation has the form
y' + P(x)\,y = Q(x).
The idea is to multiply by a function \mu(x) that turns the left side into the derivative of a product. By the product rule, (\mu y)' = \mu y' + \mu' y, which equals \mu(y' + Py) exactly when \mu' = P\mu. That is a separable equation for \mu, with solution
With \mu = e^{\int P\,dx}, the equation y' + Py = Q becomes (\mu y)' = \mu Q, so
y = \frac{1}{\mu(x)}\left(\int\mu(x)Q(x)\,dx + C\right).
integrerende faktor
Example 18.12Two linear equations
y' + 2y = e^{-x}: \mu = e^{2x}, so (e^{2x}y)' = e^{x}, giving e^{2x}y = e^x + C and y = e^{-x} + Ce^{-2x}.
xy' - 2y = x^3 for x > 0: first write it in standard form, y' - \frac2xy = x^2. Then \mu = e^{-2\ln x} = x^{-2}, so \left(\frac{y}{x^2}\right)' = 1, giving \frac{y}{x^2} = x + C and y = x^3 + Cx^2.
Notice the structure of the answers: a particular solution (e^{-x}, or x^3) plus C times a solution of the equation with Q = 0 (e^{-2x}, or x^2). Every linear equation has this structure, and it is the reason linear algebra and differential equations are taught together in your first semester at NTNU.
Example 18.13Terminal velocity
A body of mass m falling from rest with air resistance kv: v' + \frac kmv = g. Then \mu = e^{kt/m} and (e^{kt/m}v)' = ge^{kt/m}, so v = \frac{mg}{k} + Ce^{-kt/m}. With v(0) = 0:
The limit \frac{mg}{k} is the terminal velocity, where drag balances gravity. You can read it off the equation by setting v' = 0.
18.7Setting up models
Turning words into an equation is half the work. “The rate of change of A is proportional to B” means \frac{dA}{dt} = kB. In mixing problems, the rate of change of the amount of a substance is the rate in minus the rate out.
Example 18.14A mixing tank
A tank holds 100 L of brine containing 5 kg of salt. Pure water flows in at 2 L/min and the well-stirred mixture flows out at 2 L/min. The amount of salt S(t) in kg satisfies
(a) f(v) = 1 + v, so xv' = 1, v = \ln x + C and y = x\ln x + Cx.
(b) y' = \frac{1 + v^2}{2v}, so xv' = \frac{1 - v^2}{2v}. Separating: \int\frac{2v\,dv}{1 - v^2} = \int\frac{dx}{x}, so -\ln|1 - v^2| = \ln|x| + C and 1 - v^2 = \frac Ax, i.e. x^2 - y^2 = Ax. At (1,2): A = -3. So y = \sqrt{x^2 + 3x}. Check by differentiating.
18.6Understanding
A cup of coffee at 90°C is put in a 20°C room. After 10 minutes it is at 60°C. When will it reach 40°C?
Solution
T = 20 + 70e^{-kt}. From 60 = 20 + 70e^{-10k}: e^{-10k} = \frac47, so k = \frac{1}{10}\ln\frac74. For 40 = 20 + 70e^{-kt}: e^{-kt} = \frac27, so t = \frac{\ln(7/2)}{k} = 10\cdot\frac{\ln 3.5}{\ln 1.75} \approx 22.4 minutes.
18.7Understanding
Solve P' = 0.5P\left(1 - \frac{P}{1000}\right) with P(0) = 100. When is P = 500? Show that the population grows fastest when P = \frac K2.
Solution
By Example 18.8, P = \frac{1000}{1 + 9e^{-0.5t}}. P = 500 when 9e^{-0.5t} = 1, i.e. t = 2\ln 9 = 4\ln3 \approx 4.39. The growth rate P' = rP\left(1 - \frac PK\right) is a downward parabola in P with maximum at P = \frac K2. That is also where the S-curve has its inflexion point.
18.8Understanding
Show that the initial value problem y' = 3y^{2/3}, y(0) = 0 has infinitely many solutions. Which hypothesis of the existence and uniqueness theorem fails?
Solution
y = 0 is a solution, and so is y = x^3: 3(x^3)^{2/3} = 3x^2. More generally, for any a \ge 0, the function equal to 0 for x \le a and (x - a)^3 for x > a is differentiable and solves the problem. Here f(x,y) = 3y^{2/3} has \frac{\partial f}{\partial y} = 2y^{-1/3}, which is not continuous (not even defined) at y = 0.
18.9Understanding
A 200 L tank contains 10 kg of salt dissolved in water. Brine containing 0.1 kg/L enters at 4 L/min, and the mixture leaves at 4 L/min. Find the amount of salt S(t), and its long-term value.
Solution
In: 0.1\cdot4 = 0.4 kg/min. Out: \frac{S}{200}\cdot4 = \frac{S}{50} kg/min. So S' + \frac{S}{50} = 0.4, with solution S = 20 + Ce^{-t/50}. S(0) = 10 gives C = -10: S(t) = 20 - 10e^{-t/50} \to 20 kg, which is 0.1 kg/L times 200 L.
18.10Understanding
Apply Euler’s method to y' = y, y(0) = 1 with step h = \frac1n, and show that the estimate of y(1) is \left(1 + \frac1n\right)^n. What happens as n \to \infty?
Solution
Each step multiplies by 1 + h: y_{k+1} = y_k + hy_k = (1+h)y_k. After n steps y_n = (1 + \frac1n)^n, which tends to e = y(1). Euler’s method converges here, and the limit that defined e in Module 3 is exactly Euler’s method for the equation that characterises e^x (Modules 9 and 10).
18.11Challenge
(A Bernoulli equation.) Show that the substitution u = y^{1-n} turns y' + P(x)y = Q(x)y^n into a linear equation for u. Solve y' + y = xy^2.
Solution
u' = (1 - n)y^{-n}y'. Dividing the equation by y^n gives y^{-n}y' + Py^{1-n} = Q, i.e. \frac{u'}{1-n} + Pu = Q, which is linear.
For n = 2: u = \frac1y and -u' + u = x, i.e. u' - u = -x. With \mu = e^{-x}: (e^{-x}u)' = -xe^{-x}, so e^{-x}u = (x + 1)e^{-x} + C and u = x + 1 + Ce^x. Hence y = \frac{1}{x + 1 + Ce^x} (plus the solution y = 0).
18.12Challenge
For the falling body with drag, mv' = mg - kv, v(0) = 0, find the distance fallen s(t).
Solution
v(t) = \frac{mg}k\left(1 - e^{-kt/m}\right), so s(t) = \int_0^tv = \frac{mg}{k}t - \frac{m^2g}{k^2}\left(1 - e^{-kt/m}\right). For large t the body falls at nearly terminal velocity, s \approx \frac{mg}kt - \frac{m^2g}{k^2}; for small t, a Maclaurin expansion (Module 19) gives s \approx \frac12gt^2, free fall, as it should.
18.13Challenge
(Orthogonal trajectories.) Find the curves that cross every parabola y = Cx^2 at right angles.
Solution
For the parabolas, y' = 2Cx = \frac{2y}{x} (eliminating C). Perpendicular curves have slope -\frac{x}{2y}. Solving y' = -\frac{x}{2y}: \int2y\,dy = -\int x\,dx, so y^2 = -\frac{x^2}{2} + D, i.e. x^2 + 2y^2 = E: a family of ellipses. (In physics, field lines and equipotential curves are orthogonal trajectories of each other.)
Part V · Series · Module 19
Taylor polynomials and Maclaurin series
Taylorpolynomer og Maclaurin-rekker
Big questionCan a nice function be written as an infinite polynomial, and how good are the finite approximations?
The tangent line is the best linear approximation to a function near a point. Why stop at degree one? Matching more derivatives gives Taylor polynomials, which approximate a function as closely as we like near a point, with an error we can bound. Letting the degree go to infinity gives Taylor and Maclaurin series: functions written as infinite polynomials. This last module draws on almost everything before it: series (Module 3), the Mean Value Theorem (Module 10), L’Hôpital’s rule (Module 11), integration (Module 15) and differential equations (Module 18).
19.1Beyond the tangent line
The tangent line f(a) + f'(a)(x - a) matches the value and the slope of f at a. A quadratic f(a) + f'(a)(x - a) + c(x - a)^2 has second derivative 2c, so it also matches the curvature, f''(a), if c = \frac{f''(a)}{2}. Continuing:
Definition 19.1Taylor polynomial
If f is n times differentiable at a, its Taylor polynomial of degree n at a is
It is the only polynomial of degree at most n whose value and first n derivatives at a equal those of f. When a = 0 it is called a Maclaurin polynomial. Taylorpolynom
Why the factorials: differentiating (x - a)^k exactly k times gives the constant k!, while every other power of (x - a) has kth derivative 0 at x = a. So the coefficient c_k of (x-a)^k in T_n satisfies k!\,c_k = f^{(k)}(a).
Example 19.2The standard Maclaurin polynomials
e^x: every derivative at 0 is 1, so T_n(x) = 1 + x + \frac{x^2}{2!} + \cdots + \frac{x^n}{n!}.
\sin x: the derivatives at 0 cycle 0, 1, 0, -1, so only odd powers appear: x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots. Similarly \cos x gives 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots (only even powers, as cosine is even).
\ln(1+x): f^{(k)}(x) = \frac{(-1)^{k-1}(k-1)!}{(1+x)^k}, so f^{(k)}(0)/k! = \frac{(-1)^{k-1}}{k}, giving x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots.
(1+x)^p: f^{(k)}(0) = p(p-1)\cdots(p - k + 1), so the coefficients are the binomial coefficients\binom pk = \frac{p(p-1)\cdots(p-k+1)}{k!}, defined now for any real p. When p is a natural number they vanish for k > p and we recover the binomial theorem.
19.2Taylor’s theorem: how good is the approximation?
Theorem 19.3Taylor’s theorem with Lagrange remainder
Suppose f has n + 1 derivatives on an open interval containing a and x. Then
where the constant K is chosen so that g(a) = 0. Also g(x) = f(x) - f(x) - 0 = 0. By Rolle’s theorem g'(c) = 0 for some c strictly between a and x.
Now differentiate. For k \ge 1 the product rule gives \frac{d}{dt}\left[\frac{f^{(k)}(t)}{k!}(x-t)^k\right] = \frac{f^{(k+1)}(t)}{k!}(x - t)^k - \frac{f^{(k)}(t)}{(k-1)!}(x - t)^{k-1}. Summing over k = 0, \dots, n, the terms telescope and only \frac{f^{(n+1)}(t)}{n!}(x - t)^n survives. Therefore
Since x - c \ne 0, g'(c) = 0 gives K = f^{(n+1)}(c), and then g(a) = 0 is exactly the claimed formula. ∎
For n = 0 this is the Mean Value Theorem: f(x) = f(a) + f'(c)(x - a). Taylor’s theorem is its higher-order version. In practice we use it as an error bound: if |f^{(n+1)}| \le M between a and x, then
Example 19.4sin(0.1) and the small-angle approximation
For \sin the x^4 coefficient is 0, so T_3 = T_4 = x - \frac{x^3}{6}, and we may use the remainder R_4, with |\sin^{(5)}| \le 1. At x = 0.1: \sin 0.1 \approx 0.1 - \frac{0.001}{6} = 0.0998333\ldots, with error at most \frac{0.1^5}{5!} \approx 8.3\times10^{-8}.
The physicist’s small-angle approximation \sin\theta \approx \theta (the pendulum!) is T_1 = T_2, with error at most \frac{|\theta|^3}{6}. At \theta = 10° = 0.1745 rad that is 0.00089, half a percent of \sin\theta.
Example 19.5Computing e
With f = e^x, a = 0, x = 1: \ e = \sum_{k=0}^n\frac{1}{k!} + \frac{e^c}{(n+1)!} for some 0 < c < 1. Since e^c < 3, the error is less than \frac{3}{(n+1)!}. For n = 9 this is below \frac{3}{3\,628\,800} < 10^{-6}, so ten terms give e = 2.718282 to six decimals.
Taylor’s theorem also explains several things we observed earlier: the higher derivative test for extrema (Module 12), why Newton’s method doubles the number of correct digits (Module 13: the error after a step is \frac{f''(c)}{2f'(x_n)} times the square of the error before it), and why the symmetric difference quotient is so much more accurate than the one-sided one (Module 6: the h terms cancel, leaving an error proportional to h^2).
19.3Taylor and Maclaurin series
Definition 19.6Taylor series
If f has derivatives of every order at a, its Taylor series at a is \displaystyle\sum_{k=0}^\infty\frac{f^{(k)}(a)}{k!}(x-a)^k; at a = 0 it is the Maclaurin series. The series converges to f(x) exactly when R_n(x) \to 0 as n \to\infty. Taylorrekkepotensrekke
Theorem 19.7The standard Maclaurin series (AHL 5.19)
e^x = \sum_{k=0}^\infty\frac{x^k}{k!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots \qquad \text{for all } x,\sin x = \sum_{k=0}^\infty\frac{(-1)^kx^{2k+1}}{(2k+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots \qquad \text{for all } x,\cos x = \sum_{k=0}^\infty\frac{(-1)^kx^{2k}}{(2k)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots \qquad \text{for all } x,\ln(1 + x) = \sum_{k=1}^\infty\frac{(-1)^{k+1}x^k}{k} = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \qquad \text{for } -1 < x \le 1,(1 + x)^p = \sum_{k=0}^\infty\binom pkx^k = 1 + px + \frac{p(p-1)}{2!}x^2 + \cdots \qquad \text{for } -1 < x < 1.
Proof.e^x. Between 0 and x, |f^{(n+1)}| = e^c \le e^{|x|}, so |R_n(x)| \le e^{|x|}\frac{|x|^{n+1}}{(n+1)!} \to 0, because factorials beat powers (Theorem 3.15).
\sin and \cos. Every derivative is \pm\sin or \pm\cos, bounded by 1, so |R_n(x)| \le \frac{|x|^{n+1}}{(n+1)!} \to 0.
\ln(1+x). Integrate the identity \frac{1}{1+t} = \sum_{k=0}^{n-1}(-t)^k + \frac{(-t)^n}{1+t} from 0 to x (as in Exercise 15.11): the remainder is \pm\int_0^x\frac{t^n}{1+t}dt, which is at most \frac{x^{n+1}}{n+1} for 0 \le x \le 1 and at most \frac{|x|^{n+1}}{(n+1)(1 - |x|)} for -1 < x < 0. Both tend to 0.
(1+x)^p. See Exercise 19.14 for a proof through a differential equation. ∎
Where a power series \sum c_kx^k converges is decided by the ratio test (Module 3): if \left|\frac{c_{k+1}}{c_k}\right| \to L, the series converges for |x| < \frac1L and diverges for |x| > \frac1L. The number R = \frac1L is the radius of convergence. For e^x, \left|\frac{c_{k+1}}{c_k}\right| = \frac1{k+1} \to 0, so R = \infty; for \ln(1+x), \frac{k}{k+1} \to 1, so R = 1. At the endpoints x = \pm R the test says nothing and each case must be checked: the series for \ln(1 + x) converges at x = 1 (to \ln 2) but not at x = -1 (the harmonic series).
PitfallA smooth function with a short radius
\frac{1}{1 + x^2} is perfectly smooth on all of \R, yet its Maclaurin series 1 - x^2 + x^4 - \cdots converges only for |x| < 1. Nothing on the real line explains this. The reason is that \frac{1}{1+z^2} blows up at z = \pm i in the complex plane, at distance 1 from 0. You will see why in complex analysis at NTNU. Choose “1/(1 + x²)” in the graph above and watch the polynomials fail outside (-1, 1).
PitfallA Taylor series that converges to the wrong function
f(x) = e^{-1/x^2} (with f(0) = 0) has every derivative equal to 0 at 0 (Exercise 11.10). Its Maclaurin series is 0 + 0x + 0x^2 + \cdots, which converges everywhere, to the zero function. So being infinitely differentiable does not make a function equal to its Taylor series. Functions that do equal their Taylor series near every point are called analytic, and fortunately all the elementary functions are.
19.4New series from old
Computing f^{(k)}(0) directly is often painful. Instead, build new series from the standard ones (AHL 5.19). Two facts, proved in analysis courses and taken on trust here, make this legitimate:
Taken on trustWorking with power series
Inside its interval of convergence, a power series may be added, multiplied, differentiated and integrated term by term, and the results converge on the same interval (except possibly at its endpoints). And power series representations are unique: if f(x) = \sum c_kx^k near 0, then c_k = \frac{f^{(k)}(0)}{k!} (Exercise 19.11). So however you obtain a series for f, it is the Maclaurin series.
Substitution. Replace x in a known series: \ e^{-x^2} = 1 - x^2 + \frac{x^4}{2!} - \frac{x^6}{3!} + \cdots, and from the geometric series, \frac{1}{1+x^2} = 1 - x^2 + x^4 - \cdots for |x| < 1.
Products. Multiply and collect powers, keeping only as many terms as needed:
e^x\sin x = \left(1 + x + \tfrac{x^2}{2} + \tfrac{x^3}{6}+\cdots\right)\left(x - \tfrac{x^3}{6}+\cdots\right) = x + x^2 + \tfrac{x^3}{3} + \cdots
Differentiation. Differentiating \frac{1}{1-x} = 1 + x + x^2 + \cdots gives \frac{1}{(1-x)^2} = 1 + 2x + 3x^2 + \cdots. Differentiating the series for \sin term by term gives the series for \cos.
Composition. Substitute one series into another and expand: with u = \sin x = x - \frac{x^3}6 + \cdots,
e^{\sin x} = 1 + u + \frac{u^2}{2} + \frac{u^3}{6} + \frac{u^4}{24} + \cdots = 1 + x + \frac{x^2}{2} - \frac{x^4}{8} + \cdots
Example 19.8An integral with no elementary antiderivative
Module 16 said \int e^{-x^2}dx cannot be done with elementary functions. With series it can be computed to any accuracy:
This is an alternating series with decreasing terms, so the error after stopping is less than the first omitted term. That is how such integrals, including the normal distribution tables of statistics, were computed before computers.
19.5Series from differential equations
If y' = f(x, y) and y(0) is known, then y'(0) follows from the equation, and differentiating the equation repeatedly (implicitly, with the chain rule) gives y''(0), y'''(0), and so on. These are exactly the Maclaurin coefficients (AHL 5.19).
Example 19.9A linear example, with a check
y' = x + y, y(0) = 1. Then y'(0) = 0 + 1 = 1. Differentiating, y'' = 1 + y', so y''(0) = 2; then y''' = y'', so y'''(0) = 2; and y^{(4)}(0) = 2. So
y = 1 + x + \frac{2}{2!}x^2 + \frac2{3!}x^3 + \frac{2}{4!}x^4 + \cdots = 1 + x + x^2 + \frac{x^3}{3} + \frac{x^4}{12} + \cdots
The exact solution from Module 18 is 2e^x - x - 1, whose series is 2\left(1 + x + \frac{x^2}2 + \frac{x^3}{6} + \frac{x^4}{24}\right) - x - 1 + \cdots, the same.
Example 19.10A non-linear example
y' = 1 + y^2, y(0) = 0. Then y'(0) = 1, and successive differentiation gives y'' = 2yy', \ y''' = 2y'^2 + 2yy'', \ y^{(4)} = 6y'y'' + 2yy''', \ y^{(5)} = 6y''^2 + 8y'y''' + 2yy^{(4)}. At 0: y'' = 0, y''' = 2, y^{(4)} = 0, y^{(5)} = 16. So y = x + \frac{x^3}{3} + \frac{2x^5}{15} + \cdots. The exact solution is \tan x (separable: \arctan y = x), so this is also the Maclaurin series of \tan.
Beyond IBPaying the last IOU: sine and cosine without pictures
Substitute y = \sum a_kx^k into y'' = -y and compare coefficients: (k+2)(k+1)a_{k+2} = -a_k. With a_0 = 0, a_1 = 1 this forces the series of \sin; with a_0 = 1, a_1 = 0, the series of \cos. So one may define\sin and \cos as these two series (equivalently, as the solutions of y'' = -y with those initial values). Every property then follows by algebra and calculus: \sin' = \cos by term-by-term differentiation, \sin^2 + \cos^2 = 1 because its derivative is 0, the addition formulas, and even the number \pi, as twice the first positive zero of \cos. In particular \frac{\sin x}{x} = 1 - \frac{x^2}{6} + \cdots \to 1 with no geometry at all. This settles the debt left open in Modules 2 and 4.
19.6Limits with series
AHL 5.13 allows limits of the form \frac{f(x)}{g(x)} to be found with Maclaurin series. Expand numerator and denominator, cancel the leading power, and read off the limit:
\displaystyle\lim_{x\to0}\frac{\tan x - \sin x}{x^3}: with \tan x = x + \frac{x^3}{3} + \cdots and \sin x = x - \frac{x^3}{6} + \cdots, the numerator is \frac{x^3}{2} + (\text{terms of degree 5 and higher}), so the limit is \frac12. By L’Hôpital this needs three rounds of increasingly messy derivatives.
19.7Finale: Euler’s formula
Beyond IBe^(iθ) = cos θ + i sin θ
Complex power series converge in the same way as real ones (with |z| in place of |x|), so e^z = \sum\frac{z^k}{k!} makes sense for complex z. Put z = i\theta and use i^2 = -1, i^3 = -i, i^4 = 1, then separate the real and imaginary terms:
With \theta = \pi: e^{i\pi} + 1 = 0. The polar form re^{i\theta} from AHL 1.13 is not just notation, and De Moivre’s theorem (AHL 1.14) becomes the law of exponents: (\cos\theta + i\sin\theta)^n = e^{in\theta} = \cos n\theta + i\sin n\theta. It also explains the hyperbolic functions of Module 9: \cos x = \cosh(ix). At NTNU you will write oscillations and waves as e^{i\omega t} from the first year, and quantum mechanics is built on it.
Key results
T_n(x) = \sum_{k\le n}\frac{f^{(k)}(a)}{k!}(x-a)^k matches f and its first n derivatives at a.
Taylor: f - T_n = \frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}, giving error bounds; n = 0 is the MVT.
e^x, \sin x, \cos x equal their series everywhere; \ln(1+x) on (-1,1]; (1+x)^p on (-1,1).
Build series by substitution, products, differentiation, integration and composition; uniqueness makes the result the Maclaurin series.
Series solve differential equations, compute non-elementary integrals and evaluate limits.
Exercises
Fluency IB-exam styleUnderstanding explain or proveChallenge beyond IB, university flavour
19.1Fluency
Find the Maclaurin series up to the x^4 term: (a) e^{2x} (b) \cos 3x (c) \ln(1 + 2x) (d) \frac{1}{(1-x)^2} (e) \sqrt{1 + x}
Estimate \int_0^{0.5}e^{-x^2}dx to four decimal places using series.
Solution
\int_0^{0.5}\left(1 - x^2 + \frac{x^4}{2} - \frac{x^6}{6} + \frac{x^8}{24}\right)dx = 0.5 - \frac{0.125}{3} + \frac{0.03125}{10} - \frac{0.0078125}{42} + \frac{0.001953125}{216} \approx 0.461281. The series alternates with decreasing terms, and the next term is about 3.7\times10^{-7}, so the value is 0.4613 to four decimal places.
19.5Fluency
Find the Maclaurin series up to x^4 for the solution of y' = x - y^2, y(0) = 1.
Use the binomial series to approximate \sqrt{1.1}, using terms up to x^3. Compare with the true value.
Solution
x = 0.1: 1 + 0.05 - 0.00125 + 0.0000625 = 1.0488125. The true value is 1.0488088\ldots, an error of about 3.7\times10^{-6}, close to the size of the next term \frac{5}{128}(0.1)^4 \approx 3.9\times10^{-6}.
19.7Understanding
(a) The relativistic kinetic energy of a mass m at speed v is (\gamma - 1)mc^2 with \gamma = (1 - v^2/c^2)^{-1/2}. Show that for v \ll c it is approximately \frac12mv^2 + \frac38\frac{mv^4}{c^2}. (b) A pendulum swings through \pm10°. Bound the relative error in the approximation \sin\theta \approx \theta.
Solution
(a) With x = -\frac{v^2}{c^2} and p = -\frac12: \gamma = 1 + \frac12\frac{v^2}{c^2} + \frac38\frac{v^4}{c^4} + \cdots, so (\gamma - 1)mc^2 = \frac12mv^2 + \frac38\frac{mv^4}{c^2} + \cdots. Newton’s kinetic energy is the first term; the next is a tiny correction at everyday speeds.
(b) |\theta - \sin\theta| \le \frac{|\theta|^3}{6}. At \theta = 0.1745 rad this is 8.9\times10^{-4}, about 0.5\% of \sin\theta = 0.1736, and smaller for smaller angles.
19.8Understanding
How many terms of the series for e guarantee an error below 10^{-6}? Find e to five decimal places.
Solution
The error after the \frac1{n!} term is less than \frac{3}{(n+1)!}, which is below 10^{-6} once (n+1)! > 3\times10^6, i.e. n + 1 = 10. So the ten terms up to \frac{1}{9!} suffice: \sum_{k=0}^9\frac1{k!} = 2.7182815\ldots, and e = 2.71828 to five decimals.
19.9Understanding
Prove that e^x = \sum_{k=0}^\infty\frac{x^k}{k!} for every real x, writing out the argument for x < 0 carefully.
Solution
By Taylor’s theorem, e^x - T_n(x) = \frac{e^c}{(n+1)!}x^{n+1} for some c between 0 and x. If x < 0 then c < 0 and e^c < 1, so |R_n(x)| < \frac{|x|^{n+1}}{(n+1)!}. If x > 0 then e^c < e^x. Either way |R_n(x)| \le e^{|x|}\frac{|x|^{n+1}}{(n+1)!}, which tends to 0 by Theorem 3.15. So T_n(x) \to e^x.
19.10Understanding
Differentiate the Maclaurin series of \sin x term by term and identify the result. Then substitute x = i\theta formally into the series for e^x and verify Euler’s formula.
Solution
\frac{d}{dx}\left(x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\right) = 1 - \frac{3x^2}{3!} + \frac{5x^4}{5!} - \cdots = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots = \cos x. For Euler’s formula, see Section 19.7: the even powers of i\theta are real with alternating signs (the cosine series), the odd powers are i times the sine series.
19.11Challenge
Suppose f(x) = \sum_{k=0}^\infty c_kx^k for |x| < R, and assume term-by-term differentiation is valid. Prove that c_k = \frac{f^{(k)}(0)}{k!}. Why does this make “any method that produces a power series for f” give the Maclaurin series?
Solution
Differentiating k times term by term, f^{(k)}(x) = \sum_{j\ge k}j(j-1)\cdots(j-k+1)c_jx^{j-k}. At x = 0 only the j = k term survives: f^{(k)}(0) = k!\,c_k. So the coefficients are determined by f: two power series that agree near 0 have the same coefficients, and any power series for f must be its Maclaurin series.
19.12Challenge
Let f(x) = e^{-1/x^2} with f(0) = 0. Using Exercise 11.10, write down its Maclaurin series. For which x does the series converge, and for which x does it equal f(x)?
Solution
Every coefficient is \frac{f^{(k)}(0)}{k!} = 0, so the series is identically 0. It converges for every x, but equals f(x) only at x = 0, since f(x) > 0 for x \ne 0. So R_n(x) = f(x) for every n: the remainder does not tend to 0.
19.13Challenge
Find \displaystyle\sum_{k=1}^\infty\frac{k}{2^k} by differentiating the geometric series, and \displaystyle\sum_{k=0}^\infty\frac{(-1)^k}{3^k(2k+1)} using the arctangent series.
Solution
For |x| < 1, \sum_{k\ge1}kx^{k-1} = \frac{1}{(1-x)^2}, so \sum kx^k = \frac{x}{(1-x)^2}. At x = \frac12: \frac{1/2}{1/4} = 2.
\arctan x = \sum\frac{(-1)^kx^{2k+1}}{2k+1}. At x = \frac{1}{\sqrt3}: \frac{1}{\sqrt3}\sum\frac{(-1)^k}{3^k(2k+1)} = \arctan\frac1{\sqrt3} = \frac\pi6. So the sum is \frac{\sqrt3\,\pi}{6} = \frac{\pi}{2\sqrt3}. (This series converges much faster than Leibniz’s, and was used to compute \pi to 72 digits in 1699.)
19.14Challenge
(The binomial series, proved.) Let f(x) = \sum_{k=0}^\infty\binom pkx^k for |x| < 1 (this converges, by the ratio test). Using term-by-term differentiation, show that (1 + x)f'(x) = p\,f(x). Then show that g(x) = \frac{f(x)}{(1+x)^p} has g' = 0, and conclude that f(x) = (1 + x)^p on (-1,1).
Solution
The coefficient of x^k in (1 + x)f'(x) = f'(x) + xf'(x) is (k+1)\binom p{k+1} + k\binom pk. Since \binom{p}{k+1} = \binom pk\frac{p - k}{k + 1}, this equals \binom pk(p - k) + k\binom pk = p\binom pk, the coefficient of x^k in pf(x).
Then g'(x) = \frac{f'(x)(1+x)^p - pf(x)(1+x)^{p-1}}{(1+x)^{2p}} = \frac{(1+x)f'(x) - pf(x)}{(1+x)^{p+1}} = 0, so g is constant on the interval (-1,1), equal to g(0) = f(0) = 1. (The ratio test: \left|\binom{p}{k+1}\big/\binom pk\right| = \frac{|p - k|}{k+1} \to 1, so R = 1.)
Beyond · August 2027 and after
Onward to NTNU
What the first semester of fysmat looks like, how this course lines up with it, what will still be new, and how to spend the last weeks of the gap year.
The first year of fysmat
In NTNU’s current study plan for the five-year programme in Physics and Mathematics (MTFYMA), the first semester has two mathematics courses, a programming course and a physics course:
Semester
Courses
Autumn
TMA4401 Matematikk 1D: Kalkulus · TMA4413 Matematikk 2D: Lineær algebra og differensialligninger · TDT4110 IT grunnkurs · TFY4010 Fysikk grunnkurs
Spring
MA1103 Flervariabel analyse og vektoranalyse · FY1020 Mekanikk · TFY4030 Elektrisitet og magnetisme · EXPH0300 Examen philosophicum
Course codes are from the 2026 study plan. NTNU has recently reorganised its first-year mathematics, so check the plan for the year you start; the content is unlikely to change much.
TMA4401 is assessed by a four-hour written exam with no notes and a simple calculator, after a semester of compulsory weekly exercise sets (øvinger). Teaching is in Norwegian.
Pointwise and uniform convergence; error analysis; stiff equations
Previewed below; new at NTNU
What will still be new
Uniform convergence
A sequence of functions f_n converges pointwise to f if f_n(x) \to f(x) for each x separately. That is surprisingly weak. On [0,1], f_n(x) = x^n converges pointwise to the function that is 0 for x < 1 and 1 at x = 1: a limit of continuous functions that is not continuous. The cure is uniform convergence, \sup_x|f_n(x) - f(x)| \to 0, under which limits of continuous functions are continuous and integrals of the limit are limits of the integrals. It is the hidden reason why power series can be differentiated and integrated term by term (Section 19.4).
More about series
Expect the integral test, the limit comparison test, and the distinction between absolute convergence (\sum|a_k| converges) and conditional convergence. The alternating harmonic series converges to \ln 2 only conditionally, and Riemann proved that its terms can be rearranged to sum to any number you like.
Second-order linear equations
TMA4413 covers second-order linear differential equations, which govern every oscillation in physics. For y'' + py' + qy = 0 with constant p, q, try y = e^{rx}: substituting gives the characteristic equation r^2 + pr + q = 0. Complex roots r = \alpha \pm i\beta give, through Euler’s formula, the real solutions e^{\alpha x}\cos\beta x and e^{\alpha x}\sin\beta x. For the damped oscillator \ddot y + 2\dot y + 5y = 0, r = -1 \pm 2i, so
y(t) = e^{-t}\left(A\cos 2t + B\sin 2t\right),
an oscillation whose amplitude decays. Systems of first-order equations and the matrix exponential follow, which is where linear algebra and calculus meet.
Numerical analysis
You have met bisection, Newton’s method, Euler’s method and the trapezoidal and Simpson rules. At NTNU you will program them, prove how fast their errors shrink, and learn methods such as Runge–Kutta. You will also meet stiff equations, such as y' = -1000(y - \cos x), where Euler’s method explodes unless the step is tiny, even though the solution itself is perfectly calm.
The last weeks of the gap year
Redo the Challenge exercises you skipped, without looking at the solutions.
Practise exam conditions: four hours, no notes, a mixture of computation and proof. Take the Key results boxes of five modules and prove every statement from memory.
Read the English–Norwegian glossary and, if you can, a few chapters of a Norwegian textbook.
Learn enough Python (with NumPy and Matplotlib) to plot a function and implement bisection, Newton’s and Euler’s methods. The code in Modules 5, 13 and 18 is a start.
Review complex numbers (AHL 1.12–1.14) and vectors; TMA4413 and the physics courses use both from week one.
Books and other resources
Tom Lindstrøm, Kalkulus (Universitetsforlaget). A rigorous Norwegian calculus text, written for university students. The best way to learn the Norwegian vocabulary and see these proofs in Norwegian.
Robert A. Adams and Christopher Essex, Calculus: A Complete Course. Long used in NTNU’s calculus courses, with a huge stock of exercises.
Michael Spivak, Calculus. The classic first-principles book. Many arguments in this course follow its spirit, and its exercises are famous.
Stephen Abbott, Understanding Analysis. The natural next step: the real numbers, sequences, continuity and series, done properly and readably.
Lectures, exercises and exams in TMA4401 are in Norwegian. These are the terms this course introduces, with the Norwegian words used in university mathematics. Lecturers and textbooks sometimes use variants, so treat this as a starting point.