Pedagoguery Software Inc. GrafEq PSi logo frieze
   Home    [Products\GrafEq]    Downloads    Prices & Purchasing

B Functions and Relations

This appendix explains many interesting functions and relations. They are presented logically in groups which are in similar order as GrafEq’s easy button groups. Mathematical symbols not readily available from the standard keys on a keyboard can be entered with easy buttons; for details, refer to the Appendix A, Easy Buttons.

Tip:A good way to understand and investigate a function or relation is to graph it with GrafEq.


B.1 Algebraic Functions

  • Exponentiation, such as a2 and a3, takes one base term and one power term.

    Hint:Besides easy buttons, entry of exponentiation can also be initiated by pressing the up arrow key or the caret key in GrafEq.

  • Radicals, such as square root (sqrt) and cube root (root(3,x)), have one root index term and one radical term.
  • Logarithms (log for base 10, lg for base 2, and ln for natural logarithm / base e) takes a base term and an argument term.

    Hint:Besides easy buttons, entry of logarithm base can also be initiated by pressing the down arrow key in GrafEq.


B.2 Arithmetic Operations

  • Addition (+), subtraction (-), and add-and/or-subtract (±) can be either infix binary with the operation in-between two argument terms, or prefix unary with the operation in front of one argument term.

    Hint:Besides the easy button, the ± symbol can be entered with the Ctrl-+ key combination in GrafEq.

  • Multiplication (*, ×, and ⋅) and division (/ and ÷) are binary infix operations.

    Hint:Besides the easy button, the ÷ symbol can be entered with the Ctrl-/ key combination in GrafEq.


B.3 Factoring Functions

  • Modulo (mod) takes two argument terms, and returns the positive remainder of the division of the first argument term by the second argument term.
  • Least common multiple (lcm) and greatest common divisor (gcd) each takes two or more argument terms, and are generalized to real valued arguments.
  • The Gamma (gamma) function is a continuous extension of the factorial function. For any non-negative integer x, gamma(x+1) is equal to x!.
  • Factorial (!) is postfix unary; the operation follows its argument. It defined recursively. For any non-negative integer x, (x+1)! is (x+1)×x!; 0! is 1.


B.4 Integer Functions

Integer functions convert real values to integers. Each function takes one argument.
  • Floor (⌊x⌋) returns the greatest integer smaller than or equal to the argument value.

    Hint:Besides the easy buttons, the floor symbols can be entered with the Ctrl-[ and Ctrl-] key combinations in GrafEq.

  • Ceiling (⌈x⌉) returns the smallest integer larger than or equal to the argument value.

    Hint:Besides the easy buttons, the ceiling symbols can be entered with the Ctrl-{ and Ctrl-} key combinations in GrafEq.

  • Round (Round) and round (round) both return the closest integer from the argument value. If the argument is exactly half-way between two integers, Round returns the larger while round returns the smaller. For example: Round(4.5) is 5 and round(4.5) is 4.
  • Trunc (trunc) returns the integer portion of its argument. It returns the same value as the floor function for positive values and the same value as the ceiling function for negative values.


B.5 Measurement Functions and Magnitude Operations

  • Absolute Value (|x|) takes one argument and returns its value without the sign.
  • Signum (signum) takes one argument. For negative arguments, signum is -1; for positive arguments, signum is 1; for zero, signum is also zero.
  • Angle (angle) is a binary function; angle(x,y) is the angle between the point (x,y) and the x-axis.


B.6 Order Functions

  • Minimum (min) and maximum (max) each takes two or more arguments, and returns the smallest, and largest value respectively.
  • The xth smallest (minx) and xth largest (maxx) functions each take a variable number of arguments; minx returns the xth smallest, and maxx returns the xth largest value. When x does not evaluate to an integer between 1 and the number of arguments both functions are undefined.


B.7 Relational Functions

Equal to (=), less than (<), greater than (>) and combinations thereof, such as less than or equal to (≤), are infix binary.

Hint:Less than or equal to can be entered using an easy button, with the Ctrl-< key combination, or by entering ‘<’ and then ‘=’. The key combination for greater than is Ctrl->.


B.8 Set and Conditional Functions

  • Set element listings are to be enclosed within pairs of braces ({}) with a comma (,) separating every two successive set elements.
  • Set membership can be defined with “is a member of” (∈) and “is not a member of” (∉).

    Hint:Besides easy button, “is a member of” can also be entered with the Ctrl-= key combination in GrafEq.

  • Conditional definitions are described within pairs of braces ({}), with one or more value / condition terms within; “if” seperates the value from its condition. For example, “y={x if x≥0; -x if x<0}” may be entered as a formula to be graphed.

Hint:Pairs of braces, brackets, as well as parentheses can also be used to control precedence.


B.9 Trig Functions and Multifunctions

Each trig function and multifunction takes one argument.
  • Trig operations include those based on circles, hyperbola, squares, and diamonds.
    • Circular trig functions are based on the circle, and include sine (sin), cosine (cos), tangent (tan), cosecant (csc), secant (sec), and cotangent (cot).
    • Hyperbolic trig functions are based on the hyperbola, and include the six functions of the circular ones, but with an appended “h”. They are sinh, cosh, tanh, csch, sech, and coth.
    • Square trig functions are based on the square, and include the six functions of the circular ones, but with an appended “q”. They are sinq, cosq, tanq, cscq, secq, and cotq.
    • Diamond trig functions are based on the diamond parallelogram, and include the six functions of the circular ones, but with an appended “d”. They are sind, cosd, tand, cscd, secd, and cotd.
  • Inverse Trig functions include circular, hyperbolic, square, and diamond functions. Each collection has the same trig functions, but with a preceding “Arc”. They include Arcsin, Arccosd, and so on.
  • Inverse Trig multifunctions include circular, hyperbolic, square, and diamond multifunctions. Each collection has the same trig operations, but with a preceding “arc”. They include arcsin, arccosd, and so on.


To conclude this section of the manual, we will give some additional hints and tips about GrafEq functions, relations, and operations:

  • Each argument or term can be a simple term or a complex term that can contain any number of functions, operations, and values. Complex terms might need to be enclosed in parentheses.
  • Degrees (°), minutes ('), and seconds ('') multiplies by π÷180, π÷(180×60), and π÷(180×60×60) respectively.

    Hint:5'33'' is interpreted as the product of 5π÷(180×60) and 33π÷(180×60×60), not the sum.

  • The operations obey the standard rules of precedence. The following list lists the operations from highest to lowest precedence:
    1. Bracket-like operations, such as brackets, parenthesis, braces, floor, ceiling, absolute value, and conditional/piecewise definition.
    2. Postfix operations, such as factorial.
    3. Exponentiation.
    4. Multiplication and division.
    5. Prefix operations, such as negation.
    6. Addition and subtraction.
    7. Comparisons, such as equal-to, less-then, and greater-than.
    Precedence for function application is not as simple. For example, sin2x is parsed as sin(2x); multiplication has higher precedence than the sine function. However, sinxcosx is parsed as (sinx)(cosx); multiplication has higher precedence in sin2x, but has lower precedence in sinxcosx.
  • The visual formatting used in GrafEq’s algebraic window often reflect whether a specification is entered correctly. If in any doubt, parentheses or brackets can always be used.

    Tip: The structural tree structured relation description is a new feature introduced in GrafEq 2.04, and can be used for accurate confirmation.

Navigation Options
jump to theTable of Contents

go back toEasy Buttons
continue on toDraw Tools
send us email