MATH 149 LABORATORY 1 INTRODUCTION TO MAPLE In this laboratory we will define functions and analyze their domains ranges and zeros using Maple We will also consider composite functions To define the function f x x3 7 x2 x 7 50 f x x 3 7 x 2 x 7 50 f x in Maple we enter 1 3 7 2 1 7 x x x 50 50 50 50 Note that since f is a polynomial we know that Domain f and because f is of odd order it follows that Range f We may plot f over the the interval 10 10 with the following command plot f 10 10 color blue To locate the zeros of f we factor the polynomial expression f x factor f x x 1 x 7 x 1 50 Evidently f has three zeros x 1 1 7 Alternatively we can find these zeros by writing a Maple command to solve the equation f x 0 for x S solve f x 0 x S 1 7 1 In order to refer to the first element in the list of solutions we may enter S 1 S 1 1 As you would expect the third solution is denoted by S 3 in Maple S 3 1 We may sketch a graph of f over a smaller interval to show detailed behavior of the function plot f 4 8 color black Now consider the function g x x4 1 x We begin by defining g in Maple g x x 4 sqrt 1 x g x x4 x 1 Note that Domain g 1 since 1 x is a real number if and only if 1 x If we try plotting g over the interval 1 10 we obtain the following graph plot g 1 10 color blue 5 so it makes sense to redraw the graph 2 over a shorter interval Doing this will help us to estimate the locations of the zeros It appears that the zeros of g occur in the interval 1 plot g 1 5 2 5 10 color blue Note that the second interval of values in the above plot command 5 10 specifies the range of values that appear along the y axis 1 3 It is now evident that g has one zero in the interval 1 and one in the interval 1 2 2 We will attempt to find these values using a solve command as above solve g x 0 x 2 1 RootOf 1 4 Z2 6 Z4 4 Z6 Z8 Z index 1 2 1 RootOf 1 4 Z2 6 Z4 4 Z6 Z8 Z index 2 2 1 RootOf 1 4 Z2 6 Z4 4 Z6 Z8 Z index 3 1 RootOf 1 4 Z2 6 Z4 4 Z6 Z8 Z index 8 2 This time the solve command does not give us a result that we can use In such a case we can utilize the fsolve command to approximate each of the roots to any desired number of decimal places The default number of decimal places is 10 which we will use here When approximating the zeros of a function g we use the command fsolve g x 0 x a b where a b is an interval known to contain a single root to the equation g x 0 fsolve g x 0 x 1 1 2 0 8116523200 fsolve g x 0 x 1 3 2 1 096981558 Finally to determine the range of g we observe from our graph that Ran g contains all numbers larger than the minimum value of g x In class we will develop an analytic method for finding this minimum For now we can estimate the minimum value of g x by redrawing the graph of g over the short interval 0 45 0 60 plot g 0 45 0 60 color blue Now position the mouse arrow inside the coordinate plane of this plot and click the left hand mouse button once A rectangular frame will appear about the graph Now move the mouse arrow to the minimum point and click once again The upper left hand corner of the context bar will show the coordinates of the point at the tip of the arrow The y coordinate of this point approximates the minimum value of g The actual minimum value is g x0 where x 0 0 4689591882 x0 0 4689591882 To ten significant digits the minimum value gMin is gMin g x 0 gMin 1 163640263 Thus Ran g gMin We can define the composite funtion h f o g in Maple with the following command h x f g x h x f g x To see the value of h x we enter h x 3 2 x4 x 1 7 x4 x 1 x4 50 50 50 x 1 7 50 50 If we would like to expand the above expression into a sum of simpler terms we may enter expand x12 3 x8 x 1 3 x5 x4 50 50 25 50 x 1 x 7 x8 7 x4 x 1 7 x 50 50 25 50 Note that the symbol stands for the last output Following is first the graph of h and the graphs of f g and h plotted on the same coordinate system plot h 1 2 2 5 color blue plot f g h 1 2 2 5 color red green blue The graphic capability of Maple can also be used to solve inequalities As an example consider the inequality x2 sin x cos x x in Graph the functions together f x x 2 g x sin x cos x plot f g Pi Pi color red green f x x2 g x sin x cos x The solution to the inequality is the set of numbers x such that f x g x i e those values of x such that the green curve is above the red curve We will look more closely at the interval 0 1 plot f g 0 1 color red green The curves intersect at 0 and at a point with X coordinate between 0 6 and 0 8 To find this point we will solve the equation f x g x solve f x g x x RootOf Z4 cos Z 2 cos Z 4 We again need to use fsolve fsolve f x g x x 0 6 0 8 0 7022074120 Therefore the solution set is 0 0 7022074120
View Full Document
Unlocking...