{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 0 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 22 "Arithmetic Expressions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 53 "This worksheet \+ is designed to accompany Chapter 2 of " }{TEXT 266 87 "Introduction to Scientific Programming: Computational Problem Solving Using Maple and C" }{TEXT -1 229 " by Joseph L. Zachary. In it, we will explore the \+ use of basic arithmetic expressions in Maple. We will also explore so me of the differences between the rational and floating-point numbers \+ that are supplied by Maple. (24Sep96)" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 "Numbers" }}{PARA 0 "" 0 "" {TEXT -1 283 "As you already know, you interact with Maple by entering a command and looking at the value that Maple then displays. The sim plest kind of command is a number. When you enter it, Maple echoes it s value, which is the number itself. There are various ways to write \+ numbers in Maple." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 74 "There are integers, which are written without deci mal points or exponents:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "154;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "There are fractions, which are wri tten as ratios of two integers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "4/16;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 64 "Integers and fractions are collect ively called rational numbers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "There are floating-point numbers, \+ which are written with decimal points:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "152.35;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Floating-point num bers can also be written using scientific notation:" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "152.35e15;" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 160 "The \"e1 5\" part means \"times 10 to the 15th power\". Notice that the result is also written in scientific notation, although the appearance is mo re conventional." }{MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 106 "A number with an exponent is tre ated as a floating-point number, even if it does not have a decimal po int:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "15235e13;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 "Maple reminds us that this is a floating-point number by putting a decimal point in the value that it displays." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Exercises" }} {PARA 0 "" 0 "" {TEXT -1 66 "At the prompts provided, enter rational n umbers that are equal to:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "(1) 175" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "(2) 17.5" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "(3) 175e-3" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "At the p rompts provided, enter floating-point numbers that are equal to:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "(4) 16" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "(5) 1/16" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "(6) 5 1/4" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 18 "Simple Expressions" }}{PARA 0 "" 0 "" {TEXT -1 230 "Numbe rs can be combined with the five arithmetic operations of addition (+) , subtraction (-), multiplication (*), division (/), and exponentiatio n (^). They are used in exactly the way with which you are familiar f rom arithmetic." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "We add two rational numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "115 + 72;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "We subtr act two floating-point numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "191.3 - 72.3;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "We multiply two ra tional numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "18723474387 * 2398723497;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "We multiply two floating -point numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "18723474387. * 2398723497.;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 280 "Compare the results of t he two multiplications. When Maple operates on rational numbers, it g ives an exact result no matter how many digits are required. When Map le operates on two floating-point numbers, it gives the answer in scie ntific notation rounded to ten decimal places." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "We divide two rati onal numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "8383832 / 283742;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "We divide two floating-point numb ers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "8383832. / 283742.;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 138 "Again, notice that Maple gives exact results for the rational division and a result rounded to ten digits for the floa ting-point division." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "We exponentiate two rational numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "2 ^ 100;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "We exponentiate two floating-point numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "2. ^ 100.;" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Exercises" }}{PARA 0 "" 0 "" {TEXT -1 106 "At the prompts, compute the following \+ values. Are the results rational numbers or floating-point numbers?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 " (7) The number of inches in a mile (there are 5280 feet in a mile and 12 inches in a foot)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "(8) The number of bytes in a megabyte (i t's 2 to the 20th power)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "(9) The number of inches in a meter (the re are .0254 meters in an inch). " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "(10) The difference between your height in feet and your best friend's height in feet." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "(11) The c ombined weight of you and George Foreman (let's say he weighs 260 poun ds)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 17 "Mixed Expressions" }} {PARA 0 "" 0 "" {TEXT -1 256 "If an expression contains a mixture of r ational and floating-point numbers, Maple first converts the rational \+ number into floating-point form and then does the operation. Compare \+ the results of the following operations to the ones in the previous se ction." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "We multiply a rational number and a floating-point number :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "18723474387 * 2398723497.;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "We divide a floating-point number \+ and a rational number:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 "8383832. / 283742;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "We exponentiate a floati ng-point number and a rational number:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "2. ^ 100;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 114 "In each case, the result is the same as it would have been if both of the numbers had been flo ating-point numbers." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Exercises" }}{PARA 0 "" 0 "" {TEXT -1 462 "We ha ve been careful not to make any mistakes in our expressions to this po int, but they will be very common when you experiment with Maple. Mis takes can be things like forgetting an operator symbol, forgetting a p anthesis, putting in too many parentheses, and the like. \033Maple tr ies to explain what is wrong, but the explanations are not always clea r. Use Maple to evaluate each of the expressions below, and then corr ect the syntax error that Maple reports." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 27 "(12) Average of 16 and 39. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "0.5 * (16 + 39;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 25 "(13) Sum of 100 and 200." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "10 0 + 200;" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "(1 4) Product of first ten even numbers." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "2 * 4 * 6 * 8 * 10 12 * 14 * 16 * 18 * 20;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 " " {TEXT -1 35 "(15) 11 raised to the 11th power. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "11 & 11;" }}}}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 "Compound Expressions" }}{PARA 0 " " 0 "" {TEXT -1 231 "Just as in arithmetic, more than one operation ca n be carried out in a single expression. The order in which the opera tions are carried out depends both on the way they are grouped with pa rentheses and on Maple's precedence rules." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Here we take the average of two numbers:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "(158 + 64) / 2;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 215 "Notice that parentheses are used, just as in mathematics, to indicate the order in which operations are carried out. In the absence of parentheses, the operations are not n ecessarily carried out from left to right:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "158 + 64 / 2;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 347 "In the absence of parentheses, the division was performed first, followed by the add ition. Once you have learned Maple's precedence rules, you will be able to predict the order in which arithmetic operations will be c arried out. We will not discuss precedence rules in this worksheet. \+ You should use parentheses whenever you are in doubt." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 160 "In a compound \+ expression, a rational number is converted to floating-point form when ever it is involved in an operation with a floating-point number. Con sider:" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "(158 + 64) / 2.0;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 215 "The addition involves two rational numbe rs, so rational number addition is done. The sum is then converted to floating-point form so that it can be divided by a floating-point num ber. On ther other hand, consider:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "(158. + 64) / 2;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 257 "The sum involves a fl oating-point and a rational number, so the rational number is first co nverted to floating-point form. The sum is a floating-point number, s o the divisor must be converted into floating-point form before the di vision can be carried out." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Exercises" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 163 "(16) Write an expression to \+ calculate the number of centimeters in a mile. (There are 5280 feet i n a mile, 12 inches in a foot, and 2.54 centimeters in an inch.)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 173 " (17) Write an expression to compute the grade point average of a clas s of 11 students, where 4 make an A (4.0), 3 make a B+ (3.3), 3 make a C (2.0), and 1 makes a C- (1.7)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 233 "(18) In some situations, the or der in which conversions from rational to floating-point numbers are c arried out in a compound expression can make a difference. Explain wh y the results of the following two expressions are different." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "1.0 * (1/3 + 1/3 + 1/3);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "(1.0 * 1/3 ) + 1/3 + 1/3;" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 "Function App lication" }}{PARA 0 "" 0 "" {TEXT -1 309 "Besides the five arithmetic \+ operators, Maple provides many built-in functions that operate on numb ers. Whereas operator symbols are written between the numbers that th ey operate on (their parameters), built-in function names are written \+ in front of their parameters, just as is the convention in mathematics ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 133 "The \"evalf\" function expects one parameter, which is typically \+ a rational number, and produces the closest floating-point equivalent: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalf(1/7);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 " " {TEXT -1 119 "The \"sqrt\" function produces the square root of its \+ parameter. We can take the square root of a floating-point number:" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "sq rt(18.0);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Or of a rational number:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "sqrt(18);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 198 "Notice how the square ro ot of a floating-point number is written as a ten-digit approximation \+ whereas the square root of a rational number is written exactly, even \+ if it requires a radical to do so." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 136 "Just as we can write expressions \+ with more than one arithmetic operation, we can write expressions with more than one built-in function:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "evalf(sqrt(18));" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 94 "This takes the square r oot of a rational number and then converts it into floating-point form ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "This expression amounts to the same thing:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "evalf(sqrt(9+9));" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 105 "The \"cos\" function produces the cosine of its parameter. (The \+ parameter should be expressed in radians.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "cos(3.141592654 / 3);" }} }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "S ome functions take more than" }{TEXT -1 232 " one parameter. For exam ple, \"evalf\" will take an optional second argument, which should be \+ an integer. The second parameter specifies the number of digits that \+ should appear in the mantissa of the resulting floating-point number: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalf(1/7, 5);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 97 "Notice that when more than one parameter is passed to a f unction, they are separated with commas." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Exercises" }}{PARA 0 "" 0 " " {TEXT -1 45 "At the prompts, compute the following values." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "(19) Th e exact sum of the square roots of 1, 2, 3, 4, and 5." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "(20) A float ing-point approximation to the sum above." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 104 "(21) The square root o f the sum of the sine and the cosine of 1/4 Pi. (Use a value of 3.141 59 for Pi.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 19 "Help With \+ Functions" }}{PARA 0 "" 0 "" {TEXT -1 188 "There are so many functions built into Maple that it is virtually impossible to remember them all . Fortunately, Maple provides a powerful help facility. There are se veral ways to use it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 299 "If you happen to know the name of a function a nd wish to know more about it, you can ask Maple to display help infor mation for it. For example, let's see what Maple can tell us about th e \"sqrt\" function. To ask for help, issue a command consisting of a question mark followed by the function name." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "?sqrt" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 211 "A help window wil l appear containing information about \"sqrt\". A help window will co ntain a brief explanation followed by some examples. The help for \"s qrt\" tells us that it works even for negative parameters." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "Let's try \+ that out." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "sqrt(-18);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "Here, the \"I\" tells us that the result is a c omplex number." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 725 "If you know what kind of function you need but you' re not sure what Maple calls it, Maple can also be of help. For eampl e, suppose that we'd like to find a function that will produce the pri me factorization of an integer. Pull down the \"Help\" menu in the up per right-hand corner and choose the \"Full Text Search\" option. Ent er \"integer factorization\" in the box labeled \"Word(s)\" and click \+ on \"Search\". A window of functions having the words \"integer facto rization\" in their descriptions will be displayed. Near the top of t he list you'll find a likely function called \"ifactor\". If you cli ck on its description and then click on \"OK\", its help window will a ppear. It turns out that this is just the function we need." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "ifactor(9 792);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 512 "Finally, Maple will help you explore even if you have no idea what you're looking for. Pull down the \"Help\" menu again, but this time choose the \"Contents\" option. When you select one of the topics displayed, Maple will display a variety of subtopics. For exa mple, selecting \"Mathematics\" displays some subtopics. Selecting \" Algebra\" displays more subtopics. Selecting \"Rational Expressions\" displays still more subtopics. Finally, selecting \"denom,\" which i s a built-in function, displays its help window." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "denom(3/15);" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 9 "Ex ercises" }}{PARA 0 "" 0 "" {TEXT -1 152 "(22) Use Maple's help facilit y to find a way to compute the base 2 logarithm of a number. (The bas e 2 logarithm of 16 is 4 and of 19.2 is 4.263034406.)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "4" 0 }{VIEWOPTS 1 1 0 1 1 1803 }