Page 97 -
P. 97
In this section, we discuss a simple algorithm to obtain this limit using
MATLAB. The method consists of the following steps:
1. Construct a sequence of points whose limit is x . In the examples
0
1 n
below, consider the sequence x = x − . Recall in this regard
n 0 2
th
that as n → ∞, the n power of any number whose magnitude is
smaller than one goes to zero.
2. Construct the sequence of function values corresponding to the x-
sequence, and find its limit.
Example 4.1
sin( )x
Compute numerically the lim .
x→0 x
Solution: Enter the following instructions in your MATLAB command
window:
N=20; n=1:N;
x0=0;
dxn=-(1/2).^n;
xn=x0+dxn;
yn=sin(xn)./xn;
plot(xn,yn)
The limit of the yn sequence is clearly equal to 1. The deviation of the
sequence of the yn from the value of the limit can be obtained by entering:
dyn=yn-1;
semilogy(n,dyn)
The last command plots the curve with the ordinate y expressed logarithmi-
cally. This mode of display is the most convenient in this case because the
ordinate spans many decades of values.
In-Class Exercises
Find the limits of the following functions at the indicated points:
(x − 2 x − ) 3
2
Pb. 4.1 at x → 3
−
(x 3 )
1+ sin( )x 1
Pb. 4.2 − at x → 0
x sin(x )
© 2001 by CRC Press LLC