Notes
1P4 Mathematics · Topic 5

Functions, Taylor series, asymptotics and limits

Lecture 5 · Fri 23 Oct

1.1 Functions

1.1.1 What is a function?

Definition Function, domain, codomain

A function maps each input to exactly one output . is the domain and is the codomain.

Sets that come up often:

set definition
Real numbers
Open interval (ends excluded)
Closed interval (ends included)
Complex numbers
Integers
Positive integers
Natural numbers (some books exclude 0 and write to include it)

1.1.2 Smooth functions

Definition Smooth function

A function is smooth if it and all of its derivatives are continuous. Continuous means you can draw the graph without lifting the pen. Example: is smooth, because every derivative is again.

Explanation What is an example of a continuous function that is not smooth?

is continuous, but jumps from to at . It therefore has no Taylor series about (§1.4), because does not exist. Taylor series need smoothness at the expansion point.

1.1.3 Notation for derivatives

Definition Notation for derivatives

These are the first, second and th derivatives, and the th derivative evaluated at . For derivatives with respect to time a dot is used: and .

1.1.4 Essential calculus

Equation Fundamental theorem of calculus memorise
Show derivation

Split into many short intervals . On each, the change in is , with an error that shrinks faster than the interval. Add them up: the left side telescopes (every intermediate value cancels) to , and the right side is a Riemann sum that tends to as the intervals shrink. (A rigorous proof is in analysis courses; this is the idea.)

Equation Product and quotient rules databook p.7

For and :

Show derivation

Product. From the definition of the derivative, with a small step :

(add and subtract ). As this becomes .

Quotient. Write . By the Chain rule, . The product rule then gives .

Equation Integration by parts databook p.10
Show derivation

Integrate the product rule from to . By the Fundamental theorem of calculus, , so . Rearrange.

Equation Chain rule memorise

For and :

Show derivation

A small change causes a change in , which causes a change in . For ,

As , too (u is differentiable, so continuous), and each ratio tends to its derivative. (The case where for small needs a little more care in a formal proof, but gives the same answer.)

  • Product, quotient and by-parts rules are in the databook (pp. 7, 10). The chain rule and the fundamental theorem are not, so know them cold.
  • Integration by parts is just the product rule integrated from to .

1.1.5 Functions of the form where is an integer

Interactive figure

Step from 0 to 6. For even the two points are mirror images in the -axis. For odd they are reflections of each other through the origin.

Figure Symmetry of y = xⁿ

From the graphs:

  • If with even, then .
  • If with odd, then .

Any function with the same symmetry as an even power is called an even function. Any function with the same symmetry as an odd power is called an odd function.

Result Even and odd functions memorise

If is even, it contains only even powers of . If it is odd, it contains only odd powers.

Show derivation

Powers. If is even, must equal for all . Two power series that are equal have equal coefficients, so : every odd has . For an odd function, kills every even .

Equation Even/odd decomposition memorise

Any can be split as , with even part and odd part :

Show derivation

Check the three claims. (even); (odd); . (To find them, write and , then add and subtract.)

Explanation How do I check that f_e really is even?

Replace by : . Likewise . Adding the two parts gives back .

Example: for the even part is and the odd part is . That is exactly where the Hyperbolic sine, cosine, tangent come from.

Explanation What symmetry rules save time in exams?
  • even × even = even, odd × odd = even, even × odd = odd (as with signs: , , ).
  • For any odd : .
  • For any even : .
  • Even: , mirror in the -axis, only even powers. Odd: , rotation by 180° about the origin, only odd powers.
  • Any function = even part + odd part (formulas above).
Try now

1.2 Hyperbolic functions

Definition Hyperbolic sine, cosine, tangent

and are odd; is even. (Databook p. 4.)

Interactive figure

Turn on the exponentials (dashed: rising, falling). is the sum of the two dashed curves and their difference. For large one exponential dominates, so and .

Figure sinh, cosh and tanh

Key features:

  • , with its minimum .
  • , and is increasing everywhere.
  • lies between and and tends to as .

1.2.1 Differentiation of the hyperbolic functions

Equation Derivatives of the hyperbolic functions databook p.9

