L'Hopital's rule

When sketching graphs of functions in Chapter 11, we looked at graphs where the function is undefined for some values of x. The function f (x) = 1/ x, for instance, is not defined when x = 0 and tends to −∞ as x → 0 and tends to +si175_e as x → 0+. Not all functions that have undefined points tend to ±si176_e near the point where they are undefined. For example, consider the function f (x) = sin (x) / x. The graph of this function is shown in Figure 12.5. The function is not defined for x = 0, which we can see by substituting x = 0 into the function expression. This gives a zero in the denominator and hence an attempt to divide by 0 which is undefined. However, we can see from the graph that the function, rather than tending to plus or minus infinity as x → 0, just tends to 1. This is very useful because we are able to ‘patch’ the function by giving it a value at x = 0 and the new function is defined for all values of x.

f12-05-9780750658553
Figure 12.5 The graph of the function f(x) = sin(x)/x.

We can define a new function. This particular function is quite famous, and is called the sinc function

sinc(x)={sin(x)xwherex01wherex=0

si177_e

The points where functions may tend to a finite limit can be identified by looking out for points which lead to 0/0. These are called indeterminate points, indicating that they are a special type of undefined point.

We can examine what happens to the function near the indeterminate point by using the power series expansions of the denominator and numerator. Substituting the series for sin (x)/x into the expression sin (x) gives

sin(x)x=1x(xx33!+x55!x77!)

si178_e

and therefore

limx0sin(x)x=limx01x(xx33!+x55!)?=limx0(1x23!+x45!)

si179_e

The last expression is defined at x = 0, so we can substitute x = 0 in order to find the limit. This gives the value 1. L'Hopital's rule is a quick way of finding this limit without needing to write out the series specifically.

L'Hopital's rule states that if a function f(x) = g(x)/h(x) is indeterminate at x = a then:

limxag(x)h(x)=limxag(x)h(x).

si180_e

If g′ (x) / h′ (x) is defined at x = a, we can then use

limxag(x)h(x)=g(a)h(a)

si181_e

and if g′ (x) / h′ (x) is indeterminate at x = a, we can use the rule again.

We can show this to be true by using Equation (12.13) for the Taylor series expansion about a:

g(x)h(x)=g(a)+g(a)(xa)+(g(a)/2!)(xa)2+···h(a)+h(a)(xa)+(h(a)/2!)(xa)?2+···

si182_e

and given that g(a) = 0 and h(a) = 0

limxag(x)h(x)=limxag(a)(xa)+(g(a)/2!)(xa)2+···h(a)(xa)+(h(a)/2!)(xa)2+···?=limxag(a)+(g(a)/2!)(xa)+···h(a)+(h(a)/2!)(xa)+···?=g(a)h(a)?(ifh(a)0).

si183_e

Example 12.32

Find

limx1x32x2+4x34x25x+1.

si184_e

Solution Substituting x = 1 into

x32x2+4x34x25x+1

si185_e

gives 0/0, which is indeterminate. Using L'Hopital's rule, we differentiate the top and bottom lines:

limx1x32x2+4x34x25x+1=limx13x24x+48x5.

si186_e

We find that the new expression is defined at x = 1, so

limx13x24x+48x5=34+485=33=1

si187_e

Example 12.33

Find

limx0cos(x)1x2.

si188_e

Solution Substituting x = 0 into

cos(x)1x2

si189_e

gives 0/0, which is indeterminate. Therefore, using L'Hopital's rule, we differentiate the top and bottom lines:

limx0cos(x)1x2=limx0sin(x)2x.

si190_e

We find that the new expression is also indeterminate at x = 0, so we use L'Hopital's rule again:

limx0sin(x)2x=limx0cos(x)2.

si191_e

The last expression is defined at x = 0 so we can substitute x = 0 to give

limx0cos(x)2=12.

si192_e

Hence,

limx0cos(x)1x2=12.

si193_e

12.7 Limits and convergence

We have already briefly mentioned ideas of limits in various contexts. We will now look at the idea in more detail. When we looked at the sum to infinity of a geometric progression in Table 12.1 we looked at Sn= 4(1 − (2/3)n) as n was made larger and discovered that S40 = 4 to 7 s.f. and all values of n > 40 also gave Sn= 4 to 7 s.f. This can give us an idea of how to find out if a sequence tends to a limit:

1. Choose a number of significant figures

2. Write all terms in the sequence to that number of significant figures.

3. The sequence tends to a limit if the terms in the sequence, when expressed to the agreed number of significant figures, become constant, that is, do not change after some value of n.

Theoretically, this procedure must work for all possible numbers of significant figures. As my calculator only displays 8 s.f. I cannot go through this process for more than 7 s.f. A computer using double precision arithmetic could perform the calculations to far more (usually up to 18 s.f.).

Consider the series

1+z+z2+z3+···

si194_e

which is a GP with first term 1 and common ratio z, the sum to n terms gives

1zn1z.

si195_e

For z = 1/2 this gives the series

1+12+(12)2+(12)3+

si196_e

and the sum of n terms gives

Sn=1(12)n112=2(1(12)n).

si197_e

We can write, Sn, as a sequence of values to 3 s.f., 5 s.f., and 7 s.f. as is done in Table 12.2.

Table 12.2

The values in the sequence Sn =expressed to 3 s.f. 5 s.f. and 7 s.f. Notice the sequence becomes constant after n = 9 for 3 s.f, after n = 15 for 5 s.f and after n = 22 for 7 s.f.

nSn (3 s.f.)Sn (5 s.f.)Sn (7 s.f.)
1111
21.51.51.5
31.751.751.75
41.881.8751.875
51.941.93751.9375
61.971.96881.96875
71.981.98441.984375
81.991.99221.992188
921.99611.996094
1021.9981.998047
1121.9991.999023
1221.99951.999512
1321.99981.999756
1421.99991.999878
15221.999939
16221.999969
17221.999985
18221.999992
19221.999996
20221.999998
21221.999999
22222
23222

cetable2

From these results we can see that the limit appears to be 2. The limit is reached to 3 s.f for n = 9, to 5 s.f for n = 15, and to 7 s.f for n = 22.

The more terms taken in a sequence which converges, then the nearer we will get to the limit. However we can only get as near as the number of significant figures, usually limited by the calculator, permits. When using a numerical method to solve a problem we use these ideas about convergence.

12.8 Newton–Raphson method for solving equations

Although we already know how to solve linear equations and quadratic equations other equations may need to be solved by using a numerical method. One such method is the Newton–Raphson method. The method consists of an algorithm which can be expressed as follows:

Step 1: take an equation and write it in the form f (x) = 0, then,

Step 2: take a guess at a solution

Step 3: calculate a new value for x using

xxf(x)f(x)

si198_e


Step 4: Repeat Step 3 until come convergence criterion has been satisfied or until it is decided that the method has failed to find a solution. Here, the ‘←’ symbol has been used to represent the ‘assignment operator’.

xxf(x)f(x)

si199_e


means replace x by a value found by taking the old value of x and calculating xf (x) / f′ (x). We will return to the problems in Steps 1 and 4 later; first we will look at a simple example of using the Newton–Raphson method.

Example 12.34

Use Newton–Raphson method to find 5si200_e correct to 7 s.f.

Solution 5si201_e is one solution to the equation x2 = 5

Step 1: Write the equation in the form f(x) = 0

x2=5x25=0

si202_e

Step 2: Take a guess at the solution. We know that 5si203_e is slightly bigger than 4si204_e so take a first guess as x = 2.

Steps 3 and 4: Calculate

xxf(x)f(x)

si205_e

until some convergence criterion is satisfied.

As f(x) = x2 − 5, f′(x) = 2x

xxf(x)f(x)

si206_e

gives

xxx252x.

si207_e

This can be written over a common denominator, giving

xx2+52x

si208_e

which is the Newton–Raphson formula for solving x2 − 5 = 0.

Startwithx=2x4+54x=2.25Substitutex=2.25x(2.25)2+52(2.25)x=2.2361111Substitutex=2.2361111x(2.2361111)2+52(2.2361111)x=2.236068Substitutex=2.236068x(2.236068)2+52(2.236068)x=2.236068

si209_e

We notice that in the last iteration there has been no change in the value of x, so we assume that the algorithm has converged, giving

5=2.236068to7?s.f.

si210_e

The sequence of values we have found is:

2, 2.25, 2.2361111, 2.236068, 2.236068, and we need to stop at this point because the value of x has not changed in the last iteration.

Example 12.35

Find a solution to the equation x3 − 3x2 + 2x + 1 = 0

Solution

Step 1: The equation is already expressed in the correct form.

Step 2: We need to find a first guess for the solution and to do this we could sketch the graph to see roughly where it crosses the x-axis or we could try substituting a few values into the function f (x) = x3 − 3x2+ 2x + 1 and look for a change of sign, which we have done in Table 12.3. As the function is continuous, the function must pass through zero in order to change from positive to negative, or vice versa. There is a change of sign between x = −0.5 and x = 0, so we take as a first guess a point half way between these two values, giving x = −0.25.

Table 12.3

The function f(x) = x33x2 + 2x + 1 evaluated for a few values of x

x−1−0.500.511.52
f(x) = x3 − 3x2 + 2x + 1−7−0.87511.37510.6251

cetable3

Step 3: Using the Newton–Raphson formula

xxf(x)f(x)

si211_e

and substituting f(x) = x3 − 3x2 + 2x + 1 gives

xxx33x2+2x+13x26x+2

si212_e

and simplifying gives

x2x33x213x26x+2.

si213_e

Starting by substituting x = −0.25 gives

x2(0.25)33(0.25)213(0.25)26(0.25)+2=1.218753.6875=0.3305084

si214_e

Now substitute x = −0.3305084 giving

x2(-0.3305084)3-3(-0.3305084)2-13(-0.3305084)2-6(-0.3305084)+2=-0.3247489.

si215_e

Substitute x = −0.3247489 giving

x2(0.3247489)33(0.3247489)213(0.3247489)26(0.3247489)+2=0.3247179.

si216_e

Substitute x = −0.3247179 giving

x2(0.3247179)33(0.3247179)213(0.3247179)26(0.3247179)+2=0.3247179.

si217_e

As the last two numbers are the same to the degree of accuracy we have used, there is no point in continuing. We have thus obtained the sequence of values:

0.25,?0.3305084,?0.3247489,?0.3247179,?0.3247179.

si218_e

Finally, we can check that we have found a good approximation to a solution of the equation by substituting x = −0.3247179 into the function f (x) = x3 − 3x2 + 2x + 1, which gives 2.441 × 10−7. As this value is very close to 0 this confirms that we have found a reasonable approximation to a solution of the equation f (x) = 0.

The convergence criterion

In Examples 12.34 and 12.35 we decided to stop the calculation when the last two values found were equal. We had found the limit of the recurrence relation to 7 s.f. In a computer algorithm, we could test if the last two calculated values of x differ by a very small amount.

Example 12.36

A convergent sequence is defined by a recurrence relation. The calculation should stop when the limit has been found to an accuracy of at least three decimal places. Give a condition that could be used in this case.

Solution Assuming two consecutive terms are xn−1 and xn, then the absolute difference between them is given by |xnxn − 1|. To test whether this is small enough to accept xn as the limit to three decimal places we use the fact that a number expressed to three decimal places could have an absolute error of just less than 0.0005. So the condition we can use to stop the algorithm could be |xnxn − 1| < 0.0005. If this condition is satisfied we could then assume that xn is the limit to three decimal places. To be on the safe side, however, it is better to perform the calculation one final time and check that it is also true that |xn + 1xn| < 0.0005 and then use xn+1 as the value of the limit which should be accurate to at least three decimal places.

Example 12.37

A convergent sequence is defined by a recurrence relation. The calculation should stop when the limit has been found to an accuracy of at least 4 s.f. Give a condition that could be used in this case.

Solution Assuming two consecutive terms are xn−1 and xn then the absolute difference between them is given by |xnxn − 1|. To test whether this is small enough to accept xn as the limit to 4 s.f. use the fact that a number expressed to 4 s.f. can have an absolute relative error of just less than 0.00005. As we do not know that value of the limit we must approximate it by the last value calculated in the sequence, so the absolute relative error is approximately

|xnxn1||xn|

si219_e

so an appropriate condition would be

|xnxn1||xn|<0.00005

si220_e

or

|xnxn1|<0.00005|xn|.

si221_e

As in the previous example it would be preferable to test that this condition holds on at least two successive iterations. Hence, we could also check that

|xn+1xn|<0.00005|xn+1|

si222_e

and take xn+1 as the limit of the sequence correct to four significant figures.

Divergence

A divergent sequence is one that does not tend to a finite limit. Some examples of divergent sequences are:

(i) 1, 0, 1, 0, 1, 0, 1, 0 … which is an oscillating sequence,

(ii) 1, 2, 4, 8, 16… which tends to plus infinity,

(iii) −1, −3, −5,… which tends to minus infinity.

Recurrence relations that are used for some numerical method may not always converge, particularly if the initial value is chosen inappropriately. To check for this eventuality, it is usual to stop the algorithm after some finite number of steps, maybe 100 or 1000 iterations, depending on the problem. If no convergence has been found after that number of iterations then it is considered that sequence is failing to converge.

12.9 Summary

1. A sequence is a collection of objects arranged in a definite order. The elements of a sequence can be represented by a1, a2, a3,…, an,…

2. If a rule exists by which any term in the sequence can be found then this may be used to express the general term of the sequence, usually represented by an or a (n). This rule can also be expressed in the form of a recurrence relation where an+1 is expressed in terms of an, an−1, an−2,…

3. During analog to digital (A/D) conversion, a signal is sampled and can then be represented by a sequence of numbers. f(t) can be represented by a(n) = f(nT), where T is the sampling interval and t = nT. The sampling theorem states that the sampling interval must be less than T = 1/ (2 f) seconds in order to be able to represent a frequency of f Hz.

4. A series is the sum of a sequence. To represent series we may use sigma notation, using the capital Greek letter sigma, Σ, to indicate the summation process, for example,

Σn=0n=1012n

si223_e


means ‘sum all the terms 1/2n for n from 0 to 10'.

5. An arithmetic progression (AP) is a sequence where each term is found by adding a fixed amount, called the common difference, to the previous term. If the first term is a and the common difference is d, then the general term is an = a + (n − 1)d and the sum of the first n terms is given by

Sn=n2(2a+(n1)d)orSn=n2(a+l)

si224_e


where l is the last term in the sequence and n is the number of terms.

6. An geometric progression (GP) is a sequence where each term is found by multiplying the previous term by a fixed amount, called

the common ratio. If the first term is a and the common ratio is r, then the general term is an = arn−1, and the sum of the first n terms is given by

Sn=a(1rn)1r.si225_e

The sum to infinity of a GP can be found if |r| < 1 and is given by

S=a1r.si226_e

7. The binomial expansion gives

(a+b)n=an+nan1b+n(n1)2!an2b2+n(n1)(n2)3!an3b3+

si227_e


where n can be a whole number or a fraction.

8. The Maclaurin series is a series expansion of a function about x = 0. If a function f (x) is defined for values of x around x = 0, within some radius R, that is, for − R < x < R (or |x| < R) and if all its derivatives are defined then:

f(x)=f(0)+f(0)x+f(0)2!x2+f(0)3!x3++f(n)(0)n!xn+

si228_e


This gives a power series with coefficient sequence:

an=f(n)(0)n!

si229_e

where f(n)(0) is found by calculating the nth derivative of f (x) with respect to x and then substituting x = 0.

9. Maclaurin's series is just a special case of Taylor series. A Taylor series is a series expansion of a function not necessarily taken around x = 0. If a function f(x) is defined for values of x around x = a, within some radius R, that is, for a−R < x < a+R (or |x−a| < R) and if all its derivatives are defined, then:

f(x)=f(a)+f(a)(xa)+f(a)2!(xa)2+f(a)3!(xa)3++f(n)(a)n!(xa)n+

si230_e


or, substituting x = a + h, where h is usually considered to be a small value, we get

f(a+h)=f(a)+f(a)h+f(a)2!h2+f(a)3!h3++f(n)(a)n!hn+.

si231_e

10. L'Hopital's rule is a way of finding the limit of a function at a point where it is undetermined (i.e. it gives 0/0 at the point). The

rule states that if a function f (x) = g (x) / h (x) is indeterminate at x = a then:

limxag(x)h(x)=limxag(x)h(x).

si232_e


If g′ (a) / h′ (a) is defined, we can then use

limxag(x)h(x)=g(a)h(a)

si233_e

and if g′ (a) / h′ (a) is indeterminate, we can use the rule again.

11. To test if a sequence tends to a limit follow the following procedure:

(a) Choose a number of significant figures.

(b) Write all the terms in the sequence to that number of significant figures.

(c) The sequence tends to a limit if the terms in the sequence, when expressed to the agreed number of significant figures becomes constant, that is, do not change after some value of n.

This procedure must theoretically work for any chosen number of significant figures.

12. The algorithm for solving an equation using Newton–Raphson method can be described as

Step 1: Take an equation and write it in the form f (x) = 0.

Step 2: Take a guess at a solution

Step 3: Calculate a new value for x using

xxf(x)f(x)

si234_e


Step 4: Repeat Step 3 until some convergence criterion has been satisfied or until it is decided that the method has failed to find a solution.

13. Convergence criteria can either be based on the testing the size of the absolute error or the relative absolute error. To find the limit of a convergent sequence defined by a recurrence relation, correct to three decimal places, we can test for |xnxn−1| < 0.0005 and to be correct to three significant figures we could test for |xnxn−1| < 0.0005|xn|. It is also necessary to put a limit on the number of iterations of some algorithm to check for the eventuality that the sequence fails to converge (is divergent).

12.10 Exercises

12.1. Find the next three terms in the following sequences. In each case, express the rule for the sequence as a recurrence relation.

(a) −3, 1, 5, 9, 13, 17, …

(b) 8, 4, 2, 1, 0.5, …

(c) 18, 15, 12, 9, 6, 3, …

(d) 6, −6, 6, −6, …

(e) 10, 8, 6, 4, …

(f) 1, 2, 4, 7, 11, 16, 22, …

(g) 1, 3, 6, 10, 15, …

12.2. Given the following definitions of sequences write out the first five terms

(a) an = 3n − 1

(b) xn= 720/n

(c) bn= 1 − n2

(d) an+1 = an+ 2; al = 6

(e) an+1 = 3an; a1 = 2

(f) an+1 = −2an; al = −1

(g) bn+1 = 2bn − bn−1; b1 = 1/2, b2 = 1

(h) Δyn = 3; y0 = 2

(i) Δyn = 2yn; y0 = 1.

12.3. Express the following using sigma notation

(a) 1+x+x2+x3+···+x10si235_e

(b) 2+48+16·?·?·+256si236_e

(c) 1+8+27+64+125+216si237_e

(d) 13+19127+16561si238_e

(e) 14+19+116+125+136++1100si239_e

(f) 411411614096.si240_e

12.4. Sketch the following functions and give the first 10 terms of their sequence representation (t ≥ 0) at the sampling interval T given:

(a) f (t) = sin(2t), T = 0.1

(b) f (t) = cos(30t), T = 0.01

(c) f (t) is the periodic function of period 16, defined for 0 ≤ t < 16 by

f(t)={2t0t4162t4<t122t3212<t<16

si241_e


with sample interval T = 1.

(d) The square wave of period 2 given for 0 < t < 2 by

f(t)={10t<111t<2

si242_e


with a sampling interval of T = 0.25.

12.5. The following are arithmetic progressions. Find the fifth, tenth, and general term of the sequence in each case.

(a) 6, 10, 14, …

(b) 3, 2.5, 2, …

(c) −7, −1, 5, …

12.6. an is an arithmetic progression. Given the terms indicated, find the general term and find the sum of the first 20 terms in each case:

(a) a5 = 6, a10 = 26

(b) a7 = −2, a16 = 2.5

(c) a6 = 10, a12 = −8.

12.7. The sum of the first 10 terms of an arithmetic progression is 50 and the first term is 2. Find the common difference and the general term and list the first six terms of the sequence.

12.8 How many terms are required in the arithmetic series 2 + 4 + 6 + 8 + … to make a sum of 1056?

12.9 The following are geometric progressions. Find the fourth, eighth, and general term in each case:

(a) 1, 2, 4, …

(b) 1/3, 1/12, 1/48, …

(c) –9, 3, –1, …

(d) 15, 18.75, 23.4375, …

12.10. an is a geometric progression. Given the terms indicated, find the general term and find the sum of the first 8 terms in each case.

(a) a3 = 8, a6 = 1000

(b) a6 = 54, a9 = −486

(c) a2 = −32, a7 = 1.

12.11. How many terms are required in the geometric series 8 + 4 + 2 + … to make a sum of 15.9375?

12.12. A loan of €40 000 is repaid by annual instalments of €5000, except in the final year when the outstanding debt (if less than €5000) is repaid. Interest is charged at 10% per year, calculated at the end of each year on the outstanding amount of the debt. The first repayment is 1 year after the loan was taken out. Calculate the number of years required to repay the loan.

12.13. Evaluate the following

(a) Σn=1n=42nsi243_e

(b) Σr=0r=812rsi244_e

(c) Σj=1j=10(1)j(13)j2.si245_e

12.14. Find the sum of the first n terms of the following:

(a) 1+z+z2+z3+···si246_e

(b) 1y2+y4···si247_e

(c) 2x+4x+8x2+si248_e

12.15. State whether the following series are convergent and if they are find the sum to infinity.

(a) 2+1+12+14+si249_e

(b) 3+036···si250_e

(c) 279+31···si251_e

(d) 0.3+0.03+0.003···si252_e

12.16. Find the following recurring decimals as fractions:

(a) 0.4˙si253_e

(b) 0.16˙si254_e

(c) 0.02˙.si255_e

12.17. Expand the following expressions

(a) (1+12x)3si256_e

(b) (1x)4si257_e

(c) (x1)3si258_e

(d) (12y)4si259_e

(e) (1+x)8si260_e

(f) (2x+1)3si261_e

(g) (2a+b)3si262_e

(h) (x+(1/x))7si263_e

(i) (a2b)4si264_e

12.18. Find the following using the expansion indicated:

(a) (1.1)3 using (1 + 0.1)3

(b) (0.9)4 using (1 – 0.1)4

(c) (2.01)3 using (2 + 0.01)3.

12.19. Give the first 4 terms in the binomial expansion of the following:

(a) (1+2x)5si265_e

(b) (13x)8si266_e

(c) (2+z)6si267_e

(d) (1+12x)16si268_e

(e) (1x)6si269_e

(f) (12x)5si270_e

12.20. Use sin(5θ) = Im(ej5θ) = Im((cos(θ)+j sin(θ))5) to find sin(5θ) in terms of powers of cos(θ) and sin(θ).

12.21. Find the real and imaginary parts of the following:

(a) (1 − j) 6

(b) (1 + j2)4

(c) (3 + j)5

12.22. Use a binomial expansion to find the following correct to four decimal places:

(a) (0.99)8

(b) (1.01)7

(c) (2.05)6.

12.23. Find the first 4 non-zero terms in a power series expansion of the following functions and state for what values of x they are valid in each case.

(a) cos(x)

(b) cosh(x)

(c) ln(1 + x)

(d) (l+x)1.5

(e) (1 + x)−2.

12.24. Find the first 4 non-zero terms in a power series expansion for the following functions:

(a) cos2(x)

(b) tan−1(x)

(c) ex sin(x)

(d) (1 − x)1.5/(1 + x).

12.25. Using a series expansion find the following correct to 4 significant figures:

(a) 1.05si271_e

(b) tan1(0.1)si272_e

(c) sin(0.03)si273_e

(d) 1/1.06si274_e

12.26. Using a series expansion and the given value of the function at x = a, evaluate the following correct to four significant figures:

(a) cos(7π/16)usingcos(π/2)=0,si275_e,

(b) 4.02using4=2.si276_e

12.27. Find the following limits:

(a) limx2((x2x2)/(4x34x7x2))si277_e

(b) limx0(x3/(xsin(x)))si278_e

(c) limx3((x2+6x+9)/(4x2+11x3))si279_e

(d) limxπ/2((π/2x)/cos(x))si280_e

(e) limx0(tan(x))/x)si281_e

(f) limx0(sin(x2)/(x24x+4)).si282_e

12.28. Use the Newton–Raphson method to find a solution to the following equations correct to six significant figures:

(a) x32x=1si283_e

(b) x4=5si284_e

(c) cos(x)=2x.si285_e

12.29. Suggest a test for convergence that could be used in a computer program so that the limit of a sequence, defined by some recurrence relation, could be assumed to be correct to

(a) six decimal places,

(b) six significant figures.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.92.147