ENTERING MATHEMATICAL EXPRESSIONS IN MAPLE (MATH

advertisement
ENTERING MATHEMATICAL EXPRESSIONS IN MAPLE
(MATH MODE)
Here are some common mathematical expressions and how they appear in Math Mode.
In most cases, instructions on how to enter these expressions are provided. Some
expressions can be entered using the palettes.
Mathematical expression
Addition: 2 + 5
Subtraction: 10 − 7
Multiplication: 3 × 4, 3x, xy
Math Mode (2-D input)
2+5
10 − 7
3 · 4, 3x,3 x, 3·x, x·y, x y
A ∗ or space may be required between
factors – see Notes below)
NOTES ON MULTIPLICATION IN MAPLE:
o Use a ∗ for multiplication. To get the symbol for ∗, press and hold the [Shift] key and press [8], or press
∗ on the number pad.
o In Math mode, when the ∗ is entered, it appears as a · .
o Do not use parentheses around numbers or variables to indicate multiplication – Usually, Maple doesn’t
give an error message but the results are obviously incorrect, e.g. try entering ‘(3)(4)’ for 3 × 4.
o 2-D Math input allows for implied multiplication in some instances. That is, you may not need to include
a ∗ for multiplication.
• In general, use a space between factors for implied multiplication. Note the following instances:
o A product of a number and a variable: e.g., ‘3x’ can be entered as ‘3x’ without the ∗
between ‘3’ and ‘x’. This will work provided the number occurs in the left-most position in
the product.
o A product of two or more variables: e.g., ‘xy’: You will either need a ∗ or space between
the variables – enter ‘x∗y’ or ‘x[Space]y’ Otherwise, is interpreted as a single variable called
“xy”. However, an expression like ‘x2y’ can be entered without ∗ or a space, provided it is
entered as ‘x2y’ and not ‘yx2’. If you are not sure, enter a space or a ∗.
o A product of only numbers: Consider the following examples:
Product
Valid Maple Syntax
Invalid Maple Syntax
Product of whole numbers,
Space between 3 and 4
3 ∗ 4 (appears as 3 · 4)
3×4
34
>
Error, missing
operation
34
Parentheses around the factors
>
(3) (4)
3
Maple doesn’t return an error but
the result is obviously wrong.
Product of a whole number and a
power,
32×125
Product of a power and whole
number,
125×32
32·125 (using ∗)
32 125 (space between 32 and 12)
125·32
12532 (no space between 125 and
32)
125 32 (space between 125 and 32)
In either case, Maple returns
Error, missing
operation
Product of powers,
23 54
Division or fractions,
2354 (no spaces)
23·54
23 54
28
7
3
28 ÷ 7, 4
For division:
1. Enter the numerator or dividend. Put numerator in parentheses if it contains more than one term.
2. Press the forward slash [ / ], then enter the denominator or divisor. In Math mode, Maple automatically
a
puts the fraction in the form .
b
3. Press the right-arrow key [ → ] to exit the denominator.
45, x2
b
Powers, a
4 5 , x2
(If you press ∗ twice for exponents, it will
appear as
4 · · 5)
To enter powers:
1.
2.
3.
4.
Enter the base.
Press the caret [ ∧ ] key ([Shift] + [6]). In Math mode, the exponent displays as a superscript.
Enter the exponent.
Press [ → ] to exit the exponent.
If you like, you can use a double ∗ (∗∗) to indicate powers.
b
Alternatively, click the power button a in the Expression palette to enter powers.
Square roots,
x
25 ,
25 , x 1 / 2
x
1
2
To get the square root function a , where ‘a’ represents any number, variable or expression, use one of the
following:
o Click on the a template in the Expression palette, and fill in the placeholder ‘a’. Press [ → ] to exit the
square root.
o Type in ‘sqrt(a)’.
o Type in ‘a^1/2’
n-th roots (cube root, fourth root, etc…),
38
or
na
or
1
 
a n 
3 8
8
1
3
,
1
 
8 3 
To insert an nth root
•
•
•
na
(a > 0) into a Maple document, either:
n
You can use the a palette button in the Expression palette
Type ‘a^(1/n)’ (using a fractional exponent)
Type ‘surd(a,n)’ (using the ‘surd’ function – n is the index)
In the case where a < 0, either:
•
•
use the surd function, or
rewrite the radical as a fractional exponent in the form
1
 
− ( − a ) n 
na
instead of
1
 
a n 
.
1
 