(The databook gives these in reverse, as integrals.)

Show derivation Derivatives of sinh and cosh

Use and :

For , use the quotient rule:
(, and because ; the numerator uses with .)

Definition sech, coth, csch

, and , by analogy with , , . The databook writes .

Watch out

. There is no minus sign, unlike .

Explanation Is there a quicker route to d(tanh)/dx?

Apply the quotient rule to directly:

using from Hyperbolic identities. This is the same steps as for , but with no sign flip.

  • , , .
  • When in doubt, write in exponentials and differentiate.

1.2.2 Identities for hyperbolic functions

Equation Hyperbolic identities databook p.4
Show derivation Identities from the definitions
Explanation How can I check a hyperbolic identity against the trig one I know?

Osborn’s rule is a memory check, not a proof. Take a trig identity, replace and , and flip the sign of every term containing a product of two sines. Examples:

  • becomes .
  • becomes .

Since hides , it also flips sign: becomes .

To prove an identity, write everything in exponentials.

  • : note the minus sign, compared with .
  • often simplifies algebra quickly.
  • Proving an identity: substitute the exponential definitions and expand.
Try now

1.2.3 Inverse hyperbolic functions

Unlike the trig functions, the hyperbolic functions can be inverted in closed form, using logarithms.

Equation Inverse sinh and cosh databook p.9
Show derivation Inverting y = sinh x

Start from and multiply by :

This is a quadratic in , so . Since and , take the root:
cosh. From : , so , real only for . Both roots are positive and their product is , so : (cosh is even, so each comes from two values of ).

Equation Inverse tanh memorise
Show derivation

. Solve for : , which is positive only for . Take logs and halve.

Explanation Why the ± for arcosh?

is even, so each comes from two values . The quadratic has roots , and both are positive.

Their product is , so . Hence the two roots give . The principal value takes .

Explanation Where does the artanh formula come from?

Multiply top and bottom of by :

Rearranging gives , so and . This needs , matching the range of .

  • Inverting: write in exponentials, solve a quadratic in , keep the positive root.
  • arsinh and arcosh are in the databook (p. 9, as integrals). artanh is not.
  • arcosh needs ( is even) and .

1.3 Gaussian function

1.3.1 Introduction

Definition Gaussian function

The simplest Gaussian is : a symmetric bell with peak , decaying rapidly for . The general form is , centred at with width .

It appears in heat transfer, diffusion and communication systems. It is also the shape of the normal distribution, which models measurement errors and underlies least-squares fitting.

Interactive figure

Change : the area does not change. Increase : the bell narrows and the area falls as . At the area is .

Figure Gaussian e^{-a(x−b)²} and its area

1.3.2 Integral of a simple Gaussian function

Equation Gaussian integral databook p.11
Show derivation The I² trick

Write the square as a product of two identical integrals, using a different dummy variable in each:

Change to polar coordinates, and , with . The whole plane is , :
Since :
Hence .

General Gaussian. Substitute , so :

(The change to polar coordinates uses the area element : databook maths p10–12, Jacobian .)

θ dr r dθ O x y

The element has sides (radially) and (around the arc), so its area is .

Figure Area element r dr dθ
Explanation Why go through I² at all?

has no antiderivative in elementary functions, so cannot be done directly. Squaring turns it into a 2D integral over the whole plane. In polar coordinates the extra factor makes the integrand an exact derivative.

The trick only works over the whole line. By symmetry the half-line integral is . Over a finite range you get the error function erf (databook p. 11).

  • (databook p. 11). The shift does not matter.
  • Proof: square it, go to polars (), then use .

1.4 Taylor series expansions

1.4.1 Introduction

A Taylor series for a smooth function is a polynomial expansion about a point :

Definition Big-O notation

stands for all terms of order and higher (). Rules:

(There is also a little-o notation, which this course does not use.)

Equation Taylor series databook p.5

Here and . About it is called a Maclaurin series.

Show derivation Finding the coefficients c_n
  1. Put : every term except the first vanishes, so .
  2. Differentiate once: . At : .
  3. Differentiate again: . So .
  4. Third derivative: . So .

In general, differentiating times leaves plus terms that vanish at . Hence , with .

