day 2 review of basic calculus - stanford universitysequences and series di erential calculus tests...

33
Sequences and Series Differential Calculus Day 2 Review of Basic Calculus Sivaram [email protected] Institute of Computational and Mathematical Engineering Stanford University September 20, 2011

Upload: others

Post on 07-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Sequences and Series Differential Calculus

Day 2Review of Basic Calculus

[email protected]

Institute of Computational and Mathematical EngineeringStanford University

September 20, 2011

Sequences and Series Differential Calculus

Day 2

• Sequences and Series• Limits• Series• Well-known sequence and series• Test for convergence

• Differential Calculus• Limit of a function• Continuity• Differentiation

• L’Hospital rule• Product rule• Quotient rule• Chain rule• Exponential and logarithmic function• Trigonometric and Inverse trigonometric function• Maximum and Minimum of a function• Rolle’s theorem• Mean Value theorem• Implicit differentiation• Taylor Series• Well-known Taylor series

Sequences and Series Differential Calculus

Sequence and Limits

• Sequence mapping whose domain is the set of natural numbers.

• Every term is typically denoted by {xn}n∈N.

• A sequence {xn}n∈N in a norm-space is said to converge to x , if forevery ε > 0, there exists N(ε) ∈ N such that ∀n > N(ε), we have,

||xn − x || < ε.

• Basically difference between x and xn can be made arbitrarily small.

• Typically denoted as limn→∞

xn = x (or) xn → x as n→∞.

• Example: xn =(1 + 1

n

)nwhere n ∈ Z+. Note that xn ∈ Q is an

increasing sequence of rationals but limn→∞

xn = e /∈ Q. However,

e ∈ R.

Sequences and Series Differential Calculus

Properties of sequences• We say a sequence diverges to infinity if given any M ∈ R, then

there exists N(M) ∈ N, such that ∀n > N(M), we have

xn > M.

• Similarly, we say a sequence diverges to negative infinity if given anyM ∈ R, then there exists N(M) ∈ N, such that ∀n > N(M), we have

xn < M.

• Suppose sn → s and tn → t, and s, t ∈ R then• sn + tn → s + t• c × sn → c × s• sn × tn → s × t• 1

sn→ 1

s

• Examples:

• For any x ∈ R+, we have limn→∞

1

nx= 0.

• For any x ∈ R+, we have limn→∞

n√x = 1.

• limn→∞

n√n = 1.

Sequences and Series Differential Calculus

Finding square roots using sequences

The first algorithm for approximating√g is known as the “Babylonian

method” and is based on sequences and convergence of sequences. It canalso be derived from Newton’s method. The algorithm goes as follows.Algorithm:

1. x0 = g+12

2. xn+1 =1

2

(xn +

g

xn

)3. Repeat till you get desired accuracy

Analysis:

1. Note that x0 ≥√g and in general xn ≥

√g . (By AM-GM inequality)

2. xn+1 − xn = 12

(gxn− xn

)≤ 0. Montone decreasing sequence.

3. Monotone decreasing sequence bounded below =⇒ converges in R.

4. Bit more analysis, can prove that it is a quadratically convergentalgorithm (≈ precision doubles at each step) converging to

√g .

Sequences and Series Differential Calculus

Series

• Given a sequence {xn}, define

yn =n∑

i=1

xi y = limn→∞

yn = limn→∞

n∑i=1

xi =∞∑i=1

xi

• The series converges if the limit ‘y ’ doesn’t diverge.

•∑

xn → y iff ∀ε > 0, ∃N(ε) : ∀m, n : m ≥ n ≥ N,∣∣∣∣∣m∑

k=n

xk

∣∣∣∣∣ ≤ ε• This implies that xn → 0. However, the converse is not true.

•∞∑n=1

1

ndoes not converge even though we have lim

n→∞

1

n= 0.

Sequences and Series Differential Calculus

Well-known sequence and series

• limN→∞

N∑n=0

1

n!= e

• limn→∞

(1 +

α

n

)nt= eαt

• Geometric Series:∞∑k=0

xk =1

1− x, |x | < 1

• x − x3

3!+

x5

5!− x7

7!+

x9

9!− · · · = sin(x)

