Difference between revisions of "Mathematical notation recognized by WeBWorK"
Jump to navigation
Jump to search
(7 intermediate revisions by 3 users not shown) | |||
Line 97: | Line 97: | ||
print "|}\n"; |
print "|}\n"; |
||
--> |
--> |
||
+ | |||
+ | == Grouping symbols == |
||
+ | * parentheses ( ) |
||
+ | * brackets [ ] |
||
+ | * braces { } |
||
+ | |||
+ | You can use any of these in your answer but they must match. 3(4+5) and 2[3(4+5)+6] are valid but 3(4+5} will given the error: Mismatched parentheses: '(' and '}'. |
||
+ | |||
+ | When WeBWorK gives a typeset version of your answer it only uses parentheses so for example it expresses your input of 2[3(4+5)+6] as 2(3(4+5)+6) but you can use whatever you want. |
||
== Constants == |
== Constants == |
||
+ | |||
+ | * e |
||
+ | * pi |
||
== Functions == |
== Functions == |
||
In general, functions can be used with or without parentheses. For example, <code>cosx</code>, <code>cos x</code>, and <code>cos(x)</code> are all equivalent. However, using parentheses makes grouping more explicit and are recommended. |
In general, functions can be used with or without parentheses. For example, <code>cosx</code>, <code>cos x</code>, and <code>cos(x)</code> are all equivalent. However, using parentheses makes grouping more explicit and are recommended. |
||
+ | |||
+ | Not all functions are available in all problems. |
||
+ | |||
+ | ;Numeric functions |
||
+ | |||
+ | * log() {{--}} Usually the natural log (<math>\log_e</math>), but your instructor may have redefined it to be log base 10 (<math>\log_{10}</math>). |
||
+ | * log10(), logten() {{--}} Log base 10; <math>\log_{10}</math>. |
||
+ | * sqrt() {{--}} Square root; <math>\sqrt{\ \ \ }</math>. |
||
+ | * abs() {{--}} Absolute value; <math>|\cdots|</math>. |
||
+ | * int() {{--}} Integer or floor function; <math>\lfloor\cdots\rfloor</math>. |
||
+ | * sgn() {{--}} Sign function; returns <code>+1</code> if its argument is positive, <code>-1</code> if its argument is negative, and <code>0</code> if its argument is zero. |
||
+ | * ln() {{--}} Natural log; <math>\log_e</math>. |
||
;Simple trig functions |
;Simple trig functions |
||
Line 113: | Line 137: | ||
* cot() |
* cot() |
||
− | InverseTrig => [qw(asin acos atan asec acsc acot |
||
+ | ;Inverse trig functions |
||
− | arcsin arccos arctan arcsec arccsc arccot atan2)], |
||
+ | |||
+ | * asin(), arcsin() |
||
+ | * acos(), arccos() |
||
+ | * atan(), arctan() |
||
+ | * asec(), arcsec() |
||
+ | * acsc(), arccsc() |
||
+ | * acot(), arccot() |
||
+ | * atan2() |
||
+ | |||
+ | ;Simple hyperbolic functions |
||
+ | |||
+ | * sinh() |
||
+ | * cosh() |
||
+ | * tanh() |
||
+ | * sech() |
||
+ | * csch() |
||
+ | * coth() |
||
+ | |||
+ | ;Inverse hyperbolic functions |
||
+ | |||
+ | * asinh(), arcsinh() |
||
+ | * acosh(), arccosh() |
||
+ | * atanh(), arctanh() |
||
+ | * asech(), arcsech() |
||
+ | * acsch(), arccsch() |
||
+ | * acoth(), arccoth() |
||
+ | |||
+ | ;Vector functions |
||
− | SimpleHyperbolic => [qw(sinh cosh tanh sech csch coth)], |
||
+ | * norm() |
||
− | InverseHyperbolic => [qw(asinh acosh atanh asech acsch acoth |
||
+ | * unit() |
||
− | arcsinh arccosh arctanh arcsech arccsch arccoth)], |
||
− | Numeric => [qw(log log10 exp sqrt abs int sgn ln logten)], |
||
+ | ;Complex functions |
||
− | Vector => [qw(norm unit)], |
||
+ | * arg() |
||
+ | * mod() |
||
+ | * Re() |
||
+ | * Im() |
||
+ | * conj() |
||
− | Complex => [qw(arg mod Re Im conj)], |
||
+ | [[Category:Students]] |
Latest revision as of 16:23, 7 November 2009
Operators
Operators recognized by WeBWorK, in order from highest to lowest precedence. Not all operators are available in all problems.
Operator | Prec. | Type | Associativity | Description |
---|---|---|---|---|
_
|
9 | binary | left | Vector and matrix element extraction |
!
|
8 | unary | right | Factorial |
^
|
7 | binary | right | Exponentiation |
**
|
7 | binary | right | Exponentiation |
+
|
6 | unary | left | Unary plus (indicates that a value is positive) |
-
|
6 | unary | left | Unary minus (indicates that a value is negative) |
/
|
3 | binary | left | Division |
*
|
3 | binary | left | Multiplication |
.
|
2 | binary | left | Vector dot product |
><
|
2 | binary | left | Vector cross product |
U
|
1.5 | binary | left | Union |
-
|
1 | binary | left | Subtraction |
+
|
1 | binary | left | Addition |
,
|
0 | binary | left | List (vector, set, point, etc.) separator |
Grouping symbols
- parentheses ( )
- brackets [ ]
- braces { }
You can use any of these in your answer but they must match. 3(4+5) and 2[3(4+5)+6] are valid but 3(4+5} will given the error: Mismatched parentheses: '(' and '}'.
When WeBWorK gives a typeset version of your answer it only uses parentheses so for example it expresses your input of 2[3(4+5)+6] as 2(3(4+5)+6) but you can use whatever you want.
Constants
- e
- pi
Functions
In general, functions can be used with or without parentheses. For example, cosx
, cos x
, and cos(x)
are all equivalent. However, using parentheses makes grouping more explicit and are recommended.
Not all functions are available in all problems.
- Numeric functions
- log() — Usually the natural log ([math]\log_e[/math]), but your instructor may have redefined it to be log base 10 ([math]\log_{10}[/math]).
- log10(), logten() — Log base 10; [math]\log_{10}[/math].
- sqrt() — Square root; [math]\sqrt{\ \ \ }[/math].
- abs() — Absolute value; [math]|\cdots|[/math].
- int() — Integer or floor function; [math]\lfloor\cdots\rfloor[/math].
- sgn() — Sign function; returns
+1
if its argument is positive,-1
if its argument is negative, and0
if its argument is zero. - ln() — Natural log; [math]\log_e[/math].
- Simple trig functions
- sin()
- cos()
- tan()
- sec()
- csc()
- cot()
- Inverse trig functions
- asin(), arcsin()
- acos(), arccos()
- atan(), arctan()
- asec(), arcsec()
- acsc(), arccsc()
- acot(), arccot()
- atan2()
- Simple hyperbolic functions
- sinh()
- cosh()
- tanh()
- sech()
- csch()
- coth()
- Inverse hyperbolic functions
- asinh(), arcsinh()
- acosh(), arccosh()
- atanh(), arctanh()
- asech(), arcsech()
- acsch(), arccsch()
- acoth(), arccoth()
- Vector functions
- norm()
- unit()
- Complex functions
- arg()
- mod()
- Re()
- Im()
- conj()