Term by term: . (This assumes can be written as a power series about at all; the Radius of convergence says where that works.)

Explanation Why does the databook version look different?

The databook (p. 5) writes . It is the same formula: rename the expansion point and the step . Recognise both forms.

Explanation Why does differentiating pick out one coefficient at a time?

Each derivative lowers every power by one. The constant term is killed, and the term becomes after derivatives. Terms with higher powers still carry a factor , so they vanish at . Terms with lower powers were already differentiated to zero. Only survives.

  • . Use it whenever you need the series of something not in the databook.
  • Databook form: .
  • means “terms of order and higher”. When adding, the lowest order wins. When multiplying, the orders add.

1.4.2 Taylor series about for some common functions

Exponential. Every derivative of is , so and .

Equation Series for e^x, e^{−x}, cosh, sinh databook p.6
Show derivation

For every derivative is , so and the Taylor series about 0 gives . Replace by for . Adding and halving keeps the even powers (cosh), subtracting and halving keeps the odd powers (sinh), matching Even and odd functions.

comes from substituting . Adding the two series cancels the odd powers, giving . Subtracting cancels the even powers, giving .

Sine. The derivatives of cycle: , , , then again. Since and , the even terms of this expansion drop out:

Equation Series for sin and cos databook p.6

is odd, so only odd powers appear; is even, so only even powers appear.

Show derivation

The derivatives of repeat in a cycle of four: , which at are . The Taylor series about 0 therefore has only odd powers with alternating signs: . For the cycle starts , i.e. : only even powers.

Cosine by differentiating sine. A series can be differentiated term by term:

Example Multiplying series: 2 sin x cos x = sin 2x

Each product is kept only up to , and everything beyond goes into .

Binomial expansion. For a positive integer :

Equation Binomial series (any α) databook p.6

For a positive integer it stops after terms. Otherwise it is infinite and valid for .

Show derivation

Taylor series of about 0: , , and in general . Divide by . If is a positive integer, the factor appears in every coefficient from on, so the series stops. Otherwise the coefficient ratio , so (Radius of convergence).

Interactive figure

Raise for : the polynomial hugs the curve over a wider and wider range, because . Then pick : inside (dashed lines) it converges, but outside, higher makes it worse.

Figure Taylor polynomials closing in on f
Explanation Which series manipulations are allowed, and what do I watch?

You can substitute (, , another small series), add, differentiate term by term, and multiply power series inside their range of convergence.

The trap is truncation. Decide the highest power you need first, then drop every product that exceeds it into . If one factor is only known to , the product cannot be trusted beyond (if the other factor starts at order 1).

  • Databook (p. 6) gives , , , , , , , . Know how to use them: substitute, add, multiply, differentiate.
  • and series are the even and odd halves of : same terms, but all with signs, unlike and .
  • When multiplying series, fix the target order first and discard higher products.
Try now

1.4.3 Odd and even functions

Result Parity and power series memorise

A series about with only odd powers (e.g. ) is odd: . One with only even powers (e.g. ) is even: .

More usefully, the converse holds. If you know is odd, its series has only odd powers. If is even, only even powers.

Show derivation

Both directions are Even and odd functions: with only odd powers, for every term, so ; with only even powers, . Conversely, an odd (even) function’s series cannot contain even (odd) powers, by comparing coefficients.

Explanation How does this save work?

Before expanding, check the symmetry. For example, is odd ÷ even = odd. So its series can only contain , as the databook confirms: . You never need to compute the even coefficients; they are zero.

The rule applies to series about only. An expansion about another point has no such restriction.

  • Odd function ⇔ only odd powers about 0; even ⇔ only even powers. Use it to skip the zero coefficients.

1.4.4 Convergence of Taylor series

The series for , , and converge for all . Others converge only in a limited range.

Equation Radius of convergence memorise

converges for , with

Show derivation beyond this lecture: the ratio test

Compare successive terms: as . If this ratio settles below 1, the terms eventually shrink at least as fast as a geometric series with ratio , which converges (databook maths p5: , ). If it is above 1, the terms grow and the series diverges. So it converges for ; at the test says nothing.

Example ln(1 + x)

