Академический Документы
Профессиональный Документы
Культура Документы
PROBLEM 01 – 0001: The digital computer is a basic tool used in arriving at the
Input:
Magnetic tape, paper tape, and punched cards are the common
media for carrying information (data and program) from the outside world
Figure 2 displays two punched cards and a piece of punched paper tape.
The input mechanism of the computer is able to receive information from
cards and tape by reading the punched holes. A particular computer may
have only the mechanism for reading cards; another computer may be
able to read from both cards and paper tape. Card (a) Fig. 2 is typical of a
data card containing two pieces of data. On the other hand, card (b)
paper.
Memory:
numerical form. Of course, the sign and the decimal associated with the
Control Unit:
In this very brief look into how the digital computer operates, many
PROBLEM 01 – 0002:
In Algebra the expression N = N + 1 is meaningless, however, it is meaningful in Fortran. Explain.
Solution:
It means "take the value stored under the name N, add 1 to it, and store the result under the name N
again."
PROBLEM 01 – 0003:
Given a sequence of n numbers, x1, x2,…, xn, find the largest and the smallest number of this sequence and
write out the results.
Solution:
The figure shown is a flow chart for the solution of this problem. The READ statement reads the number n
into the location N and the numbers x1, x2,…, xn into the vector X. Locations XMAX and XMIN are next set
equal to X(1). The iteration statement sets up control for doing the operations that follow up to α for 1 = 2,
3,…,N. The first time through the loop XMAX is compared with X(2) (I = 2). If X(2) is greater than XMAX, then
X(2) is placed in XMAX; if it is equal to XMAX, control is sent directly to the end of the iteration loop. If X(2)
is less than XMAX, it is compared with XMIN, which contains X(1). If X(2) is less than XMIN, it is placed in
XMIN. If it is greater than or equal to XMIN , control is sent to the end of the iteration loop. The same
sequence of operations is then carried out using X(3). This continues for each I up to and including I = N.
Clearly when the iterations are completed, the contents of XMAX will have been compared with every
number and the largest retained in XMAX.
XMIN will likewise contain the smallest of the sequence. The
contents of XMAX and XMIN are then written out.
PROBLEM 01 – 0004: Construct a flow chart that will find the sum of a sequence of
numbers represented by a1, a2,…, an.
Solution:
This addition operation on the computer is done by finding first the partial sum of a1 + a2, then a1 + a2 + a3,
and so on, until each number has been added to the partial sum to obtain the total. Either of the two flow
charts in the accompanying figure will accomplish the necessary operations, the two solutions being the
same except for the control statements.
The first symbol in every flow chart is START. It indicates that appropriate control statements are to be
placed ahead of the program for proper initiation of the machine. The READ statement means that the
number n is read into a location labeled N and that the sequence of numbers a1, a2,…, an is read into the
locations labeled A(1), A(2),..., A(N).
The shorthand notation in this box will be used frequently. The
number in location N indicates the number of items in the set. A(1),…,
A(N) contain the numbers a1,…, an, respectively. The next statement is the
first arithmetic statement and places a floating-point zero in the contents of
a location called SUM.
The iteration statement in Figure (b) says to do the statements
between the box and the circle (in this case there is only one statement) N
times, the first time for I = 1, the second time for I = 2, etc., and the last
time for I = N. The box within the range of this iteration says to take the
current value of SUM, add the number in the location A(1), using the
current value of I, and store the result back into SUM. The first time
through the iteration this adds zero (SUM was initially set to zero) and A(1)
and stores the result, A(1), in SUM. The second time through the iteration,
this statement adds A(1), the current value of SUM, and A(2) , storing the
result, A(1) + A(2) , in SUM. The third time through the iteration, it adds
SUM [currently A(1) + A(2)] to A(3) and stores the result,
A(1) + A(2) + A(3) , back into SUM. Each time through the iteration, the
statement updates SUM by the next number in order from the set of
numbers A(1), A(2),…, A(N). At the conclusion of the iterations the
location SUM contains the sum of all the numbers A(1) through A(N).
In Fig. (a) the iteration is controlled by a logic statement and
illustrates the functions performed by the iteration statement. The integer 1
is placed into location I ahead of the loop. Then A(1) is added to the
contents of SUM, which is zero prior to this operation. SUM now contains
A(1). The logic statement tests the sign of I – N. If it is negative or equal to
zero, I is updated by 1, and control is returned to the arithmetic statement.
This sequence of operations is continued until I – N is greater than zero, at
which point SUM is written out.
The last box in each chart says to display the number in SUM on
the output. This is the conclusion to the problem.
The flow chart is completed with a STOP.
PROBLEM 01 – 0005: Find the sum of the first n terms in the Taylor-series
expansion for ex.
CONTENTS CHAPTER PREVIOUS NEXT PREP FIND
PROBLEM 01 – 0005: Find the sum of the first n terms in the Taylor-series
expansion for ex.
Solution: ex = 1 + x + (1/ 2!) x2 + (1/ 3!) x3 + … + [{xn–1} / {(n – 1)!}]
The arithmetic operations needed for evaluating this sum are simplified by
noting that the (i + 1)st term in the series is obtained from the ith term by
multiplying by (x/i). The second term is equal to 1 ∙ (x/1), and the (i + 1)st
term is equal to the product of
[{xi–1} / {(i – 1)!}] and (x/i)
The flow chart for the problem is shown in the figure. Numbers for
N and X are read into the machine. Locations TERM and EXPX, set to
contain floating point 1.0, will be used to store the results of the
computations. The iteration loop sets up control to repeat the operations to
a for I = 1, 2,..., N – 1. The first statement in the loop gives the next term in
the series by updating the previous term. The first time through the loop
TERM contains 1.0, which is multiplied by (x/1), and then stored back in
TERM, so that TERM now contains the second term of the series. Each
time through the loop TERM is updated, so that it contains the (i + 1)st
term in the series. The last statement in the loop adds the contents of
TERM to the contents of EXPX to give the partial sum of the first i + 1
terms of the series. The first time through the loop EXPX contains 1.0, and
TERM contains (x / 1.0) when this statement is executed. The updated
contents of EXPX are 1.0 + (x / 1.0), which is the sum of the first two terms
of the series. When the iteration has been completed n – 1 times, EXPX
contains the sum of the first n terms of the series. Note that the integer I is
used in a floating-point computation. Such statements may not be
acceptable in computer programs but are permitted here for convenience.
Solution: f(x) = 1∫0 [xt – {(x3t3) / (3!)} + … + (– 1)n–1 [{(xt)2n–1} / {(2n – 1)!}]
+ (– 1)n [{(xt)2n–1} / {(2n + 1)!}] cos {ξxt}] dt
= n∑j=1 (– 1)j–1 [{x2j–1} / {(2j – 1)! (2j)}]
+ (– 1)n [{x2n–1} / {(2n + 1)!}] 1∫0 t2n–1 cos {ξxt} dt
with {ξxt} between 0 and xt. The integral in the remainder is easily bounded
by [1 / (2n + 2)]; but one can also convert it to a simpler form. Although it
wasn’t proven, it can be shown that cos(ξxt) is a continuous function of t.
Then applying the integral mean value theorem,
∫0 sin(xt)dt = n∑j=1 (– 1)j–1 [{x2j–1} / {(2j – 1)! (2j)}]
1
PROBLEM 01 – 0007: Consider a routine for evaluating F(x); and, let F*(x) denote
the computed result obtained by the program as a
approximation to F(x). Evaluate by the experimental method
a probable error in the computed result.
PROBLEM 01 – 0007: Consider a routine for evaluating F(x); and, let F*(x) denote
the computed result obtained by the program as a
approximation to F(x). Evaluate by the experimental method
a probable error in the computed result.
Solution: Take a quantity SUM, make it equal to zero, and then add the
quantity 0.0001 to it 10,000 times, and the answer is 1,00000000, exactly.
If one runs this program on a typical computer, the answer is likely
to be
0.99935269
Granted that the error may be small– –only 0.00065 or so, or about 0.065
percent– –still, the answer is wrong. It certainly destroys the notion of a
computer's infallibility, and creates concern about the results of other,
more complicated calculations.
PROBLEM 01 – 0009: Solve the following two simultaneous equations for x1 and
x2, and formulate the equations for the computer.
A11 X1 + A12 X2 = C1
A21 X1 + A22 X2 = C2
CONTENTS CHAPTER PREVIOUS NEXT PREP FIND
PROBLEM 01 – 0009: Solve the following two simultaneous equations for x1 and
x2, and formulate the equations for the computer.
A11 X1 + A12 X2 = C1
A21 X1 + A22 X2 = C2
TABLE
Equivalent Symbols
Algebraic Fortran Algebraic Fortran
A11 A11 C1 C1
A12 A12 C2 C2
A21 A21 X1 X1
A22 A22 X2 X2
Solution:
Mathematics FORTRAN
(a) X=A+B•C X=A+B*C
(b) I = (J/2)4 I = (J/2)** 4
(c) Z = √[sin x] Z = SQRT(SIN{X})
(d) X ∙ (B )
D
X * (B ** D)
(e) [{DE} / F] – G [{D**E} / {F–G}]
(f) DE/(F–G) D**(E / (F–G))
Solution:
Mathematics FORTRAN
(a) X=A+B•C X=A+B*C
(b) I = (J/2)4 I = (J/2)** 4
(c) Z = √[sin x] Z = SQRT(SIN{X})
(d) X ∙ (BD) X * (B ** D)
(e) [{D } / F] – G
E
[{D**E} / {F–G}]
(f) DE/(F–G) D**(E / (F–G))
Number Representations
PROBLEM 01 – 0012: In the computer the binary number system is used as
opposed to the decimal number system used by humans to
execute arithmetic operations. However, in both systems,
there are some similarities and differences. Contrast and
compare the two systems.
Solution:
a) 1 1 0 1 1 1 0 1 12 may be converted into base 10 by considering this fact: Each digit in a base two number
may be thought of as a switch, a zero indicating "off", and a one indicating "on". Also note that each digit
corresponds, in base 10, to a power of two. To clarify, look at the procedure:
28 27 26 25 24 23 22 21 20
1 1 0 1 1 1 0 1 12
b) 4578 may be converted into base two by using the notion of triads.
Triads are three-bit groups of zeros and ones which correspond to octal (base 8) and decimal (base 10)
numbers. This table can, with some practice, be committed to memory:
Now, convert to octal using this procedure: Divide 8, the base to be used, into 1971. Find the remainder
of this division and save it as the first digit of the new octal number. Then divide 8 into the quotient of
the previous division, and repeat the procedure. The following is an illustration:
8 1971
– 1968
3 → 3 246 × 8 = 1968
246
– 240
6 → 6 30 ×8 = 240
30
– 24
6 → 6 3 × 8 = 24
3 → 3 3 ÷ 8 ≠ an integer
160 × 9 = 9
0
Solution: a) To convert base 2 to base 8, use the triad method where three
digits are taken together and converted to equivalent decimal value; this
results in base 8 conversion
|0 1 0| |0 1 1| |0 1 0|2 = 2328
Similarly for hexadecimal conversion 4 bits are taken together. Zeros ar
assumed for most significant grouping.
|0 0 0 0| |1 0 0 1| |1 0 1 0| = 9A16.
For binary to decimal conversion
1 0 0 1 1 0 1 0
1×27 + 0×26 + 0×25 + 1×24 + 1×23 + 0×22 + 1×21 + 0×20
128 + 0 + 0 + 16 + 8 + 0 + 2 + 0 = 15410
b) i) 101 . 1012 = 5 . 58
ii) [{0101} / 5] . [{10102} / A] = 5 . A16
iii) 101 . 1012
(1 × 22 + 0 × 21 + 1 × 20) . (1 × 2–1 + 0 × 2–2 + 1 × 2–3)
= 4 + 0 + 1 + 0.5 + 0 + 0.125 = 5 . 62510
c) i) 0 . 0011 = |000| . |001| |100| = 0 . 148
ii) 0 . 0011 = |0000| . |0011| = 0 . 316
iii) 0 . 0011 = . (0 × 20 + 0 × 2–1 + 1 × 2–3 + 1 × 2–4)
= 0 + 0 + 0 + 0.125 + 0.0625 = 0.187510
Note in this column the decimal sum is less than 16, and no units of
sixteen are carried.
For col. 1:
Hex → Decimal → Decimal Sum → Hex Sum
8 8 8
D 13 13
21 → 16 + 5
Here the decimal s-um is greater than 16. After factoring out the units of
sixteen (here only one), the remaining digit should be placed in this
column.
For col. 2:
Hex → Decimal → Decimal Sum → Hex Sum
E 14 14
1 1 1
15
+1 (form col.1)
16 → 16 + O
One unit of sixteen can be factored out, leaving zero as the remaining digit
for col. 2.
For col. 3:
Hex → Decimal → Decimal Sum → Hex Sum
6 6 (6/6)
+1 (form col.2)
7 → 7
Thus, the final result is:
6E88
+1D3
705B
Subtraction: In the subtraction procedure the units of sixteen are borrowed instead of being carried.
Example 2:
For col. O
Hex → Decimal → Decimal → Hex Difference
Difference
E 14 14
8 8 –8
6 → 6
For col. 1:
Hex → Decimal → Decimal → Hex Difference
Difference
5 5 (5) + 16 (Borrowed unit from col.2)
B 11 11
10 → A
The difference in col.2 is zero since one unit was borrowed from 3. The
final result is:
2 + 16
3 5 E
– 2 B 8
A 6
Solution:
a) The binary groups are used to replace individual digits, as indicated:
7 6 4 3 0 1
↓ ↓ ↓ ↓ ↓ ↓
111 110 100 011 000 001
TABLE OP CONVERSION
Decimal Octal Binary
1 1 1 (or 001)
2 2 10(or 010)
3 3 11(or 011)
4 4 100
5 5 101
6 6 110
7 7 111
8 10 1000
9 11 1001
10 12 1010
11 13 1011
12 14 1100
13 15 1101
14 16 1110
15 17 1111
16 20 10000
The resulting number is the required binary number. Some additional insight into the process can be
obtained from the following diagram, which illustrates for the integral part the values of the numbers in
decimal form:
7 6 4
↓ ↓ ↓
7 × 82 6 × 81 4 × 80
↓ ↓ ↓
7 × 26 6 × 23 4 × 20
↓ ↓ ↓
(1×22+1×21+1×20)×26 (1×22+1×21+0×20)×23 (1×22+0×21+0×20)×20
↓ ↓ ↓
1×28+1×27+1×26 1×25+1×24+0×23 1×22+0×21+0×20
↓ ↓ ↓
111 110 100
b) Grouping the digits by threes, starting from the binary point, we have
11 011 . 101 11
It is necessary to introduce an additional zero in the first group and last group in order to have three
binary bits in each group, thus:
011 011 . 101 110
Each of these groups is now replaced by its octal equivalent, giving 33.568
Solution:
Fortran Rules And Vocabulary
PROBLEM 01 – 0019: Using FORTRAN rules what would be the value of sum in
each case ?
a) SUM = 3 – 1 + 5 * 2/2
b) SUM = (4 – 2) ** 2
c) SUM = 9 ** 2 + 9/2 ** 2
d) SUM = [[{(1 + 2) / (2 * 5)} * (10/2) + 7] / 3]
PROBLEM 01 – 0019: Using FORTRAN rules what would be the value of sum in
each case ?
a) SUM = 3 – 1 + 5 * 2/2
b) SUM = (4 – 2) ** 2
c) SUM = 9 ** 2 + 9/2 ** 2
d) SUM = [[{(1 + 2) / (2 * 5)} * (10/2) + 7] / 3]
PROBLEM 01 – 0022: Pick out the errors in the following FORTRAN statements
and explain briefly why they are incorrect:
a) RESULT = SUM / FLOAT (NUM) + 2ERR
b) IF (M* (N/M) = N) GO TO 20
c) INTEGER CAPITAL, COST, INCOME
d) AREA = LENGTH * WIDTH
e) TAU = BETA / – 3.0
PROBLEM 01 – 0022: Pick out the errors in the following FORTRAN statements
and explain briefly why they are incorrect:
a) RESULT = SUM / FLOAT (NUM) + 2ERR
b) IF (M* (N/M) = N) GO TO 20
c) INTEGER CAPITAL, COST, INCOME
d) AREA = LENGTH * WIDTH
e) TAU = BETA / – 3.0
Solution: The errors in each of the approximations are plotted in the figure.
The errors in both approximations have nearly equal positive and negative
peaks. However, the error in g2 (x) is distributed much more uniformly over
the interval. (The error in g1(x) is distributed quite uniformly over the
interval – 1 ≤ x ≤ 1 for which it was con true ted, but g1(x) tends to
overestimate ex on much of 0 ≤ x ≤ 1). The magnitude of the maximum
error of g1(x) is approximately 0.054, while that of g2(x) is approximately
0.0101, or only about 1/5 that of g1(x). It is almost inevitable that the
quadratic g1(x) which must provide a good approximation over the interval
– 1 ≤ x ≤ 1 will have a larger maximum error than will an approximation of
the same type (g2(x)) which is constructed to serve as a good
approximation over an interval only half as large (0 ≤ x ≤ 1) . It would be
necessary to employ an economized approximation of higher degree than
2 in order to obtain the same accuracy on – 1 ≤ x ≤ 1 that g2(x) provides
on 0 ≤ x ≤ 1. It should be apparent that the simplest, most effective
approximations can be obtained by restricting the interval of approximation
to the absolute minimum size required.
Table 1
Operation Result Actual Value
x (+) y .9047 (19 / 21)
x (–) Y – .2381 – (5 / 21)
x (×) y .1904 (4 / 21)
x (÷) y .5833 (7 / 12)
Table 3
Operation Result Actual Value Absolute Relative Error
Error
a (+) b 4271 4271.5711 .5711 .1123 × 10-3
(a (–) y) (÷) c – .003 – .000328 .00267 8.1445
Note that the absolute error in a (+) b is large, while the relative error is
small because we divide by a large actual value.
One should exercise caution in arranging the arithmetic operations
and avoiding multiplication by large numbers (or division by small
numbers) and subtraction of two numbers nearly equal.
PROBLEM 02 – 0028:
Let x be a real number and F(x)it's floating–point k–digit representation. For example, if x = (2/9)
and k = 4, then F(2/9) = .2222. The operations of addition, subtraction, multiplication and division
are defined as follows:
x (+) y = F[F(x) + F(y)]
x (–) y = F[F(x) – F(y)] (1)
x (×) y = F[F(x) × F(y)]
x (÷) y = F[{F(x)} / {F(y)}]
Compute the absolute error and relative error for the operations defined in (1) for x = (1/3), y =
(4/7). For arithmetic calculations apply 4–digit chopping. Suppose
a = .5711, b = 4271, c = .1001 × 10–3, compute
a (+) b
(a (–) y) (÷) c (2)
and the corresponding absolute errors and relative errors.
Table 1
Operation Result Actual Value
x (+) y .9047 (19 / 21)
x (–) Y – .2381 – (5 / 21)
x (×) y .1904 (4 / 21)
x (÷) y .5833 (7 / 12)
Table 2
Operation Result Actual Value
x (+) y .6190 × 10–4 .6842 × 10–4
x (–) Y .4762 × 10–5 .2 × 10–4
x (×) y .7619 × 10–4 .4 × 10–3
x (÷) y .3333 × 10–4 .5714 × 10–4
Table 3
Operation Result Actual Value Absolute Relative Error
Error
a (+) b 4271 4271.5711 .5711 .1123 × 10-3
(a (–) y) (÷) c – .003 – .000328 .00267 8.1445
Note that the absolute error in a (+) b is large, while the relative error is
small because we divide by a large actual value.
One should exercise caution in arranging the arithmetic operations
and avoiding multiplication by large numbers (or division by small
numbers) and subtraction of two numbers nearly equal.
PROBLEM 02 – 0030: Use exact, chopping and rounding to evaluate the following:
f(x) = x3 – 4x2 + 2x – 2.2 at x = 2.41.
For chopping and rounding, apply three–digit arithmetic.
Compute the relative errors. To decrease their values, try to
carry out the same calculations for the same polynomial, but
written in a different form.
Solution: The numerical data necessary for the solution of the problem are
summarized in the following table.
x x2 x3 4x2 2x
exact 2.41 5.8081 13.997521 23.2324 4.82
3–digit 2.41 5.80 13.9 23.2 4.82
chopping
3–digit 2.41 5.81 14.0 23.2 4.82
rounding
Note that the three-digit chopped numbers retain the leading three digits
and may differ from the three-digit rounded numbers. For example, if
x = 14.7124, then Xchopped = 14.7, and Xrounded = 14.7. On the other hand, if
x = 14.7824, then Xchopped = 14.7. Xrounded = 14.8.
We obtain
f(2.41)exact = 13.997521 – 23.2324 + 4.82 – 2.2
= – 6.614879
f(2.41)chopped = 13.9 – 23.2 + 4.82 – 2.2
= – 6.68
f(2.41) rounded = 14.0 – 23.2 + 4.82 – 2.2
= – 6.58
The corresponding relative errors are:
relative error, 3-digit chopping = [{– 6.614879 + 6.68} / {– 6.614879}]
= .0098
relative error, 3-digit rounding = [{– 6.614879 + 6.58} / {– 6.614879}]
= .0052
In order to obtain smaller values for the relative errors we can write f(x) in
an equivalent form
f(x) = x[x(x – 4) + 2] – 2.2
Then, the exact value of f(x) at x = 2.41 is, of course, the same, but
f{2.41)chopped = 2.41[2.41(2.41 – 4) + 2] – 2.2
= 2.41[– 3.83 + 2] – 2.2
= – 4.41 – 2.2
= – 6.61
f(2.41)rounded = 2.41[2.41(2.41 – 4) + 2] – 2.2
= – 6.61
The relative error for both values is now
[{– 6.614879 + 6.61} / {– 6.614879}] = .00073
The relative error is now much smaller. The reason for this is that there is
a decrease in the number of error-producing computations. Note that in
x3 – 4x2 + 2x – 2.2, we had five multiplications and three additions, while in
x[x(x – 4) + 2] – 2.2, we had two multiplications and three additions.
PROBLEM 02 – 0031: When one gives the number of digits in a numerical value
one should not include zeros in the beginning of the number,
as these zeros only help to denote where the decimal point
should be. If one is counting the number of decimals, one
should of course include leading zeros to the right of the
decimal point.
For example, 0.001234 ± 0.000004 has five correct
decimals and three significant digits, while 0.001234
± 0.000006 has four correct decimals and two significant
digits.
The number of correct decimals gives one an idea of the
magnitude of the absolute error, while the number of
significant digits gives a rough idea of the magnitude of the
relative error.
Consider the following decimal numbers: 0.2397, – 0.2397,
0.23750, 0.23650, 0.23652. Shorten to three decimals by the
Round–off and Chopping methods.
Solution: Multiplying the first equation by – 200 and adding the result to the
second equation, one gets
– 7.98 × 104 y = – 15.9 × 104.
This gives the approximate value of 1.99 for y. Substitution of this
value in the first equation yields the approximate value x = 5. The relative
error in the value for x is 400% since the correct solution is (1, 2). The
problem here lies in the equation x = 801 – 400y. Any rounding error in y
(in this case 0.01) gets magnified by a factor of 400, which can be quite
significant because x is small.
PROBLEM 02 – 0033: Scaling is one way to get around errors that can be caused
by improportionate computations. Scale the system
x + 230y + 34602 = 20,000
30x + 5y + 0.1z = 300 (1)
0.001x + 0.002y + 0.003z = 7,
by columns.
Hint: Column scaling is similar to row scaling except that it
alters the solution. For example, if the first column is divided
by 10, then the new solution will be in terms of 10x1 instead
of x1.
Methods Of Approximation
where
Pn(x) = a + a1(x – x0) + a2(x – x0)2 + ... + an(x – x0)
to derive the formula for the Euler's Constant.
Solution: n–1∑
k=0 [1 / {k + 1}] = In n + (1/2) [1 + (1/n)]
– n–1∫0 [{P1(x)} / {x + 1}2]dx
Here P1(x) is a polynomial used to approximate the function of x.
Since
|P1(x)| ≤ (1/2)
for every x and
k+1∫ [{P1(x)} / {x + 1}2]dx < 0,
k
then
0 > n–1∫0 [{P1(x)} / {x + 1}2]dx ≥ – (1/2) n–1∫0 [1 / {x + 1}2]dx
= – (1/2) [1 – (1/n)].
It follows that
∞∫ [{P1(x)} / {x + 1}2]dx = limn→∞ n–1∫0 [{P1(x)} / {x + 1}2]dx
0
Solution: Since
F(n+1)(x) = (– 1)n+1(In 16)n+1 16–x,
one gets m ≤ ± F(n+1)(x) ≤ M for all x in [0, a],
where
m = 16–a(In 16)n+1
and
M = (In 16)n+1,
thus satisfying the condition of the theorem, it follows that
[{16–a(In 16)n+1 an+1} / {22n+1(n + 1)!}] ≤ max[0, a] |Pn*(x) – 16–x|
≤ [{(In 16)n+1 an+1} / {22n+1(n + 1)!}]
Applied directly, the theorem cannot give bounds for
max[0, a] |{Qn*(x) – 16–x} / {16–x}|.
With the additional analysis shown below, however, one can also obtain
such bounds.
max[0, a] |{Qn*(x) – 16–x} / {16–x}| ≥ max[0, a] |Qn*(x) – 16–x|
≥ max[0, a] |Pn*(x) – 16–x|
≥ [{16–a(In 16)n+1 an+1} / {22n+1(n + 1)!}]
Likewise,
max[0, a] |{Qn*(x) – 16–x} / {16–x}| ≤ max[0, a] |{Pn*(x) – 16–x} / {16–x}|
≤ 16a max[0, a] |Pn*(x) – 16–x|
≤ [{16a (In 16)n+1 an+1} / {22n+1(n + 1)!}]
Therefore
[{16–a(in 16)n+1 an+1} / {22n+1(n + 1)!}] ≤ max[0, a] |{Qn*(x) – 16–x} / {16–x}|
≤ [{16a (In 16)n+1 an+1} / {22n+1(n + 1)!}].
TABLE 1
After x2 x1 a0 a1 a2 μ
iteration
0 .400000 .800000 — — — —
1 .137582 .692428 .171896 1.339080 – .525123 – .014147
2 .146345 .588965 .170415 1.453820 – .659052 – .034816
3 .148921 .590636 .171509 1.442061 – .649966 – .036396
4 .148917 .590599 .171509 1.442106 – .650022 – .036407
Table 1 shows the results of four iterations with Remez' method. The
numbers shown in this table have been rounded to six decimal places.
Values of the iterates converged to six decimals in these four iterations.
Solution: Since
cos (1/4) πx
is an even function and since *the approximation interval is symmetric
about the origin, P7*(x) contains only even-degree terms.
Let
P7*(x) = a0* + a2*x2 + a4*x4 + a6*x6.
The absolute-err or function P7*(x) – cos (1/4) πx is a standard error
function. It is also an even function, and its nine critical points are
therefore symmetrically located about the origin. That is,
– x1* = a9*, – x2* = x8*, – x3* = x7* – x4*, = x6*
and
x3* = 0.
If the starting values in step 1 of Remez' method are chosen so that
analogous conditions hold, then this symmetry be preserved throughout
subsequent iterations, and the odd- degree coefficients of P7(x) in step 2
will be zero on every iteration. Taking advantage of these facts, apply
Remez method in the following way:
Step 1) Because of the symmetries mentioned above, it is necessary to
use only x5, x6, x7 x8, and x9. For initial values use (1), that is,
xk = cos [{(9 – k)π} / {8}],
k = 5, 6, 7, 8, 9.
Step 2) The system of linear equations
a0 + a1xk + ... + anxkn – (– 1)kμ = F(xk),
k = 1, 2,..., n + 2,
for the n + 2 unknowns a0, a1,..., an, and μ,
simplifies to the followings
a0 + a2x52 + a4x54 + a6x56 + μ = cos (1/4) πx5
a0 + a2x62 + a4x64 + a6x66 – μ = cos (1/4) πx6
a0 + a2x72 + a4x74 + a6x76 + μ = cos (1/4) πx7
a0 + a2x82 + a4x84 + a6x86 – μ = cos (1/4) πx8
a0 + a2x92 + a4x94 + a6x96 + μ = cos (1/4) πx9.
On each iteration this system of equations is solved numerically ,by
means of Gaussian elimination.
Step 3) Since P7(x) – cos (1/4) πx is an even function, its extreme points
are distributed symmetrically about the origin. Therefore, as was said
earlier, it is necessary to locate only y5, y6, y7, y8, and y9. On every
iteration y5 = 0 and y9 = 1. To obtain y6, y7, and y8, differentiate the
absolute-error function P7(x) – cos (1/4) πx and compute the zeros of the
derivative. This can be done by isolating each yk by searching and then
computing it accurately by bisection. Since the starting values chosen for
step 1 are very good, yk is always close to xk and can be isolated easily by
searching near xk.
Because the initial choices for the xk's happen to be very accurate, after
only one iteration a0, a2, a4, a6, and μ become stabilized to ten decimal
places. The xk's do not converge quite so rapidly. The results after one
iteration are shown below, rounded to ten decimal places.
a0 = .9999999724 a6 = – .0003188805
a2 = – .3084242536 μ = .0000000276
a4 = .0158499153
PROBLEM 02 – 0043: Develop the power series expansion of cos (1/4) πx.
Solution: cos (1/4) πx = ∞∑k=0 [{(– 1)k {(1/4) π}2k} / {(2k)!}] x2k
= 1 – .3084251375x + .0158543442x4*
– .0003259919x6 + .0000035909x8 – .0000000246x10
+ ... ,
where the coefficients have been rounded to ten decimal places. Let P6(x)
denote the polynomial of degree six obtained by truncating this series after
the fourth term, and consider this polynomial as an approximation to cos
(1/4) πx for – 1 ≤ x ≤ 1. Graphs of the absolute-error function P6(x) – cos
(1/4) πx and the relative-error function
[{P6(x) – cos (1/4) πx} / {cos (1/4) πx}]
for 0 ≤ x ≤ 1 are shown in the figure. For both absolute error and relative
error, the magnitude of the error is greatest when x = 1. Simple
calculations show that the maximum absolute error is approximately .357
(10–5) and that the maximum relative error is approximately .504(10–5)
Solution: Approximate numerical values for p0*, p2*, p4*, and. Q2* need to be
computed. Since the absolute-error function for this approximation is an
even function, too, the nine critical points are symmetrically located about
the origin. That is,
– x1* = x9*, – x2* = x8*, – x3* = x7*, – x4* = x6*, and x5* = 0.
Choose the starting values xk, k = 1, 2, ..., 9, so that similar conditions hold
for them; then this will continue to be true on every iteration of Remez'
method, and the odd–degree coefficients of R5,2(x) in step 2 will vanish on
every iteration. Now apply the steps in Remez' method in the following
way:
Step 1) Because of the symmetries mentioned above, one needs to us
only x5, x6, x7, x8, and x9. Using
xk = (1/2) (b – a) cos [{(m + n + 2 – k)π} / {m + n + 1}] + (1/2) (b – a),
k = 1, 2, ..., m + n + 2,
to determine starting values, one gets
xk = cos [{(9 – k)π} / {8}], k = 5, 6, 7, 8, 9.
Step 2) The system of nonlinear equations
p0 + p1xk + ... + pmxkm + q1xk [– F(xk) – (–1)kμ] + q2xk2 [– F(xk)
– (–1)kμ] +...+ qnxkn [– F(xk) – (–1)kμ] – (– 1)k μ = F(xk),
k = 1, 2, 3,..., m + n + 2,
for the m + n + 2 unknowns p0, p1,..., pm, q1, q2,..., qn, and μ; becomes
p0 + p2x52 + p4x54 + q2x52 (– cos (1/4) πx5 + μ) + μ = cos (1/4)πx5
p0 + p2x62 + p4x64 + q2x62 (– cos (1/4) πx6 + μ) + μ = cos (1/4)πx6
p0 + p2x72 + p4x74 + q2x72 (– cos (1/4) πx7 + μ) + μ = cos (1/4)πx7
p0 + p2x82 + p4x84 + q2x82 (– cos (1/4) πx8 + μ) + μ = cos (1/4)πx8
p0 + p2x92 + p4x94 + q2x92 (– cos (1/4) πx9 + μ) + μ = cos (1/4)πx9
On each iteration with Remez' method, this system is solved for p0, p2,
p4, q2, and μ by the iterative method.
Step 3) Since the absolute–error function R5,2(x) – cos (1/4) πx is an even
function, it is sufficient to locate its extreme points in [0, 1], instead of
[– 1, 1]. The coefficients of R5,2(x) are the numbers obtained in step 2.
Always have y5 = 0 and y9 = 1. To obtain y6, y7, and y8, differentiate the
error function and compute the zeros of the derivative. This can be done
by isolating each yk by searching and then computing it accurately by
bisection. Since the starting values for the xk's chosen in step 1 happen to
be very good, yk is close to xk on every iteration and can easily be isolated
by searching in the neighborhood of xk.
Results after two iterations with Remez' method are shown below,
with constants rounded to ten decimal places. After two iterations the
numbers have stabilized to ten decimals.
p0 = 1.0000000241 q2 = .0209610796
p2 = – .2874648358 y = – .0000000241
p4 = .0093933390
Solution: a) To show
∞∑ [(log n)2 / n3]
n=2
is a convergent series apply the integral test, Hence, it must be shown that
limb→∞ b∫2 [(log x)2 / x3] dx < ∞.
To do this, use the method of integration by parts, Therefore, take
dv = x–3 dx;
v = [(– 1) / 2x2], u = (log x)2, du = [{2(log x)} / x]dx.
Then,
b∫ [(log x)2 / x3] dx = [{– (log x)2} / 2x2] |b 2
2
This yields
log b∫ (du / up) = [u–p+1 / (– p + 1)] |log b log 2
log 2
Therefore,
limb→∞ b∫2 [dx / {x(log x)p}] = limb→∞ ( [(log b)–p+1 / (– p + 1)]
– [(log 2)–p+1 / (– p + 1)] )(p ≠ 1).
If p > 1,
the first term goes to 0 as b→∞ and the integral equals
[(log 2)–p+1 / (p – 1)] < ∞.
Thus, the series is convergent.
If p < 1, the first terra grows without bound as b→∞ and the integral is unbounded. Thus, the
series is divergent. For p = 1,
limb→∞ b∫2 [dx / {x(log x)p}] = limb→∞ b∫2 [dx / {x(log x)}]
= limb→∞ log(log b) – [log(log 2)]
Thus, the series is divergent. This shows that the series is convergent for p > 1;
and divergent for p ≤ 1.
Solution:
The series can be rewritten as the sum of the sequence of numbers given by
an = [1 / 2{(n+1)/2}] if n is odd (n > 0)
and = [1 / 3(n/2)] if n is even (n > 0)
Now the ratio test states:
If ak > 0
and
limk→∞ (ak+1 / ak) = ℓ < 1,
then
∞∑ ak converges.
k=1
Similarly, if
limk→∞ (ak+1 / ak) = ℓ(1 < ℓ ≤ ∞)
then
∞∑ ak diverges.
k=1
PROBLEM 03 – 0049:
Determine if the series.
a) ∞∑k=1 [(k + 1)(1/2) / (k5 + k3 – 1)(1/3)]
converges or diverges. Use the limit test for convergence.
b) ∞∑k=1 [(k log k) / (7 + 11k – k2)]
converges or diverges. Use the limit test for divergence.
Solution:
a) To determine if the given series converges or diverges, the following test called the limit test for
convergence is used. This test states:
If
limk→∞ kp Uk = A for p > 1,
then
∞∑ Uk
k=1
converges absolutely.
To apply this test let p = (7/6) > 1 . Then since
Uk = [(k + 1)(1/2) / (k5 + k3 – 1)(1/3)],
limk→∞ kp Uk = limk→∞ [{k(7/6) (k + 1)(1/2)} / (k5 + k3 – 1)(1/3)]
= limk→∞ [{k(7/6) k(1/2)[1 + (1/k)](1/2)} / (k5 + k3 – 1)(1/3)]
= limk→∞ [{k(5/3) [1 + (1/k)](1/2)} / (k5 + k3 – 1)(1/3)]
= limk→∞ [{1 + (1/k)}(1/2) / {k–5(k5 + k3 – 1)}(1/3)]
= limk→∞ [{1 + (1/k)}(1/2) / {1 + (1/k2) – (1/k5)}(1/3)]
= [(1)(1/2) / (1)(1/3)]
=1
Therefore, the series converges absolutely.
b) For the series
∞∑ [(k log k) / (7 + 11k – k2)],
k=1
the following test called the limit test for divergence is used. This test states, if
limk→∞ k Uk = A ≠ 0 (or ± ∞)
then
∞∑ Uk
k=1
Solution:
Let f(x) be a function with derivatives of all orders at x = x0, and assume that in a neighborhood of
x0, f(x) may be represented by the power series in x – x0:
f(x) ≡ c0 + c1(x – x0) + c2(x – x0)2 + ...
= ∞∑n=0 cn(x – x0)n. (a)
The derivatives of f(x) may be obtained by differentiating the series (a) term by term:
f'(x) = ∞∑n=1 ncn(x – x0)n–1
= c1 + 2c2(x – x0) + 3c3(x – x0)2 + ..., (b)
f"(x) = ∞∑n=2 n(n – 1) cn(x – x0)n–2
= 2 ∙ 1c2 + 3 ∙ 2c3(x – x0) + ..., (c)
.....................................................................................................
f(m)(x) = ∞∑n=m n(n – 1)(n – 2) ... (n – m + 1)cn(x – x0)n–m
= ∞∑n=m [n! / (n – m)!] cn(x – x0)n–m (d)
= m! cm + (m + 1)! cm+1(x – x0) + ...
Setting x = x0 on both sides of (a) , (b) , (c), and (d), one finds
f(x0) = c0 or c0 = f(x0),
f'(x0) = c1 or c1 = f'(x0),
f"(x0) = c2 or c2 = [f"(x0) / 2],
.....................................................................
f(m)(x0) = m! cm or cm = [{f(m)(x0)} / m!],
by means of which (a) becomes
f(x) = ∞∑n=0 [{f(n)(x0)} / n!] (x – x0)n, (e)
where
f(n)(x0) ≡ [(dnf) / (dxn)] |x=(x)0,
f(0)(x0) ≡ f(x0)
and 0! = 1.
Equation (e) is the Taylor series expansion. Note also that by setting x0 = 0 in (e), one gets the
Maclaurin series expansion:
f(x) = ∞∑n=0 [{f(n)(0)} / n!] xn.
PROBLEM 03 – 0051:
Evaluate √(1 + x) to two decimal places at x = .4 by Taylor series expansion. Consider the error
expression:
|Rm| ≤ |[{f(m)(x0)} / m!](x – x0)m|,
the mth derivative is computed at x0. |Rm| is the truncation error after the mth term.
PROBLEM 03 – 0052:
Using the Taylor series expansion for ex about x = 0, find e0.5 to (e) (0.5)3. Bound the error using
the error expression
|[(dn+1f) / dxn+1]|max ∙ [(|x – a|)n+1 / (n + 1)!] (1)
(The subscript "max" denotes the maximum magnitude of the derivative on the interval from a to x
and (e) means error order), and compare the result with the actual error.
PROBLEM 03 – 0053:
Show that f(x) = (x – 1)(1/2) cannot be expanded in a Taylor series about x = 0 or x = 1, but can be
expanded about x = 2. Carry out the expansion about x = 2.
PROBLEM 03 – 0055:
(a) Derive the first three (non-zero) terms of Taylor's series expansion for the function f(x) = sin x,
about the origin. Since it is about the origin, this series is also called a Maclaurin series.
(b) Use the above result to compute the value of sin x for
x = 0.2 rad, correctly to five decimal places.
Solution: (a) With the expansion about the origin the Taylor's series is:
f(x) = f(0) + xf'(0) + (x2 / 2!)f"(0) + (x3 / 3!)f(3)(0) + (x4 / 4!)f(4)(0)
+ (x5 / 5!)f(5)(0) + ...
For
f(x) = sin x f(0) = 0
f'(x) = cos x f'(0) = 1
f"(x) = – sin x f"(0) = 0
f(3)(x) = – cos x f(3)(0) = – 1
f(4)(x) = sin x f(4)(0) = 0
f(5)(x) = cos x f(5)(0) = 1
Therefore,
sin x = [(x – x3) / 3!] + (x5 / 5!) + ...
(b) For x = 0.2 rad,
sin 0.2 = 0.2 – [(0.2)3 / 6] + [(0.2)5 / 120] + ...
sin 0.2 = 0.2 – 0.0013333 + 0.0000027 + ...
To five decimal places,
sin 0.2 = 0.19867
It is noted that this is the correct answer for sin 0.2, to five decimal places. Actually, one can tell
from the above computations that this answer is correct to five places by using the theorem which
says that in a converging alternating series the error committed in stopping with any term is
always less than the first term neglected. The first term omitted in the calculation above for sin 0.2
is the third term, and it contributes only 3 in the sixth place.
Solution:
f'(x) = [1 / {2(1 + x)(1/2)}]
f"(x) = [(– 1) / {4[(1 + x)(1/2)]3}]
f(0) = 1
f'(0) = (1/2)
Thus the Taylor expansion with remainder term is
(1 + x)(1/2) = 1 + (x/2) – [x2 / {8[(1 + ξ)(1/2)]3}]
(Here ξ lies between 0 and x.).
Thus the first-degree polynomial approximation to (1 + x)(1/2) is [(1 + x) / 2].
The accuracy of this approximation depends on what set of values x is allowed to assume. If x ε [0,
.1] , for example, one gets
|(1 + x)(1/2) – [1 + (x/2)]| ≤ [.12 / {8[(1 + ξ)(1/2)]3}] ≤ (.12 / 8) = .00125
PROBLEM 03 – 0057:
Obtain a second-degree polynomial approximation to f(x) = e–(x)2 over [0, .1] by means of the
Taylor expansion about x0 = 0. Use the expansion to approximate f(.05), and bound the error.
PROBLEM 03 – 0057:
Obtain a second-degree polynomial approximation to f(x) = e–(x)2 over [0, .1] by means of the
Taylor expansion about x0 = 0. Use the expansion to approximate f(.05), and
bound the error.
Solution: The expansion of sin x in a Taylor series about x0 = 0 through terms of degree 6 is
sin x = x – (x3 / 3!) + (x5 / 5!) – (x7 / 7!) cos ξ
[(sin x) / x] = 1 – (x2 / 6) + (x4 / 120) – (x6 / 7!) cos ξ
Thus
(1/2) 1∫–1 [(sin x) / x] dx = (1/2) [x – (x3 / 18) + (x5 / 600)] |1 –1
– (1/2) 1∫–1 (x6 / 7!) cos ξ dx
This simplifies to
(1/2) 1∫–1 [(sin x) / x] dx = (1,703 / 1,800) – (1/2) 1∫–1 (x6 / 7!) cos ξ dx
To bound the error, compute
|(1/2) 1∫–1 (x6 / 7!) cos ξ dx| ≤ (1/2) 1∫–1 (x6 / 7!) |cos ξ| dx
≤ (1/2) 1∫–1 (x6 / 7!) dx = [1 / {(7)(7!)}]
Hence
|(1/2) 1∫–1 [(sin x) / x] dx – (1,703 / 1,800)| ≤ [1 / {(7)(7!)}] < 3.0 × 10–5
Solution: The general idea here is that the equation x = cos x is to be replaced by an
equation of the form
x = 1 – (x2 / 2!) + (x4 / 4!) – (x6 / 6!) ... + (– 1)n [x2n / (2n)!] (1)
Taking n = 1, for example, solve
x = 1 – (x2 / 2)
to obtain x = – 1 ±3(1/2). Since the only solution to x = cos x lies in the interval [0, 1], one obtains
– 1 + 3(1/2)
as an approximate solution. This value can be. used as an initial guess in a fixed-point iteration to
solve the equation. The iteration might be performed on the original equation x = cos x or on the
approximate equation (1) for some n > 1.
PROBLEM 03 – 0060: Find sin .1, using Taylor's series and t = 2 floating-point arithmetic.
Solution: Assume f(x, y) = ɸ (x) Ψ(y) where ɸ (x) = ex and Ψ(y) = cos y. Also assume E =
Ex × Ey where Ex and Ey are compact convex subsets of R, i.e., closed and bounded intervals. Note
that
Supxε(E)x ||[{dkɸ (x)} / dxk]|| = emax(E)x
and
Supyε(E)y ||[{dkΨ(y)} / dxk]|| ≤ 1.
Hence ɸ (x) and Ψ(y) are real analytic on E. Furthermore, note that
ex = ∞∑i=0 (xi / i!) [(diex) / (dxi)] |x=0 = ∞∑i=0 (xi / i!) (1)
and
cos y = ∞∑i=0 (yi / i!)[(di cos y) / dyi] |y=0 = ∞∑i=0 (– 1)i [y2i / (2i)!] (2)
Since f = ɸ Ψ and ɸ and Ψ are real analytic on E, f is real analytic on E:
Supx, yεE ||[{∂kf(x, y)} / (∂xi∂yk–1)]|| ≤ emax(E)x.
hence, from (1) and (2)
ex cos y = [∞∑i=0 (xi / i!)] [∞∑j=0 (– 1)j {y2j / (2j)!}]
= ∞∑k=0 [∑(i+j=k)(i,j≥0) (– 1)j {(xiy2j) / [i!(2j)!]}].
The first three terms corresponding to k = 0, k = 1, and k = 2 give the approximation:
ex cos y ≈ 1 + x – (1/2)y2 + (1/2)x2 – (1/2)xy2 + (1 / 24)y4
which is known to be accurate near (0, 0).
PROBLEM 03 – 0064: A. Find the Taylor series expansion of f(x, y) about x0, y0.
B. Expand f(x, y) = cos xy about x0 = (π / 2), y0 = (1/2) up to
second-order terms.
Solution: The successive derivatives of this function soon become very unwieldy; hence
it is desirable to compute the coefficients of the power series and to estimate the magnitude of the
error committed by stopping at a certain term by other means. If in series
ex = 1 + (x / 1!) + (x2 / 2!) + ... + (xn / n!) + ... ,
R = ∞.
– x2 replaces x and then multiplying through by x, yields
xe–(x)2 = x – (x3 / 1!) + (x5 / 2!) – (x7 / 3!) ± ... + (– 1)n[x2n+1 / n!] + ... .
This is an alternating series and it can be shown that six terms are sufficient to yield, for
x = (1/2), [1 / (2e0.25)] = 0.38940,
a value which is correct to five decimal places.
Solution: Let
f(x) = (1/2)(ex + e–x).
To find the Maclaurin series, determine f(0), f'(x), f'(0), f"(x), f"(0), etc. One finds:
f(x) = (1/2)(ex + e–x) f(0) = 1
f'(x) = (1/2)(ex – e–x) f'(0) = 0
f"(x) = (1/2)(ex + e–x) f"(0) = 1
f"'(x) = (1/2)(ex – e–x) f"'(0) = 0
f4(x) = (1/2)(ex + e–x) f4(0) = 1, etc.
Now, the series is developed as follows:
f(x) = f(0) + f'(0)x + [{f"(0)} / 2!]x2 + [{f"'(0)} / 3!]x3 + ... .
By substitution:
(1/2)(ex + e–x) = 1 + 0 + (x2 / 2!) + 0 + (x4 / 4!) + ...
= 1 + (x2 / 2!) + (x4 / 4!) + ... .
To determine the law of formation examine the terms of this series. The nth term of the series is
found to be:
[x2n–2 / (2n – 2)!];
Then, the (n + 1)th term is:
[x2n / (2n)!].
Therefore the Maclaurin series is:
(1/2)(ex + e–x) = 1 + (x2 / 2!) + (x4 / 4!) + ... + [x2n–2 / (2n – 2)!] + [x2n / (2n)!].
To find the interval of convergence use the ratio test. Set up the ratio
(un+1 / un),
obtaining:
[x2n / (2n)!] ∙ [(2n – 2)! / x2n–2] = [x2n / {(2n)(2n – 2)!}] ∙ [(2n – 2)! / x2n–2]
= (x2 / 2n).
One finds:
limn→∞ |(x2 / 2n)| = |0| = 0.
By the ratio test it is known that, if
limn→∞ |(un+1 / un)| < 1,
the series converges. Since 0 is always less than 1, the series converges for all values of x.s
PROBLEM 03 – 0068: Find the Maclaurin series and the interval of convergence for
the function f(x) = cos x.
Solution: To find the Maclaurin series for the given function, determine f(0),
f'(x), f'(0), f"(x), f"(0), etc.
One finds:
f(x) = cos x f(0) = 1
f'(x) = – sin x f'(0) = 0
f"(x) = – cos x f"(0) = – 1
f"'(x) = sin x f"'(0) = 0
f4(x) = cos x f4(0) = 1
f5(x) = – sin x f5(0) = 0
f6(x) = – cos x f6(0) = – 1.
Develop the series as follows:
f(x) = f(0) + f'(0)x + [{f"(0)} / 2!]x2 + [{f"'(0)} / 3!]x3 + [{f4(0)} / 4!]x4
+ [{f5(0)} / 5!]x5 + [{f6(0)} / 6!]x6 + ...
By substitution:
cos x = 1 + 0 – (x2 / 2!) + 0 + (x4 / 4!) + 0 – (x6 / 6!) + ...
= 1 – (x2 / 2!) + (x4 / 4!) – (x6 / 6!) + ... .
To determine the law of formation, examine the terms of this series. The nth term of the series is
found to be
[x2n–2 / (2n – 2)!];
Then, the (n + 1)th term is:
[x2n / (2n)!].
Therefore, the Maclaurin series is:
cos x = 1 – (x2 / 2!) + (x4 / 4!) – (x6 / 6!) + ... ± [x2n–2 / (2n – 2)!] ± [x2n / (2n)!] ... .
To find the interval of convergence use the ratio test. Set up the ratio
(un+1 / un),
obtaining:
[x2n / (2n)!] × [(2n – 2)! / x2n–2] = [x2n / {(2n)(2n – 2)!}] × [(2n – 2)! / x2n–2] = (x2 / 2n).
Now, one finds
limn→∞ |(x2 / 2n)| = |0| = 0.
By the ratio test it is known that, if
limn→∞ |(un+1 / un)| < 1
the series converges.
Since 0 is always less than 1, the series converges for all values of x.
PROBLEM 03 – 0069: Using the Maclaurin expansion, find the value of the sine
function to eight significant figures.
Solution: The remainder term in the Maclaurin expansion of the sine function
sin x = x – (x3 / 3!) + (x5 / 5!) + ... , 0<θ<1
is
[{(– 1)p x2p+1 cos θx} / (2p + 1)!],
where p is the number of terms required. If one desires to compute the sine function to eight significant
figures, the relative error would be less than [1 / (2 × 108)]. Then, note that cosθx < 1, so it is required that
[1 / (sin x)] [x2p+1 / (2p + 1)!] < [1 / (2 × 108)]
The value of p, the number of terms required, depends on how large a value of x must be accommodated.
Because of the periodicity of the sine function, it is certainly sufficient to consider only x < 2π. Also, since
sin(π + x) = – sin x, values of x between π and 2π can be replaced by values between 0 and π. Further,
since sin(π – x) = sin x, angles between (π / 2) and π can be replaced by angles between 0 and (π / 2). For
values of x between 0 and (π / 2), the sin x in the denominator is no problem, since 1 ≤ [x / (sin x)] ≤ (π / 2)
for x in this range. The largest value of the left-hand side of the inequality occurs when x = (π / 2). For this
value of x, the inequality is satisfied by 2p + 1 = 15, or p = 7. Thus the value of the sine function will be
given in eight significant figures by the expression
sin x = x – (x3 / 3!) + (x5 / 5!) – (x7 / 7!) + (x9 / 9!) – (x11 / 11!) + (x13 / 13!)
U = X ∗Y
– A(3)} ∗ U – A(1)] ∗ X
PROBLEM 03 – 0071:
Compute sin 40° correct to five significant figures from
sin x = x – (x / 3!) + (x5 / 5!) ± ... + (– 1)n [x2n+1 / (2n + 1)!] + ...,
3
R = ∞. (1)
Solution: Equation (1) yields 40° = (2π / 9) = 0.6981317 rad. Thus, using
The first positive integral n for which this inequality holds (obtained by trial and error) is n = 7. Hence, a
polynomial of max-degree 7 is necessary to attain the desired precision. On the other hand, using
whence n = 4. That is, the first four terms of (1) are sufficient to yield sin 40° correct to five significant
figures; a result equivalent to the preceding one. We have
sin 40° 0.6981317 – [(0.6981317)3 / 3!] + [(0.6981317)5 / 5!] – [(0.6981317)7 / 7!] = 0.6427875,
so that R = 1. That is, the series converges absolutely for – 1 < x < 1 and diverges for |x| > 1. Note that this
result could have also been found by the relation,
R = (1 / α)
where
α = limn→∞ sup n√(|an|)
where
an = (1 / n2)
which yields
α = limn→∞ sup n√[|(1 / n2)|]
= limn→∞ sup n√(1 / n2)
= limn→∞ sup (1 / n(2/n))
= limn→∞ sup [1 / (e(2/n) log n)]
= [1 / {e limn→∞ sup (2/n) log n}]
= (1 / e0)
= 1,
therefore,
(1 / R) = 1,
so that as before R = 1. For x = ±1 the series converges by comparison with the harmonic series of order 2,
that is
|[(±1)n / n2]| ≤ (1 / n2)
Hence the series converges for – 1 ≤ x ≤ 1. To determine if the convergence is uniform in this interval, the
Weierstrass M-test for uniform convergence is needed. That is, one must find a convergent series of
constants
∞
∑n=1 Mn
such that
|(xn / n2)| ≤ Mn
for all x in – 1 ≤ x ≤ 1 if one is to determine that
∞
∑n=1 (xn / n2)
is uniformly convergent in this interval.
Since – 1 ≤ x ≤ 1,
|(xn / n2)| ≤ (1 / n2)
for all x in the range.
Therefore since
∞
∑n=1 Mn
converges, this shows the given power series converges uniformly on – 1 ≤ x ≤ 1.
Solution: To find the power series of the given functions, one needs the following theorem:
Given the two power series
∞
∑n=0 anxn = a0 + a1x + a2x2 + ... + anxn + ...
and
∞
∑n=0 bnxn = b0 + b1x + b2x2 + ... + bnxn + ... ,
where b0 ≠ 0, and where both of the series are convergent in some interval |x| < R, let f be a function
defined by
f(x) = [(a0 + a1x + a2x2 + ... + anxn + ...) / (b0 + b1x + b2x2 + ... + bnxn + ...)].
Then for sufficiently small values of x the function f can be represented by the power series
f(x) = c0 + c1x + c2x2 + ... + cnxn + ... ,
where the coefficients c0, c1, c2, ... , cn, ... are found by long division or equivalently by solving the
following relations successively for each ci (i = 0 to ∞):
b0 c0 = a0
b0 c1 + b1 c0 = a1
∙
∙
∙
b0 cn + b1cn–1 + ... + bnc0 = an
∙
∙
∙
a) To find the power series expansion of tan x, Taylor's series for sin x and cos x are needed. That is
sin x = x – (x3 / 3!) + (x5 / 5!) – ...
and
cos x = 1 – (x2 / 2!) + (x4 / 4!) – ...
Then,
tan x = [(sin x) / (cos x)]
= [{x – (x3 / 3!) + (x5 / 5!) – ...} / {1 – (x2 / 2!) + (x4 / 4!) – ...}] (1)
Therefore, by the theorem the power series expansion of tan x can be found by dividing the numerator by
the denominator on the right side of (1). Hence, using long division one gets
x + (1/3)x3 + (2 / 15)x5 + ...
1 – (1/2)x2 + (1 / 24)x4 – ... √x – (1/6)x3 + (1 / 120)x5 – ...
x – (1/2)x3 + (1 / 24)x5 – ...
(1/3)x3 – (1 / 30)x5 + ...
(1/3)x3 – (1 / 6)x5 + ...
(2 / 15)x5 – ...
(2 / 15)x5 – ...
Thus
tan x = x + (1/3)x3 + (2 / 15)x5 + ...
b) Since
sin x = x – (x3 / 3!) + (x5 / 5!) – ...
one gets
sin (2x) = 2x – [(2x)3 / 3!] + [(2x)5 / 5!] – ...
so that
[(sin x) / (sin 2x)] = [{x – (x3 / 3!) + (x5 / 5!) – ...}
/ {2x – [(2x)3 / 3!] + [(2x)5 / 5!] – ...}]. (2)
Now multiplying the numerator and denominator on the right side of (2) by (1/x) yields
[(sin x) / (sin 2x)] = [{1 – (x2 / 6) + (x4 / 120) – ...}
/ {2 – (4/3)x2 + (4 / 15)x4 – ...}].
Now by long division
(1/2) + (1/4)x2 + (5 / 48)x4 + ...
2 – (4/3)x2 + (4 / 15)x4 √ 1 – (1/6)x2 + (1 / 120)x4 – ...
(1/2) – (4/6)x2 + (4 / 30)x4 – ...
(1/2)x2 – (15 / 120)x4 + ...
(1/2)x2 – (1 / 3)x4 + ...
(25 / 120)x4 – ...
(25 / 120)x4 – ...
Thus, for x ≠ 0 ,
[(sin x) / (sin 2x)] = (1/2) + (1/4)x2 + (5 / 48)x4 + ... .
exist and are continuous in the interval a ≤ x ≤ b and if f(n+1)(x) exists in the interval a < x < b, then
f(x) = f(a) + f'(a)(x – a) + [{f"(a)(x – a)2} / 2!] + ... + [{f(n)(a)(x – a)n} / n!] + Rn (1)
where a < ξ < x. Note that as n changes, ξ also changes in general. In addition, if for all x and ξ in [a, b],
limn→∞ Rn = 0,
f(x) = f(a) + f'(a)(x – a) + [{f"(a)} / 2!](x – a)2 + [{f"'(a)(x – a)3} / 3!] + ... (2)
For the given problem f(x) = ex, so that f(n)(x) = ex for all orders n. Now taking a = 0 in (1),
f(x) = f(0) + f'(0)x + [{f"(0)x2} / 2!] + ... + [{f(n)(0)xn} / n!] + Rn
which yields upon substitution of f(x) = ex,
ex = 1 + x + (x2 / 2!) + ... + (xn / n!) + Rn
where
Rn = [{f(n+1)(ξ)} / (n + 1)!] xn+1 = [eξ / (n + 1)!] xn+1
where
0 < ξ < x.
Now we must prove that
limn→∞ Rn = 0,
so that we will have the Taylor expansion for ex. However,
– |x| < ξ < |x|
and
0 < eξ < e|x|;
hence
limn→∞ Rn = 0,
Therefore
[(|x|n) / n!] ≤ [(|x|N) / N!] (1/2)n–N. (4)
Now keeping N fixed we have
limn→∞ (1/2)n–N = 0.
Therefore by (4)
limn→∞ [(|x|n) / n!] = 0.
This means that the series representation
ex = 1 + x + (x2 / 2!) + ... + (xn / n!) + ...
is valid for all values of x.
Solution: The power series expansion for sin x and cos x are for all values x
sin x = x – (x3 / 3!) + (x5 / 5!) – (x7 / 7!) + ... (1)
Since, by theorem, a power series can be differentiated term-by-term in any interval lying entirely within its
radius of convergence, one gets by (1) and (2), for all values x
[{d(sin x)} / dx] = 1 – (3x2 / 3!) + (5x4 / 5!) – (7x6 / 7!) + ...
= 1 – (x2 / 2!) + (x4 / 4!) – (x6 / 6!) + ... = cos x.
and
[{d(cos x)} / dx] = [(– 2x) / 2!] + (4x3 / 4!) – (6x5 / 5!) + ...
= – x + (x3 / 3!) – (x5 / 5!) + ... = – sin x
b) Using the result from part (a)
{sin x cos(h – x) + cos x sin(h – x)}'
= cos x cos(h – x) + sin x sin(h – x) – sin x sin(h – x) – cos x cos(h – x) = 0
Thus, sin x cos(h – x) + cos x sin(h – x) is constant and this constant equals the value sin h (this was found by
letting x = 0).
Hence
PROBLEM 03 – 0078: Write the function f(z) = [z / (ez – 1)] in terms of a power series.
The numbers cnn! are called the Bernoulli numbers and are denoted by Bn. To calculate Bn, use the
recurrence relation (3), which now takes the form
B0 [1 / {0!(n + 1)!}] + B1 [1 / (1! n!)] + ... + Bn [1 / (n! 1!)] = 0
(n = 1,2,...) (4)
(obviously B0 = c00! = 1) . Multiplying (4) by (n + 1)! and introducing the notation
[(n + 1)! / {k!(n + 1 – k)!}] = (n+1 k)
(the familiar binomial coefficient), find that
B0(n+1 0) + B1(n+1 1) + ... + Bn(n+1 n) = 0
(n = 1,2,...). (5)
Equation (5) can be written symbolically as
(1 + B)n+1 – Bn+1 = 0, (6)
where after raising 1 + B to the (n + 1)th power, every Bk is changed to Bk (k = 1, 2,...,n + 1). Using (6) and the
fact that B0 = 1, deduce step by step that
B0 + 2B1 = 0,
B0 + 3B1 + 3B2 = 0,
B0 + 4B1 + 6B2 + 4B3 = 0,
B0 + 5B1 + 10B2 + 10B3 + 5B4 = 0,
B1 = – (1/2)B0 = – (1/2),
B2 = – (1/3)B0 – B1 = (1/6),
B3 = – (1/4)B0 – B1 – (3/2)B2 = 0,
B4 = – (1/5)B0 – B1 – 2B2 – 2B3 = – (1 / 30)
B0 + 6B1 + 15B2 + 20B3 + 15B4 + 6B5 = 0,
B5 = – (1/6)B0 – B1 – (5/2)B2 – (10 / 3)B3 – (5/2)B4 = 0,
B0 + 7B1 + 21B2 + 35B3 + 35B4 + 21B5 + 7B6 = 0,
B6 = – (1/7)B0 – B1 – 3B2 – 5B3 – 5B4 – 3B5 = (1 / 42),
Collecting these results,
B0 = 1, B1 = – (1/2), B2 = (1/6) , B3 = 0, B4 = – (1 / 30), B5 = 0,
B6 = (1 / 42),... (7)
As suggested by (7), the Bernoulli numbers with odd indices greater than 1 vanish. To see this, write
f(z) = [z / (ez – 1)] = c0 + c1z + c2z2 + c3z3 + ... + cnzn + ... (8)
= B0 + (B1 / 1!)z + (B2 / 2!)z + (B3 / 3!)z + ... + (Bn / n!)zn + ...
2 3
Solution: The function f has singular points, or points at which it is not analytic, at z 1 = 1, z2 = 2.
Taylor's theorem tells that f has a valid Taylor series expansion about z0 = 0 within the circle |z| = 1 since it is
analytic there. Hence
f(z) = ∞∑n=0 [{f(n)(z0)} / n!] (z – z0)n |z| < 1.
It is convenient, however, to use partial fractions to write
f(z) = [(– 1) / {(z – 1)(z – 2)}]
= [1 / (z – 1)] – [1 / (z – 2)]
= (1/2) [1 / (1 – z/2)] – [1 / (1 – z)]. (1)
For |z| < 1, we have |(z/2)| < 1 and note that these are the conditions under which each of the terms in (1)
can be represented by a geometric series. Hence, since
[1 / (1 – w)] = ∞∑n=0 wn, (|w| < 1),
f(z) = (1/2) ∞∑n=0 (z/2)n – ∞∑n=0 zn
= ∞∑n=0 [(1/2)(z/2)n – zn].
or
f(z) = ∞∑n=0 (2–n–1 – 1)zn (|z| < 1). (2)
Since the Taylor coefficients are unique this must be the Taylor expansion for f(z) in the region |z| < 1 and as
a by-product of the calculations, it has been deduced that
[{f(n)(0)} / n!]
must be equal to the coefficients in (2). Thus
f(n)(0) = n! (2–n–1 – 1).
In the region 1 < |z| < 2 one must use Laurent' s theorem which states that if f is analytic in the region
bounded by two concentric circles C1 and C2 centered at z0. then at each point z in that region f(z) is
represented by its Laurent series expansion
f(z) = ∞∑n=0 an (z – z0)n + ∞∑n=1 [bn / (z – z0)n] (3)
where the radius of C1 is assumed to be less than that of C2, and
an = (1 / 2πi) ∫(C)1 [{f(s)ds} / (s – z0)n+1] n = 0, 1, 2, ... (4)
bn = (1 / 2πi) ∫(C)2 [{f(s)ds} / (s – z0)–n+1] n = 1, 2, ... (5)
Formulas (4) and (5) are not very useful since the integrals are usually difficult to do. Therefore, note that in
the region 1 < |z| < 2, |(1/z)| < 1 and |(z/2)| < 1 so that one may use the geometric series expansion to write
f(z) = (1/z) [1 / (1 – 1/z)] + (1/2) [1 / (1 – z/2)]
= ∞∑n=0 (1 / zn+1) + (1/2) ∞∑n=0 (zn / 2n+1), (6)
which is valid for 1 < |z| < 2. Now the Laurent coefficients in (4) and (5) are unique, i.e., any representation
such as that in (6) must be the Laurent expansion regardless of how it is arrived at. Therefore, the
coefficients in the expansion must be equal to those of (4) and (5) so that as a by-product of the
calculations we have been able to find the values of the integrals there. E.g., for n = 1 in (5) see from (6) that
b1 = 1 so
∫|z|=2 f(z)dz = 2πi
Finally, for |z| > 2 one may write
f(z) = (1/z) [{1 / (1 – 1/z)} – {1 / (1 – 2/z)}] (7)
and |(1/z)| < 1 as well as |(2/z)| < 1 in the region |z| > 2.
Therefore, one may use the geometric series in this region to find from (7) that
f(z) = ∞∑n=0 (1 / zn+1) – ∞∑n=0 (2n / zn+1)
or
f(z) = ∞∑n=0 [(1 – 2n) / zn+1] (8)
Again, since the Laurent coefficients are unique it is deduced that the coefficients in (8) are the Laurent
coefficients. In particular since b1 = 0 in
(8) one finds from (4) that
∫C f(s)ds = 0,
where in this case, C can be any circle centered at z0 = 0 with radius r > 2.
PROBLEM 03 – 0080: Find the first three nonzero terms in the Laurent series
expansion of csc z about z0 = 0.
Solution: The Laurent series expansion of a function f(z) which is analytic in an annulus
bounded by the concentric circles C1 and C2 with centers at z0 is given by
f(z) = ∞∑n=0 an (z – z0)n + ∞∑n=1 [bn / (z – z0)n] (1)
where
an = (1 / 2πi) ∫(C)1 [{f(s)ds} / (s – z0)n+1] (n = 0, 1, 2, ...) (2)
bn = (1 / 2πi) ∫(C)2 [{f(s)ds} / (s – z0)–n+1] (n = 1, 2, ...) . (3)
Here the radius of C2 is assumed to be larger than the radius of C1. The integrals in (2) and (3) are usually
difficult and sometimes impossible to do by elementary methods so that a simpler way to proceed is to find
the Taylor series expansion for sin z and use long division to obtain a series representing csc z = (1 / sin z).
Then observing that the Laurent expansion is unique, it can be stated that the resulting series is indeed the
Laurent series.
Now since sin z is analytic Vz with |z| < ∞ its Taylor expansion can be written as
sin z = ∞∑n=0 [{f(n)(0)zn} / n!] = ∞∑n=1 [(– 1)n–1 / (2n – 1)!] z2n–1 (4)
Now sin z = 0 only for z = nπ, n = 0, ±1, ±2, ... .
Hence,
csc z = (1 / sin z)
is analytic in the annulus 0 < |z| < π can be represented by a series expansion there. Thus
csc z = (1 / sin z)
= [1 / {z – (z3 / 3!) + (z5 / 5!) – (z7 / 7!) + ...}]. (5)
Thus, by long division
z – (z3 / 3!) + (z5 / 5!) – (z7 / 7!) + ... [{(1/z) + (1/3!) + z3} / {3! ∙ 3! – 5!}] + …
√1 + 0 + 0 + 0 + 0
– [1 – (z / 3!) + (z / 5!) – (z7 / 7!) + ...]
3 5
PROBLEM 03 – 0081:
Find the principal part of the function f(z) = [(ez cos z) / z3] at its singular point and determine the type of
singular point it is.
Solution: The given function has an isolated singular point at z = 0. Such a function may be
represented by a Laurent series
f(z) = ∞∑n=0 an (z – z0)n + ∞∑n=1 [bn / (z – z0)n] (1)
where an and bn are the Laurent coefficients. Since a Laurent expansion is unique, one needn't calculate
these coefficients directly but may proceed as follows, noting that any series of the form (1) that are
obtained must be the Laurent series. First, expanding the numerator of f in a Taylor series about z0 = 0
yields
ez cos z = [1 + z + (z2 / 2!) + ...] [1 – (z2 / 2!) + ...]
= 1 + z – (z3 / 3!) + ... . |z| < ∞ (2)
This is valid by Taylor's theorem since ez cos z is analytic for all z. Hence
[(ez cos z) / z3] = (1 / z3) + (1 / z2) – (1 / 3) + ... 0 < |z| < ∞. (3)
As noted above, this must be the Laurent series for f(z). The principal part of a function f at a point z0 is
defined as the portion of its Laurent series involving negative powers of z – z0. Hence, the principal part of
f(z) = [(ez cos z) / z3]
at 0, its only singular point, can be seen from (3) to be
(1 / z3) + (1 / z2).
If the principal part of f at z0 contains at least one non-zero term but the number of such terms is finite, the
isolated singular point z0 is then called a pole of order m, where m is the largest of the powers
[bj / (z – z0)j]
in the principal part of f. Hence, in this case, it is said that f has a pole of order 3 at z0 = 0.
Solution: Since the singular point z0 = – 1 is isolated, the function has a Laurent series
expansion about – 1 which is valid at every point except – 1 in the circular domain centered at – 1 with
radius r equal to the distance between – 1 and the next closest singularity, i.e.,
r = |2(1/3)|.
To find this expansion first expand
f1(z) = [z / (z3 + 2)]
in a Taylor series about z0 = – 1 to obtain
f1(z) = ∞∑n=0 [{f(0)(z0)} / n!] (z – z0)n. (1)
Now
f1(z) = [z / (z3 + 2)]
so
f1(1)(z) = [(2 – 2z3) / (z3 + 2)2]
and
f1(2) = [{6(z5 – 4z2)} / (z3 + 2)3]
etc. Using these results in (1) one finds
[z / (z3 + 2)] = – 1 + 4(z + 1) – 15(z + 1)2 + ... . (2)
f(z)[z / {(z + 1)2 (z3 + 2)}] = [(– 1) / (z + 1)2] + [4 / (z + 1)] – 15 + ... . (3)
The principal part of a function at a point z0 is defined as that part of its Laurent series involving negative
powers of (z – z0). Since (3) is the Laurent series representing
f(z) = [z / {(z + 1)2 (z3 + 2)}]
for 0 < |z + 1| < |2(1/3)|, it is concluded that the principal part of f at z0 = – 1 is
[(– 1) / (z + 1)2] + [4 / (z + 1)].
If the principal part of f at z0 contains at least one nonzero term but the number of such terms is
finite, then the isolated singular point z0 is called a pole of order m where m is the largest of
[bj / (z – z0)j]
in the principal part of f. Hence, in this case,
f(z) = [z / {(z + 1)2 (z3 + 2)}]
is said to have a pole of order 2 at z0 = – 1.