• 1− x2

2!+

x4

4!− x6

6!+

x8

8!− · · · = cos(x)

• 1− 1

3+

1

5− 1

7+

1

9− · · · =

π

4

• an = 1 +1

2+

1

3+

1

4+ · · ·+ 1

n− log(n), lim

n→∞an = γ

Sequences and Series Differential Calculus

Tests for convergence

1. Sandwich Theorem: If an → x and bn → x and if cn always liesbetween an and bn, then cn → x .

2. Comparision test: If∑∞

k=1 ak converges, a ≥ 0, and 0 ≤ bk ≤ ak ,

then∑∞

k=1 bk converges; If∞∑k=1

ck diverges ck ≥ 0 and 0 ≤ ck ≤ dk ,

then∑∞

k=1 dk diverges.

3. Ratio test: Suppose that limn→∞

∣∣∣ an+1

an

∣∣∣ exists and is strictly less

that 1. Then∑∞

k=1 ak converges absolutely. If the limit is strictlygreater than 1, the series diverges and inconclusive is the limit isexactly 1.

4. Root test: Suppose that limit limn→∞ (|an|)1/n exists and is strictlyless than 1. Then

∑∞n=1 an converges absolutely. If the limit is

greater than 1, the series diverges; if the limit equals 1, the test isinconclusive.

Sequences and Series Differential Calculus

Limit of a function

• Let f (x) be a function.• We say lim

x→a+f (x) = R, if given ε > 0, ∃δ > 0 such that

∀x ∈ (a, a + δ), we have ||f (x)− R|| < ε.This means that the right limit of f (x) at a is R.

• We say limx→a−

f (x) = L, if given ε > 0, ∃δ > 0 such that

∀x ∈ (a− δ, a), we have ||f (x)− L|| < ε.This means that the left limit of f (x) at a is L.

• Example:

• f (x) =

−1 x < 00 x = 01 x > 0

. At 0, left limit is −1 and right limit is +1.

• f (x) = sin(x)x

. At 0, left limit equals the right limit equals 1. Thefunction is not defined at x = 0.

• f (x) =