Here , so

The series converges for . Strictly, the range is . See Taylor polynomials closing in on f with .

Watch out

The handout writes this limit as , which is , the reciprocal of what the formula asks for. Both limits are 1 here, so the answer is the same. In general, with :

Explanation What happens exactly at |x| = R?

The ratio test gives no verdict on the boundary, so check each endpoint separately:

  • : alternates with shrinking terms, so it converges (to ).
  • : is the harmonic series, which diverges, consistent with .

Hence .

Explanation Quick check: why does e^x converge everywhere?

For , , so . Thus .

For the binomial series with non-integer , , so .

  • ; converges for . Test the endpoints separately.
  • , , , , : . and : .

1.4.5 Using series expansions as approximations

Engineers often keep only the first few terms, replacing a complicated function by a polynomial. This gives a local approximation, valid over a small region for some .

Result Small-x approximations memorise

For :

The accuracy is estimated from the relative size of the next term in the series.

Show derivation

Keep the first one or two terms of the series (Series for sin and cos, Series for e^x, e^{−x}, cosh, sinh, Binomial series (any α)). For small each further term is smaller by roughly a factor , so the first neglected term (“the next term”) is a good estimate of the error.

Watch out

These need in radians. Also note that alone is only first-order accurate. Keep the whenever second-order effects matter (e.g. a difference like ).

1.4.6 Example of estimating the accuracy in the approximation

Example Range for cos x ≈ 1 − x²/2 to 1% accuracy

The next term is . For 1% accuracy we need

A more accurate estimate solves on a calculator, giving .

Interactive figure

The next-term estimate (red) crosses 1% at ; the exact relative error (blue) crosses it at . Slide to compare the two at any point.

Figure Error of cos x ≈ 1 − x²/2
Explanation Why is the quick estimate a bit optimistic?

The quick estimate compares with 1% of . But the true relative error divides by , which is smaller than 1 (about 0.79 at ). That makes the true error relatively bigger, so the exact bound (0.662) is tighter than 0.70.

In an exam the next-term estimate is normally what is wanted. Just say it is an estimate.

  • Error of a truncated series ≈ the first omitted term. Set (next term) < tolerance × (function value) and solve for the range.
Try now

1.4.7 Using series expansions to linearise nonlinear problems

Keeping only the first two Taylor terms about gives

Equation Linearisation about x = a memorise

With and :

Show derivation

Keep the first two terms of the Taylor series about : . Move across: . The error is about .

Example Simple pendulum

The equation of motion is nonlinear and hard to solve. For , , giving

This is linear and easily solved: simple harmonic motion with angular frequency . (Here is gravitational acceleration, not a function.)

Interactive figure

At the tangent is : the pendulum approximation. Shrink and watch the error fall roughly as .

Figure Linearising sin θ about θ = a
  • Linearise: , i.e. keep two Taylor terms. It is good while the next term is small.
  • Pendulum: turns into SHM.

1.5 Asymptotic expansions

1.5.1 Simplistic Taylor series approach for large

To expand for large , let and expand in powers of the small quantity .

Example √(x² + x) − x as x → ∞

Therefore .

Definition Asymptotic notation ~

means “ behaves like for large ” (or in whatever limit is being considered).

Interactive figure

The approximation is poor for but excellent by . The difference shrinks like , the first neglected order.

Figure √(x²+x) − x and its large-x approximation
Explanation How can I check the leading term another way?

Rationalise:

The substitution also gives the correction .

  • Large : put , factor out the dominant power, expand the rest binomially in .
  • : behaves like in the limit.

1.5.2 Laplace’s method – application to obtain Stirling’s approximation for

Result Laplace’s method memorise

Taylor-expand the exponent of an integrand about its maximum, to second order. The integrand is then approximated by a Gaussian, which can be integrated exactly.

Equation Factorial as an integral databook p.11

This extends to non-integers via the Gamma function, , with .

Show derivation Why the integral is n!

Integrate by parts:

Repeating gives , with base case .

