Java Math Engine: Built-In Functions
The system has several built-in functions. Their name is case sensitive. All
these functions require their argument be in parenthesis. sin x is not allowed.
Use sin(x) instead. The argument of each function can be any valid mathematical
expression. The complete list is:
- abs(expr) returns the absolute value of expr.
- arccos(expr) returns the angle in radians between 0 and pi whose
cosine is expr.
- arcsin(expr) returns the angle in radians between -pi/2 and pi/2
whose sine is expr.
- arctan(expr) returns the angle in radians between -pi/2 and pi/2
whose tangent is expr.
- ceil(expr) returns the smallest integer value that is not less than
expr.
- cos(expr) returns the cosine of expr, where expr is in radians.
- cot(expr) returns the cotangent of expr, where expr is assumed to
be in radians.
- csc(expr) returns the cosecant of expr, where expr is assumed to
be in radians.
- diff() symbolic differentiation operator. See help on differentiation.
- exp(expr) returns the exponential base e of expr.
- floor(expr) returns the largest integer value that is not greater
than expr.
- int() symbolic integration operator. See help on integration.
- ln(expr) returns the logarithm base e of expr. If expr is not in
the domain, an error will occur.
- log(expr) returns the logarithm base 10 of expr. If expr is not
in the domain, an error will occur.
- log2(expr) returns the logarithm base 2 of expr. If expr is not
in the domain, an error will occur.
- max(expr1, expr2) returns the maximum between expr1 and expr2.
- min(expr1, expr2) returns the minimum between expr1 and expr2.
- sec(expr) returns the secant of expr, where expr is assumed to be
in radians.
- sin(expr) returns the sine of expr, where expr is assumed to be
in radians.
- sqrt(expr) returns the square root of expr. If expr is not in the
domain, an error will occur.
- sum(expr, index, start, end) finds the partial sum using
expr, with the index running from start to end.
- expr is any expression recognized by the system.
- index is the letter used as the index of summation
in expr.
- start is the starting value of index.
It must be an integer.
- end is the ending value of index.
It must be an integer.
- tan(expr) returns the tangent of expr, where expr is assumed to
be in radians.
The system will check to see if expr is in the domain of the function, an
error will be returned if it is not.
All the operations supported by the Java Math Engine (see help on operations)
can also be applied to functions to create new ones. In this case, the operations
are pointwise. For examples, the expessions below are all valid:
- sin(x)+x^2+x (functions can be added or subtracted)
- exp(x)*sin(x) (functions can be multiplied)
- sin(x)/cos(x) (functions can be divided)
- sin(x)^ln(x) (a function raised to an exponent which is another
function)
- sin(cos(x^2)) (functions can be composed)
- sum(x^n/n!,n,0,10) The partial sum with n ranging
from 0 to 10.