From: Mike G. v. a. <we...@ma...> - 2009-10-29 01:59:12
|
Log Message: ----------- Adding help files containing the syntax for entering functions and algebraic equations as asnwers . Tags: ---- rel-2-4-patches Added Files: ----------- webwork2/htdocs/helpFiles: Syntax.html Revision Data ------------- --- /dev/null +++ htdocs/helpFiles/Syntax.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <title>Syntax for entering answers to WeBWorK</title> + <meta name="generator" content="BBEdit 8.7"> +</head> +<body> +<h1 id="firstHeading">Syntax for entering answers to WeBWorK</h1> + + +<h4> <span class="mw-headline">Mathematical Symbols Available In WeBWorK</span></h4> +<ul><li> + Addition +</li><li> - Subtraction +</li><li> * Multiplication can also be indicated by a space or juxtaposition, e.g. 2x, 2 x or 2*x, also 2(3+4). +</li><li> / Division +</li><li> ^ or ** You can use either ^ or ** for exponentiation, e.g. 3^2 or 3**2 +</li><li> Parentheses: () - You can also use square brackets, [ ], and braces, { }, for grouping, e.g. [1+2]/[3(4+5)] +</li></ul> +<a name="Syntax_for_entering_expressions"></a><h4> <span class="mw-headline">Syntax for entering expressions</span></h4> +<ul><li> Be careful entering expressions just as you would be careful entering expressions in a calculator. +</li><li> <b>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".</b> +</li><li> 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. +</li><li> Use ('s and )'s to make your meaning clear. You can also use ['s and ]'s and {'s and }'s. +</li><li> Don't enter 2/4+5 (which is 5.5) when you really want 2/(4+5) (which is 2/9). +</li><li> Don't enter 2/3*4 (which is 8/3) when you really want 2/(3*4) (which is 2/12). +</li><li> Entering big quotients with square brackets, e.g. [1+2+3+4]/[5+6+7+8], is a good practice. +</li><li> 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 even though WeBWorK is smart enough to <b>usually</b> accept sin t or even sint. For example, sin 2t is interpreted as sin(2)t, i.e. (sin(2))*t so be careful. +</li><li> You can enter sin^2(t) as a short cut although mathematically +speaking sin^2(t) is shorthand for (sin(t))^2(the square of sin of t). +(You can enter it as sin(t)^2 or even sint^2, but don't try such things +unless you <b>really</b> understand the precedence of operations. The +"sin" operation has highest precedence, so it is performed first, using +the next token (i.e. t) as an argument. Then the result is squared.) +You can always use the Preview button to see a typeset version of what +you entered and check whether what you wrote was what you +meant. :-) +</li><li> For example 2+3sin^2(4x) will work and is equivalent to +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 in order from left to right [giving +3sin(4x)^2], and finally all additions and subtractions are performed +[giving 2+3sin(4x)^2]. +</li><li> Is -5^2 positive or negative? It's negative. This is because +the square operation is done before the negative sign is applied. Use +(-5)^2 if you want to square negative 5. +</li><li> When in doubt use parentheses!!! :-) +</li><li> The complete rules for the precedence of operations, in addition to the above, are +<ul><li> Multiplications and divisions are performed left to right: 2/3*4 = (2/3)*4 = 8/3. +</li><li> Additions and subtractions are performed left to right: 1-2+3 = (1-2)+3 = 2. +</li><li> Exponents are taken right to left: 2^3^4 = 2^(3^4) = 2^81 = a big number. +</li></ul> +</li><li> <b>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".</b> +</li></ul> +<a name="Mathematical_Constants_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Constants Available In WeBWorK</span></h4> +<ul><li> pi This gives 3.14159265358979, e.g. cos(pi) is -1 +</li><li> e This gives 2.71828182845905, e.g. ln(e*2) is 1 + ln(2) +</li></ul> +<a name="Scientific_Notation_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Scientific Notation Available In WeBWorK</span></h4> +<ul><li> 2.1E2 is the same as 210 +</li><li> 2.1E-2 is the same as .021 +</li></ul> +<a name="Mathematical_Functions_Available_In_WeBWorK"></a><h4> <span class="mw-headline">Mathematical Functions Available In WeBWorK</span></h4> +<p>Note that sometimes one or more of these functions is disabled for a WeBWorK problem because the +instructor wants you to calculate the answer by some means other than just using the function. +</p> +<ul><li> abs( ) The absolute value +</li><li> cos( ) Note: cos( ) uses radian measure +</li><li> sin( ) Note: sin( ) uses radian measure +</li><li> tan( ) Note: tan( ) uses radian measure +</li><li> sec( ) Note: sec( ) uses radian measure +</li><li> cot( ) Note: cot( ) uses radian measure +</li><li> csc( ) Note: csc( ) uses radian measure +</li><li> exp( ) The same function as e^x +</li><li> log( ) This is usually the natural log but your professor may have redined this as log to the base 10 +</li><li> ln( ) The natural log +</li><li> logten( ) The log to the base 10 +</li><li> arcsin( ) +</li><li> asin( ) or sin^-1() Another name for arcsin +</li><li> arccos( ) +</li><li> acos( ) or cos^-1() Another name for arccos +</li><li> arctan( ) +</li><li> atan( ) or tan^-1() Another name for arctan +</li><li> arccot( ) +</li><li> acot( ) or cot^-1() Another name for arccot +</li><li> arcsec( ) +</li><li> asec( ) or sec^-1() Another name for arcsec +</li><li> arccsc( ) +</li><li> acsc( ) or csc^-1() Another name for arccsc +</li><li> sinh( ) +</li><li> cosh( ) +</li><li> tanh( ) +</li><li> sech( ) +</li><li> csch( ) +</li><li> coth( ) +</li><li> arcsinh( ) +</li><li> asinh( ) or sinh^-1() Another name for arcsinh +</li><li> arccosh( ) +</li><li> acosh( ) or cosh^-1()Another name for arccosh +</li><li> arctanh( ) +</li><li> atanh( ) or tanh^-1()Another name for arctanh +</li><li> arcsech( ) +</li><li> asech( ) or sech^-1()Another name for arcsech +</li><li> arccsch( ) +</li><li> acsch( ) or csch^-1() Another name for arccsch +</li><li> arccoth( ) +</li><li> acoth( ) or coth^-1() Another name for arccoth +</li><li> sqrt( ) +</li><li> n! (n factorial -- defined for <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">n</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span> +</li><li> These functions may not always be available for every problem. +<ul><li> sgn( ) The sign function, either -1, 0, or 1 +</li><li> step( ) The step function (0 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmmi10"><</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.833em; vertical-align: 0.744em;"></span></span></nobr></span>, 1 if <span class="typeset"><nobr><span class="scale"><span style="position: relative;"><span style="position: absolute; top: -0.131em; left: 0em;"><span class="cmmi10">x</span><span style="position: relative; margin-left: 0.277em;"><span class="cmsy10">Ã</span></span><span style="position: relative; margin-left: 0.277em;"><span class="cmr10">0</span></span> </span><span class="blank" style="width: 2.429em; height: 0.722em; vertical-align: 0.722em;"></span></span><span class="blank" style="height: 0.93em; vertical-align: 0.744em;"></span></span></nobr></span>) +</li><li> fact(n) The factorial function n! (defined only for nonnegative integers) +</li><li> P(n,k) = n*(n-1)*(n-2)...(n-k+1) the number of ordered sequences of k elements chosen from n elements +</li><li> C(n,k) = "n choose k" the number of unordered sequences of k elements chosen from n elements +</li></ul> +</li></ul> + +For more information: + +<a href="http://webwork.maa.org/wiki/Available_Functions">http://webwork.maa.org/wiki/Available_Functions</a> + + +</body> +</html> |