# WeBWorK Functions

## Mathematical Symbols Available In WeBWorK

• -   Subtraction
• *   Multiplication can also be indicated by a space or jutaposition, e.g. 2x, 2 x or 2*x, also 2(3+4).
• /   Division
• ^ or **   You can use either ^ or ** for exponentiation, e.g. 3^2 or 3**2
• Note, roots can be taken using exponents, so to get the fifth root of 17, use 17^(1/5) .
• ( and ) You can also use square brackets, [ ], and braces, { }, for grouping, e.g. [1+2]/[3(4+5)]

## Mathematical Constants Available In WeBWorK

• pi   gives 3.14159265358979, e.g. cos(pi) is -1
• e   gives 2.71828182845905, e.g. ln(e*2) is 1 + ln(2)

## Mathematical Functions Available In WeBWorK

• abs( ) The absolute value. You can also use |x| for abs(x).
• sqrt( ) Square root
• exp( ) The same function as e^x
• log( ) The logarithm with base 10
• logten( ) Another name for the logarithm with base 10
• ln( ) The natural logarithm (base e)
• sin( ) Note: sin( ) uses radian measure
• cos( ) Note: cos( ) uses radian measure
• tan( ) Note: tan( ) uses radian measure
• sec( ) Note: sec( ) uses radian measure
• arcsin( )
• asin( ) Another name for arcsin
• arccos( )
• acos( ) Another name for arccos
• arctan( )
• atan( ) Another name for arctan
• sinh( ) Hyperbolic sine
• cosh( ) Hyperbolic cosine
• tanh( ) Hyperbolic tangent
• sech( ) Hyperbolic secant
• sgn( ) The sign function, either -1, 0, or 1
• step( ) The step function (0 if x < 0, 1 if x >= 0)
• fact( ) The factorial function (defined only for non negative integers). You can also use n! for fact(n).

## Syntax for entering expressions

• Be careful entering expressions just as you would be careful entering expressions in a calculator.
• Sometimes using the * symbol to indicate mutiplication makes things easier to read. For example (1+2)*(3+4) and (1+2)(3+4) are both valid. So are 3*4 and 3 4 (3 space 4, not 34) but using a * makes things clearer.
• Use ('s and )'s to make your meaning clear. You can also use ['s and ]'s and {'s and }'s.
• Don't enter 2/4+5 (which is 5.5) when you really want 2/(4+5) (which is 2/9).
• Don't enter 2/3*4 (which is 8/3) when you really want 2/(3*4) (which is 2/12).
• Entering big quotients with square brackets, e.g. [1+2+3+4]/[5+6+7+8], is a good practice.
• Be careful when entering functions. It's always good practice to use parentheses when entering functions. Write sin(t) instead of sint or sin t. But WeBWorK is smart enought to accept sin t or even sint. But sin 2t is really sin(2)t, i.e. (sin(2))*t. Be careful.
• Understand that sin^2t is really short hand for (sin(t))^2 and must be entered this way. Actually you could enter it as sin(t)^2 or even sint^2, but don't try such things unless you really understand the precedence of operations.
• For example 2+3sin^2(4x) is wrong. You need to enter something like: 2+3(sin(4x))^2 or 2+3sin(4x)^2. Why does the last expression work? Because things in parentheses are always done first [ i.e. (4x)], next all functions, such as sin, are evaluated [giving sin(4x)], next all exponents are taken [giving sin(4x)^2], next all multiplications and divisions are performed [giving 3sin(4x)^2], and finally all additions and subtractions are performed [giving 2+3sin(4x)^2].
• The complete rules for the precedence of operations, in addition to the above, are
• Multiplications and divisions are performed left to right: 2/3*4 = (2/3)*4 = 8/3.
• Additions and subtractions are performed left to right: 1-2+3 = (1-2)+3 = 2.
• Exponents are taken right to left: 2^3^4 = 2^(3^4) = 2^81 = a big number.
• Use the "Preview Button" to see exactly how your entry looks. E.g. to tell the difference between 1+2/3+4 and [1+2]/[3+4] click the "Preview Button".

## Scientific Notation Available In WeBWorK

• 2.1E2 gives 210
• 2.1E-2 gives .021