{0 x ≤ 0

exp(− 1

x

)x > 0

. At 0, left limit equals right limit

equals f (0) = 0

Sequences and Series Differential Calculus

Some-well known limits

limh→0

sin(h)

h= 1

limh→0

exp(h)− 1

h= 1

limh→0

log(1 + h)

h= 1

Sequences and Series Differential Calculus

Continuity• A function is continuous at a point ‘a’ if we have

L = R = f (a)

• Basically it means that you can graph the function without liftingyour pen off the paper.

• Example:

• f (x) =

−1 x < 00 x = 01 x > 0

. At 0, left limit is −1 and right limit is +1

and f (0) = 0. Hence, function is not continuous at x = 0.

• f (x) = sin(x)x

. At 0, left limit equals the right limit equals 1. Thefunction is not defined at x = 0. However, if we were to define thefunction at x = 0 as 1, then we have continuity since

L = R = f (0) = 1.

Such a discontinuity is called removable discontinuity.

• f (x) =

{0 x ≤ 0

exp(− 1

x

)x > 0

. At 0, we have

L = R = f (0) = 0.

The function is continuous at 0.

Sequences and Series Differential Calculus

Continuous function

• A function is said to be continuous over a set S if the function iscontinuous at every point in the set S .

• For example, f (x) = x is continuous over the entire real line, R.

• The space of all continuous functions over a set S is denoted byC 0(S).

• For instance, we have• f (x) = x ∈ C 0(R).

• f (x) =

{0 x ≤ 0

exp(− 1

x

)x > 0

∈ C 0(R).

whereas f (x) =

−1 x < 00 x = 01 x > 0

/∈ C 0(R).

• Does f (x) =

{1 x = 0

x sin( 1x ) x 6= 0

∈ C 0(R\{0})?

Sequences and Series Differential Calculus

Derivative• The left derivative of a function f at a point a is given by

f ′(a)− = limh→0−

f (a + h)− f (a)

h.

• The right derivative of a function f at a point a is given by

f ′(a)+ = limh→0+

f (a + h)− f (a)

h.

• The function f is said to be differentiable at the point a if we have

f ′(a)− = f ′(a)+.

The derivative at the point a is then denoted by f ′(a) (or) dfdz

∣∣a.

• When the left and right derivatives match, the derivative can bedirectly obtained as

f ′(a) = limh→0

f (a + h)− f (a)

h.

Sequences and Series Differential Calculus

Differentiation

The geometrical interpretation of the the derivative at the point a is theslope of the tangent at the point a.

Figure: Geometrical interpretation of the the derivative at the point x0

Sequences and Series Differential Calculus

Properties of derivatives

• The derivative of a constant is zero i.e. if f (x) = c ,∀x ∈ S , thenf ′(x) = 0,∀x ∈ S .

f ′(x) = limh→0

f (x + h)− f (x)

h= lim

h→0

c − c

h= lim

h→00 = 0.

• (f (x) + g(x))′ = f ′(x) + g ′(x) wherever f ′(x) and g ′(x) are defined.Proof: (?)

•d(xn)

dx= nxn−1 where n ∈ R

Proof: (?)

• The derivative of a polynomial of degree n is a polynomial of degreeat most n − 1.Proof: (?)

Sequences and Series Differential Calculus

Properties of derivatives• Product rule:

If f and g are two functions whose derivative exists at ‘x = a’, then

(f (x)g(x))′|x=a = f ′(a)g(a) + f (a)g ′(a)

Proof: (?)• Quotient rule:

If f and g are two functions whose derivative exists at ‘a’ and wehave g(a) 6= 0, then(

f (x)

g(x)

)′∣∣∣∣∣x=a

=g(a)f ′(a)− f (a)g ′(a)

(g(a))2

Proof: (?)• Chain rule:

If f and g are two functions whose derivative exists at ‘a’ and g(a)respectively, then

df (g(x))

dx=

df (y)

dy

∣∣∣∣y=g(a)

× dg(x)

dx

∣∣∣∣x=a

Proof: (?)

Sequences and Series Differential Calculus

Exponential and Logarithmic functions

• d(exp(x))dx = exp(x)

Proof: (?)

• d(log(x))dx = 1

xProof: (?)

• d(exp(f (x)))dx = f ′(x) exp(f (x))

Proof: (?)

• d(log(f (x)))dx = f ′(x)

f (x)

Proof: (?)

• dax

dx = ax log(a)Proof: (?)

• dxx

dx = xx(1 + log(x))Proof: (?)

Sequences and Series Differential Calculus

Trigonometric and Inverse trigonometric functions

• d(sin(x))dx = cos(x)

Proof: (?)

• d(cos(x))dx = − sin(x)

Proof: (?)

• d(tan(x))dx = sec2(x)

Proof: (?)

• d(sec(x))dx = sec(x) tan(x)

Proof: (?)

• d(cosec(x))dx = −cosec(x) cot(x)

Proof: (?)

• d(cot(x))dx = −cosec2(x)

Proof: (?)

Sequences and Series Differential Calculus

C 1(S) space of functions

• Just as we defined the C 0(S) space of functions we can defineanother space of functions, viz, C 1(S) space of functions.

• A function is said to be differentiable over a set S if the function isdifferentiable at every point in the set S .

• For example, f (x) = x is differentiable over the entire real line, R.

• The space of all differentiable functions over a set S , whosederivative is continuous over S , is denoted by C 1(S).

• For instance, we have• f (x) = x ∈ C 1(R).

• f (x) =

{0 x ≤ 0

exp(− 1

x

)x > 0

∈ C 1(R).

whereas f (x) =

{0 x ≤ 0x x ≥ 0

/∈ C 1(R) but is in C 0(R).

• Does f (x) =

{0 x = 0

x2 sin( 1x ) x 6= 0

∈ C 1(R)?

• It is not hard to see that C 0(S) ⊃ C 1(S).

Sequences and Series Differential Calculus

Higher derivatives and C k(S) space of functions• The k th left derivative of a function f at a point a is given by

f k(a)− = limh→0−

f k−1(a + h)− f k−1(a)

h.

• The k th right derivative of a function f at a point a is given by

f k(a)+ = limh→0+

f k−1(a + h)− f k−1(a)

h.

• The function f is said to have k th derivative at the point a if we have

f k(a)− = f k(a)+.

The k th derivative at the point a is denoted by f k(a) (or) dk fdzk

∣∣∣a.

• When the left and right k th derivatives match, the k th derivative canbe directly obtained as

f k(a) = limh→0

f k−1(a + h)− f k−1(a)

h.

• The space of all k-differentiable functions over a set S , whose k th

derivative is continuous over S , is denoted by C k(S).

Sequences and Series Differential Calculus

Maximum and Minimum of a continuous function

Theorem:If f is a real valued continuous function on a closed and bounded set X ,then the function f (x) is bounded i.e. there exists m,M ∈ R such thatwe have m = infx∈X (f (x)) ∈ R and M = supx∈X (f (x)) ∈ R. Further, thebounds are hit i.e. we have p, q ∈ X such that f (p) = m and f (q) = M.Example:

• f (x) = x3 for x ∈ X = [−1, 1].Clearly, we have f (x is continuous on X . We get m = −1, M = 1,p = −1 and q = 1.

• f (x) = sin(x) for x ∈ X = [π4 ,7π4 ].

Clearly, we have f (x is continuous on X . We get m = −1, M = 1,p = π

2 and q = 3π2 .

The closed and bounded sets on the real line are called ”compact” sets.Hence, the theorem can be restated as “A continuous function attains itminimum and maximum on a compact set”

Sequences and Series Differential Calculus

Maximum and Minimum of a continuous functionWe look at some of the counterexamples of the previous theorem whenthe set X is not compact.

• f (x) = 1x where x ∈ X = (0,∞). f (x) is continuous on (0,∞). We

have m = infx∈X (f (x)) = 0 ∈ R. However, we haveM = supx∈X (f (x)) =∞ /∈ R. Also, there exists no p, q ∈ X suchthat f (p) = 0 and f (q) =∞. This is so since (0,∞) is neitherclosed nor bounded and hence not compact.

• f (x) = 1x+1 where x ∈ X = [0,∞). f (x) is continuous on [0,∞).

We have M = supx∈X (f (x)) = 1 ∈ R andm = infx∈X (f (x)) = 0 ∈ R. Taking q = 0 ∈ X , we getf (q) = 1 = M. However, there exists no p ∈ X such thatf (p) = m = 0. This is so since [0,∞) is not bounded and hence notcompact.

• f (x) = 1x where x ∈ X = (0, 1]. f (x) is continuous on (0, 1]. We

have m = infx∈X (f (x)) = 1 ∈ R. However, we haveM = supx∈X (f (x)) =∞ /∈ R. Choosing p = 1 ∈ X , we havef (p) = 1 = m. But, there exists no q ∈ X such that f (q) =∞.This is so since (0, 1] is not closed and hence not compact.

Sequences and Series Differential Calculus

Rolle’s theoremRolle’s Theorem:Rolle’s theorem states that a differentiable function which attains equalvalues at two distinct points must have a point somewhere between themwhere the first derivative is zero i.e. there exists a point such that theslope of the tangent is zero. The technical version is as follows.If f : [a, b]→∞ is continuous, f is differentiable on (a, b) and we havef (a) = f (b), then there exists c ∈ (a, b) such that f ′(c) = 0.

Sequences and Series Differential Calculus

Rolle’s theorem

Example:f (x) =

√1− x2, x ∈ [−1, 1]. The function satisfies the criteria for

Rolle’s theorem with f (−1) = f (1) = 0. Hence, there exists a pointc ∈ (−1, 1) such that f (c) = 0. In this case, we can easily see that c = 0is a desired point.

Sequences and Series Differential Calculus

Rolle’s theorem

Example:If the differentiability fails at even one interior point, then the conclusionof Rolle’s theorem may not hold. Consider f (x) = |x |, x ∈ [−1, 1]. Thefunction doesn’t have derivative at one point namely at x = 0. Hence,even though we have f (−1) = f (1) = 1, we do not have a pointc ∈ (−1, 1) such that f (c) = 0.

Sequences and Series Differential Calculus

Mean Value theoremThis is nothing but tilted version of Rolle’s theorem. Tilt your head andapply Rolle’s theorem to get this result.Theorem:If f : [a, b]→∞ is continuous, f is differentiable on (a, b), then there

exists c ∈ (a, b) such that f ′(c) = f (b)−f (a)b−a .

Sequences and Series Differential Calculus

Implicit differentiation

• Implicit function of the form f (x , y) = 0.

• For example, x2 + y2 = 2 is an implicit function relating y in termsof x . We could rewrite this as f (x , y) = x2 + y2 − 2 = 0.

• Another example is tan(x + y) = x2y which could be rewritten asf (x , y) = tan(x + y)− x2y = 0. We are interested in finding thederivative dy

dx at a specific point say (x0, y0).

• ∂f∂y

dydx + ∂f

∂x = 0.

• ∂f∂y - treat x as a contant and differentiate w.r.t y .

• ∂f∂x - treat y as a contant and differentiate w.r.t x .

• f (x , y) = x2 + y2 − 2 = 0 =⇒ 2y dydx + 2x = 0 =⇒ dy

dx = − xy

Sequences and Series Differential Calculus

L’Hopital’s Rule

Suppose f and g are differentiable on ]a, b[ and g ′(x) 6= 0 for x ∈]a, b[.Suppose

f ′(x)

g ′(x)→ A as x → a

If f (x)→ 0 and g(x)→ 0 as x → 0, or if g(x)→∞ as x → a, then

f (x)

g(x)→ A as x → a

Example

limx→0

1− cos x

x2= lim

x→0

d/dx(1− cos x)

d/dx(x2)= lim

x→0

sin x

2x=

1

2

Sequences and Series Differential Calculus

Taylor’s Series

Suppose f is a real valued function on [a, b], n is a positive integer,f (n−1) is continuous on [a, b] and f (n)(t) exists for every t ∈]a, b[. Letα, β be distinct points in [a, b], and define

P(t) =n−1∑k=0

f (k)(α)

k!(t − α)k

Then there exists a point x between α and beta such that

f (β) = P(β) +f (n)

n!(β − α)n

For n = 1 this is nothing but the mean value theorem. In general thetheorem shows that f can be approximated by a polynomial of degreen − 1 and the above equation allows us to estimate the error, if we knowa prioiri, bounds on |f (n)(x)|.

Sequences and Series Differential Calculus

Taylor Series

The most common way of stating the Taylor’s theorem is

f (x + h) = f (x) + f ′(x)h +f ′′(x)h2

2!+ · · ·+ f (n)(x)hn

n!+ Rn(h)

where,

Rn =f (n+1)(c)

(n + 1)!hn+1 for some x ≤ c ≤ x + h

The function Rn is called the remainder of order n or the error term. IfRn → 0 as n→∞, we say that the Taylor series generated by fconverges and write

f (x + h) =∞∑k=0

f (k)(x)

k!hk

Sequences and Series Differential Calculus

Some well-known taylor series

exp(x) = 1 + x +x2

2!+

x3

3!+

x4

4!+

x5

5!+ · · ·

sin(x) = x − x3

3!+

x5

5!− x7

7!+

x9

9!+ · · ·

cos(x) = 1− x2

2!+

x4

4!− x6

6!+

x8

8!+ · · ·

• For |x | < 1, log(1 + x) = x − x2

2 + x3

3 −x4

4 + · · ·

Sequences and Series Differential Calculus

Tomorrow

• Integral Calculus• Darboux sums• Riemann Integral• Some well-known summations• Fundamental theorem of calculus• Fubini’s theorem• Integrating by substitution• Integrating rational functions, exponential, logarithmic, trigonometric

and inverse trigonometric functions• Integrating by parts• Method of partial fractions• Leibniz’s rule• Computing arc lengths and areas• Higher dimensional integrals to find area, volume etc• Computing volume by disc method, shell method, cross-sectional

area etc• Computing center of mass, moment of inertia, energy, etc

Sequences and Series Differential Calculus

Tomorrow

• Multi-Variable Calculus• Partial derivatives• Chain rule• Critical points• Change of coordinates

• Cylindrical polar coordinates• Spherical coordinates

•∫ ∞−∞

exp(−x2)dx =√π