Equation Stirling’s approximation databook p.3
Show derivation Stirling’s approximation by Laplace’s method
  1. Write the integrand as a single exponential:
  2. Find the maximum: at .
  3. Taylor-expand about the maximum:
    Here , and gives . So near the maximum
  4. Substitute back, using and :
  5. For large the integrand is negligible for , so extend the lower limit to . Then use Gaussian integral with :
Interactive figure

Left: the integrand (blue) and its Gaussian approximation (red), both scaled to peak 1 and plotted against . Right: the percentage error of Stirling’s formula. Raise : the exact integrand becomes more symmetric and Gaussian, and the error falls. At , and Stirling gives , an error of 0.6%.

Figure Laplace’s method for n!: integrand vs Gaussian
Explanation Why can the lower limit be moved from 0 to −∞?

The Gaussian is centred at with standard deviation , so lies standard deviations below the peak. The neglected piece is of order , which is utterly negligible for large .

The shape is only approximately Gaussian away from the peak, but the area is captured well, which is all that matters for the integral.

Explanation Is there a general formula for Laplace’s method?

Expand about the maximum , where and . Applying Gaussian integral gives

For : and , giving .

As a check, the relative error of Stirling’s formula is about : at , matching the plot.

  • Laplace’s method: write the integrand as , find the max (), expand to second order, and integrate the resulting Gaussian over .
  • ; maximum of the integrand at , with .
  • Stirling (databook p. 3): , . The error is already below 1% for .

1.5.3 Laplace type integrals - application to complementary error function

Equation Laplace-type integral for large x memorise
Show derivation Expanding g for large x

Substitute , so and :

For large , is small, so Taylor-expand about 0:
This uses and .

Definition Complementary error function
Equation erfc for large x (leading order) memorise

Check: for , the exact value is ; the approximation gives .

Show derivation Large-x behaviour of erfc
  1. Substitute with . This removes from the limits and simplifies the exponent. With we have , and the limits map and :
  2. For large , is small, so by the binomial series
  3. Keeping the leading term:
    From the Stirling section, for , and .
Interactive figure

The curve is approximation ÷ exact value; 1 means perfect. The leading term is 32% too big at but only 5% too big at . Toggle the next term: it is much better for large but useless for , which is typical of asymptotic series.

Figure How good is the erfc asymptote?
Explanation Where does the ‘next term’ in the widget come from?

Keep one more binomial term in step 2: . With this gives

The same procedure gives as many terms as you like.

Explanation How does erfc relate to the erf in the databook?

so . The databook table (p. 11) gives erf, from which erfc follows.

For large , erf is so close to 1 that the subtraction loses all accuracy, which is why the asymptotic formula is useful.

  • Laplace-type integral : substitute , then Taylor-expand , giving .
  • For erfc: substitute to move out of the limits, then expand .
  • Use to integrate every term.

1.6 Limits

1.6.1 Formal definition of the limit of a function

Definition Limit (ε–δ definition)

has limit at if for every there exists such that, for all in the domain of , implies :

(: for all; : there exists; s.t.: such that; : implies.)

Explanation What is the definition actually saying?

Think of it as a challenge. Someone names a tolerance on the output, however tiny. You must always be able to find a window around inside which stays within of . If you can always win, the limit is .

1.6.2 Calculating a limit using the squeeze theorem

Goal: . Bound the function above and below, then squeeze the bounds together.

Take a unit-radius arc subtending angle , with . The figure has points (centre), and (on the arc), and (where the tangent at meets extended).

  • Triangle : base (chord) and height , so area .
  • Sector : the whole circle , scaled by , so area .
  • Triangle : right-angled at , base and height 1, so area .
Interactive figure

The red triangle sits inside the blue sector, which sits inside the green triangle. Each area inequality gives the bound in the same colour on the right. Shrink : both bounds close in on 1.

Figure Squeezing sin x / x
Result Limit of sin x / x memorise
Show derivation From areas to the limit

For :

Hence , or equivalently (renaming ) .

Taking reciprocals inverts the order:

Multiply throughout by , which is valid without flipping because for :
So is bounded above by 1 and below by . As , , so both bounds tend to 1 and is squeezed to 1. (The first line compares three areas in a circle of radius 1 with angle at the centre: the triangle, , fits inside the sector, , which fits inside the triangle formed by the tangent, . Then the Squeeze theorem finishes it.)

