Mathematical Expression Rules

Constant Expressions
Constant expressions are subject to the same syntax rules as function expressions, but may contain no variables (X, Y, Z, Theta). All constant expressions are simplified/calculated, and appropriate error messages are displayed before a dialog closes.

Examples
-13.5601
6.50*10^3
(3*Pi)/2
E - 8.3
Ln(2(4 + 3))
Sin(Pi/2)^2 + Cos(Pi/2)^2

Function Expressions
Function expressions must follow the standard mathematical definition of a function. For a 2 dimensional function, each domain value (X), is given a single range value (Y). Graphing an equation that is not a function such as "1 = X^2 + Y^2" (Equation for a circle with radius 1) must be done in two separate pieces. Solving this equation for "Y" gives two results "Y = +Sqrt(1 - X^2)", and "Y = -Sqrt(1 - X^2)". Plotting both of these halves creates a whole circle. When entering a function such as "f(x) = x^2",or "Y = x^2" enter only the right side "x^2".

Examples
When entering a function do not enter the bold left hand side.
Y=f(x)= x^2 - 1
R= 4Cos(2*theta)
Y=f(x,z)= x^2 + z^2

Fractional Results
The Function Calculator can often give fractional results like "7/5" or "2/3". These fractional results are also used to calculate negative numbers to fractional powers. There are some things that will cause rounding. If rounding occurs, a floating point value like "0.333333" will be given instead of "1/3". Most functions will cause rounding. Functions that might not cause rounding are: Exp(), Grint(), Int(), Sqrt(), Square(), Trunc( ), Round(), Frac(), Abs(), Fact(). Fractions where the numerator or denominator is greater than 1.5 trillion or less than –1.5 trillion can cause rounding.

Syntax Rules
MathGV supports all of the most common expression syntax rules used in mathematics. Many of these such as implied multiplication are not commonly supported by computer applications.

Order of Operations - Mathematical operations are evaluated using the standard order of operations. All operations on same level are done from left to right.

   1. Operations in parentheses "(", ")" are done first.
   2. "^" Exponents. Done from left to right, not right to left.
   3. "*", "/" Multiplication and division.
   4. "+", "-" Addition and subtraction are done last.

Exponentiation "^" is also done from left to right. This means that the expression "2 ^ 3 ^ 4" will be evaluated as "(2 ^ 3) ^ 4". If three to the fourth power needs to be done first, then the expression must be written as "2 ^ (3 ^ 4)".

Grouping - the grouping characters "( )", "{ }", and "[ ]" may all be used interchangeably.

Functions - A large number of standard predefined mathematical functions and their inverses are supported.

Function Arguments Must Be In Parentheses - Predefined function arguments must be enclosed in parentheses. The expression "Log X" is illegal, it must be written as "Log(X)".
   Examples
   ln(x)
   sin(2pi + 1)
   exp(ln(x + 2))

Scientific Notation - Standard scientific notation (where 6500 = 6.50E+03) is not directly supported. The character "E" is defined as the constant value 2.718. The expression (6.50E+03) will not cause an error. It will be evaluated as (6.50*2.718+3) giving a result of 20.667, not the 6500 that scientific notation would give. Scientific notation can be written using the form (6500 = 6.50*10^3) or for small number (0.0065 = 6.50*10^-3).

Constant Values PI and E - The predefined constant values PI and E are supported. PI = 3.14159265358979 E = 2.71828182845905 = EXP(1.0)

Implied Multiplication - Implied multiplication notation is supported. When two variables, constants, numbers, etc. are written with no operation between them a multiplication "*" is implied. The following is a list of equivalent legal examples.

Implied Not Implied
2x 2*x
2Pi 2*Pi
3.5x^2 - 1 3.5*(x^2) – 1
X(3 – y) x*(3 - y)
(x – 1)(x + 1) (x - 1)*(x + 1)
Ln(x - 1)x Ln(x - 1)*x
XLn(x - 1) x*Ln(x - 1)

Double Negatives, and Positives - The following expressions are legal. They are simplified when the expression is evaluated.

Legal Expression Simplified Equivalent
X - - 2 x + 2
3 + + x 3 + x
4 + - x 4 – x
X - + - + - 5 x – 5

Negative Numbers to Fractional Powers - Negative numbers to fractional powers are supported. The exponent can not be a rounded number. Functions like Sin() and Sqrt() can cause rounding. Fractions where the numerator or denominator is greater than 1.5 trillion or less than –1.5 trillion can cause rounding. See the Fractional Results section above for more information.

Factorials - Factorials using the "3!" notation are not allowed. The "Fact(x)" function allows only integer values in (0 <= X <= 20).

Blank Spaces - All blank spaces in mathematical expressions are ignored.

Upper and Lower Case Letters - All mathematical expressions are not case sensitive. Upper and lower case letters are treated exactly the same.