Syntax for Entering Functions in Interactivate Activities
- Numerical values entered should be accurately calculated from 10 -8 to 10 8. Numbers larger or smaller than these values produce unreliable results. You may use scientific notation for entering functions in the form: mantissa followed by an e followed by 10 raised to the desired power. For example 0.000032 would be input as 3.2e10^-5.
- Functions and their compositions can be typed as follows:
Function | Symbol | Examples | Meaning |
addition | + | x+3 | x plus three |
subtraction | - | 5-x | five minus x |
multiplication | * | x*(x-2) | x times the quantity x minus two |
division | / | 3/x | three divided by x |
power | ^ | x^3 | x to the power of three |
power | ** | x**3 | x to the power of three |
π | pi | sin(pi*x) | sine of the quantity π times x |
square root | sqrt(...) | sqrt(x) | square root of x |
nth root* | x^(1/n) | x^(1/3) | cube root of x |
absolute value | abs(...) | abs(3-x) | absolute value of the quantity three minus x |
e to the power of x | exp(...) | exp(x) | e to the power of x |
sine | sin(...) | sin(2x) | sine of the product 2 times x |
cosine | cos(...) | cos(5-x) | cosine of the quantity five minus x |
tangent | tan(...) | tan(x) | tangent of x |
arcsine | asin(...) | asin(x) | returns a value between -π/2 and π/2 |
arccosine | acos(...) | acos(x) | returns a value between 0 and π |
arctangent | atan(...) | atan(x) | returns a value between -π/2 and π/2 |
secant | sec(...) | sec(x) | returns the secant of x, that is, 1/cos(x) if cos(x) ≠ 0 |
cosecant | csc(...) | csc(x) | returns the cosecant of x, that is, 1/sin(x) if sin(x) ≠ 0 |
cotangent | cot(...) | cot(x) | returns the cotangent of x, that is, 1/tan(x) if tan(x) ≠ 0 |
hyperbolic sine | sinh(...) | sinh(x) | hyperbolic sine of x |
hyperbolic cosine | cosh(...) | cosh(10/x) | hyperbolic cosine of the quantity ten divided by x |
hyperbolic tangent | tanh(...) | tanh(x) | hyperbolic tangent of x |
natural logarithm | ln(...) | ln(x) | natural logarithm of x |
base 10 logarithm | log(...) | log(x+5) | base ten logarithm of the quantity x plus five |
positive part of the operand | ppo(...) | ppo(x+2) | returns x+2 if x+2>0 and 0 if x+2<0 |
step | step(...) | step(x) | returns 0 if x ≤ 0 and 1 if x > 0 |
floor | floor(...) | floor(x) | returns x rounded down to the nearest integer |
ceiling | ceil(...) | ceil(x) | returns x rounded up to the nearest integer |
factorial | fac(...) | fac(x) | returns 0 if x < 0, 1 if 0 ≤ x < 1, and 1×2× . . . ×floor(x) if x ≥ 1 |
sawtooth | saw(...) | saw(x) | returns x - floor(x), that is, the fractional part of x. |
derivative | diff(...) | diff(2x^2 + 3x - 5) | returns 4x + 3 |
Area under curve from 0 to x | integ(...) | integ(sin(x)) | returns 1-cos(x) |
sign | sign(...) | sign(x) | returns -1 if x < 0, 0 if x = 0, and 1 if x > 0 |
square wave | square(...) | square(x) | returns sign(sin(x)) |
round x to the nearest integer | round(...) | round(x) | returns floor(x + 0.5) |
* When x is less than zero, the exponent must be written as a whole number or in fraction form, not a decimal. For instance, if you want to graph the fifth root of negative numbers, you must write x^(1/5), not x^(0.2).