Result Squeeze theorem memorise

If for , and , then .

Show derivation beyond this lecture

Pick any tolerance . Close enough to , both and are within of . Then , so is within of too. Since was arbitrary, .

Explanation The argument only used x > 0. What about x → 0 from below?

is even (odd ÷ odd), so its values for equal those for . The limit from the left is therefore also 1. You can see this in Series for sin and cos: contains only even powers.

  • Squeeze: trap between and with the same limit, and has that limit too.
  • , from the areas: triangle sector triangle gives .
  • When multiplying an inequality through, check the sign of the multiplier.

1.6.3 Properties of limits

Result Algebra of limits memorise

If and :

Show derivation beyond this lecture

Sketch, in the same “within ” language as the Squeeze theorem. Sum: , and both terms can be made as small as we like. Product: ; stays near , so both terms go to 0. Reciprocal: , and stays near , so this goes to 0.

The handout’s footnote proves the product rule by –. It is background only and not examined.

Explanation When can’t I split a limit like this?

Only split when each part’s limit exists and is finite (and for ). For example, , but splitting gives , which means nothing.

Indeterminate forms such as , and need the methods of §1.6.5.

1.6.4 Common limits

Result Standard limits (databook) databook p.3
Show derivation
  • : its log is , so the limit is .
  • : each step multiplies by , which falls below once , so the terms shrink faster than .
  • : the ratio of successive terms is , so the terms eventually shrink geometrically.
  • as : write it as () and use L'Hôpital's rule: .

Why each holds:

  • : by the ratio test. Successive ratios tend to , so the geometric decay beats any power of .
  • : these are the terms of the series, which converges for all , so the terms must tend to zero.
  • : for large , , so .
  • : this is a right-hand limit. Put with .
Explanation What are the two substitutions in full?
  • With : as , because the exponential beats any power of .
  • For the limit, take logs: .

Moral: in a race, exponentials beat powers, and powers beat logarithms.

  • All four are in the databook (p. 3). Use them as building blocks.
  • Exponential beats power beats log, so as and for .

1.6.5 Using Taylor series to evaluate limits

Example sin x / x again, by series
Equation L’Hôpital’s rule memorise

For the indeterminate forms or :

If as well, apply the rule again.

Show derivation L’Hôpital’s rule from Taylor series

Expand and about :

If , cancel a factor :
So if , .

Show derivation Why it also works for ∞/∞ (sketch, not a formal proof)

Suppose and , so and . Assume the limits (with ) and (with ) exist. Apply the rule to :

Therefore .

Watch out

L’Hôpital applies only to or . Differentiate the numerator and denominator separately; do not use the quotient rule. Check the form again before every repeated application.

Explanation Series or L’Hôpital: which should I use?

L’Hôpital is quickest when one or two derivatives settle it. Series win when you would need many derivatives of compositions, as in §1.6.6. Series also show how the expression approaches its limit (the next term), not just the value.

  • at : expand top and bottom in Taylor series and cancel the common power of . Or use L’Hôpital, , repeated if needed.
  • L’Hôpital also covers . Rewrite as a quotient first.
Try now

1.6.6 Hard example

Example sin[ln(1+x)] − ln(1+sin x) over x⁴

Find

The denominator is , so expand the numerator up to and discard . From the databook:

First term. Put into . Since , is needed only to :

(The terms cancel: .)

Second term. Put into :

(The coefficient is .)

Subtract and divide:

Interactive figure

Slide towards 0 from either side: the ratio settles on . The slope through 0 is the correction.

Figure Numerical check of L = 1/12
Explanation Why not just use L’Hôpital here?

Both terms vanish to order , so you would need four applications of L’Hôpital. That means fourth derivatives of and : pages of chain and quotient rules.

Series reduce it to bookkeeping. The only skill is deciding up front that everything is needed to , and dropping anything beyond.

  • Look at the denominator’s order first ( here), then expand every piece of the numerator to that order.
  • For compositions, put one series into the other: inner series , so , and only expand as far as needed.
  • If the low orders cancel, you have done it right; the limit is the first surviving coefficient.