a n 
Either way will return real-valued roots. Maple treats the expressions
and
as complex-valued
when a < 0 and n odd, unless the RealDomain package is loaded into memory – see NOTE below.
NOTE: By default, Maple computes in the complex number system. Most computations are performed
without any restrictions or assumptions on the variables. Maple often returns results that are extraneous or
unsimplified when computing in the field of complex numbers. To force Maple to perform computations in
the field of real numbers, load the RealDomain package – type ‘with(RealDomain)’ on a blank line and press
Enter. When you load this package, expressions like
Absolute value, |a|
5
− 32 will be real-valued as a result.
abs(a) or |a|
The absolute value function can be entered using one of the following methods:
•
•
•
Click on |a| in the Expression Palette
Enter ‘abs(a)’
Enter ‘|a|’, using the vertical bar key ([Shift] +[ \ ] ) for the |
exp(x), e
Natural exponential, e x
x
NOTE: To enter ex , you can either:
•
•
a
Click on e in the Expression palette, and then fill in the placeholder for the exponent “a”.
Enter ‘exp(x)’. The exponent must be in parentheses
Note the number or base “e” appears as an unitalicized lower-case ‘e’ in Maple.
Do not type in the letter “e” into the worksheet to represent the number e, which appears as an italicized e.
That is, typing ‘e^x’ is WRONG!
Expression
exp(x)
Result
Correct
(Type in exp function, with exponent in
parentheses)
ex
YES
exp^x
exp
x
NO
(Type in exp function, with ^ )
ex
(using the Expression palette – note
unitalicized e)
ex
YES
ex
NO
ex
(Typing ‘e^x’, ‘e’ appears in italics)
Natural logarithm, ln x
ln(x), log(x)
To enter the natural log function, either:
•
•
•
•
Click on ln(a) in the Expression Palette and fill in the placeholder ‘a’.
Enter ‘ln(a)’. (‘a’ is any number, variable or expression).
The argument of the ln function is in parentheses.
ln(x) can be entered as log(x) as well.
Common (base 10) logarithm, log10(x)
To enter the common log function, either:
•
•
•
Click on log10(a) in the Expression Palette and fill in the
placeholder for the argument‘a’. ‘a’ can be any number,
variable or expression
Enter ‘log10(a)’. The argument a is in parentheses.
Note that some texts state log x = log10x. But Maple
interprets log x = ln x, the natural log.
Base b logarithm, logb(x)
To enter a base b log function, either:
•
•
log10(x), log10(x)
logb(x), log[b](x)
Click on logb(a) in the Expression Palette and fill in the
placeholders ‘b’ (for the base) and the argument ‘a’. ‘a’
can be any number, variable or expression
Enter ‘log[b](a)’. The base b is in square brackets; the
argument a in parentheses.
Trig functions:
sin x, cos x, tan x,
sin(x), cos(x), tan(x), sec(x), csc(x),
cot(x)
1
1
1
) , csc x ( =
) ,cot x ( =
)
cos x
sin x
tan x
To enter sin x, cos x, or tan x:
o Click on sin(a), cos(a), or tan(a) in the Expression Palette.
o Type in ‘sin(x)’, ‘cos(x)’, or ‘tan(x)’
o
To enter sec x, csc x, or cot x:
o Type in ‘sec(x)’, ‘csc(x)’ or ‘cot(x)’, or enter ‘1/sin(x)’, ‘1/cos(x)’, or ‘1/tan(x)’
o No palette buttons are available for the reciprocal functions.
Parentheses are required around the arguments. Arguments are presumed to be in RADIAN measure
Powers of trig functions, e.g., sin2(x), can typed in directly as they appear. ‘sin^2 [→] (x)’ press
sec x ( =
•
•
•
•
right-arrow key [→] to exit exponent before entering “(x)”. Powers of other trig functions can be
entered similarly. Alternatively, you could type ‘sin(x)^2’ etc… Don’t forget the parentheses
around the argument.
Inverse trig functions
arcsin x, arccos x, arctan x, arcsec x, arccsc x, arccot x
arcsin(x), arccos(x), arctan(x),
arcsec(x), arccsc(x), arccot(x)
(also denoted as sin−1x, cos−1x, etc…)
• The inverse trig functions must be typed in. No palette buttons are available to enter these functions
directly.
•
•
Maple will also accept ‘sin^−
−1 [→] (x)‘ for sin−1x – press right-arrow key [→] to exit
exponent ‘−1’ before entering “(x)”. The other inverse trig functions can be entered similarly. Don’t
forget the parentheses around the argument.
1
= csc(x). Do
The syntax ‘sin(x)^ −1’ is another way to write the reciprocal function,
sin x
not confuse this with the inverse function syntax above. (same applies for the remaining functions)
The number π (3.14159…)
•
Can be typed in as “Pi” or click on
π in the Common Symbols palette.
•
Note “Pi” is entered with a capital
P, not “pi”, which stands for the
Greek letter π.
Download