intro - MAPLE NOTES Exact arithmetic and basic functions...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
MAPLE NOTES Exact arithmetic and basic functions The basic arithmetic operations in MAPLE are + addition - subtraction * multiplication ^ or ** exponentiation / division MAPLE does integer arithmetic to "infinite" precision: > 2/3 + 3/5; 19 15 > 7 - 11/15; 94 15 > 12^20; 3833759992447475122176 > 12^20: > MAPLE input is entered to the right of the MAPLE prompt > and ends with a colon or semicolon. The input is executed after pressing enter (or return). If the semicolon is used the result is printed but with a colon it is executed but not printed.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Click on the next line and press enter five times. > a:= 5^2 +12^2; > b:=13^2; > c:=a-b: > c; > sqrt(a); You should get something like: > a:= 5^2 +12^2; := a 169 > b:=13^2; := b 169 > c:=a-b: > c; 0 > sqrt(a); 13 Also notice the use of ":=" which the assignment operator. In the session above we used the command > a:=5^2+12^2; to assign the variable (or name) a the value of + 5 2 12 2 . MAPLE also has the basic mathematical functions (and much more) that are available on a scientific calculator. abs(x) absolute value x sqrt(x) square root x n! factorial
Background image of page 2
sin(x) sine cos(x) cosine tan(x) tangent sec(x) secant csc(x) cosecant cot(x) cotangent arcsin(x) inverse sine arctan(x) inverse tan arcsec(x) inverse sec log(x) ln(x) natural logarithm exp(x) exponential function e x sinh(x) hyperbolic sine cosh(x) hyperbolic cosine tanh(x) hyperbolic tan > tan(Pi/6); 3 3 > arcsin(1/2); π 6 NOTE: In MAPLE π is entered as Pi > evalf(Pi); 3.141592654 The evalf function returns floating point approximation. We can increase precision as follows:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
> evalf(Pi,50); 3.1415926535897932384626433832795028841971693993751 Algebra MAPLE can do algebra. It can manipulate polynomials and rational functions easily. > p:=x^2+5*x+6; := p + + x 2 5 x 6 > factor(p); ( ) + x 3 ( ) + x 2 > q:=1-x^7-x^8-x^9+x^15+x^16+x^17-x^24; := q - - - + + + - 1 x 7 x 8 x 9 x 15 x 16 x 17 x 24 > r:=factor(q); r ( ) + x 1 ( ) + x 2 1 ( ) + + x 2 x 1 ( ) + + x 6 x 3 1 ( ) + x 4 1 - := ( ) + + + + + + x 6 x 5 x 4 x 3 x 2 x 1 ( ) - x 1 3 > expand(r); - - - + + + - 1 x 7 x 8 x 9 x 15 x 16 x 17 x 24 MAPLE can solve and manipulate algebraic equations. > eqn:= x^2-x=1; := eqn = - x 2 x 1 Here we assigned the name eqn to the equation = - x 2 x 1. Now, we solve this equation for x. > R:=solve(eqn,x); := R , + 1 2 5 2 - 1 2 5 2 R is the list of two roots. R[1] gives first root and the root is R[2]:
Background image of page 4
+ 1 2 5 2 > R[2]; - 1 2 5 2 > expand(R[1]*R[2]); -1 We can check a root by substituting into the left side of the equation. To do this we use the subs function. > eqn; = - x 2 x 1 > lhs(eqn); - x 2 x > subs(x=R[1],lhs(eqn)); - - + 1 2 5 2 2 1 2 5 2 > expand(%); 1 Here % refers to the previous output. So we expanded the result of substituting x=R[1] into the left side of the equation which gave the result 1 as expected. Calculus
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

intro - MAPLE NOTES Exact arithmetic and basic functions...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online