Mathematical Notation

Sometimes it is necessary to express numbers or a mathematical function in a format that a computer will understand. Often in the problems for this course you will be asked to provide numerical answers. When a number is expected as an answer, there will be a textbox with a black edge like this.

$x$ =

Valid numbers can be integers or floating point numbers like or or . A '.' must be used for the decimal separator. Invalid formats that will give errors are (press the buttons to try them).

For large or small numbers you should use scientific E-notation. In this notation, a number like $6.023\times 10^{23}$ is represented as 6.023E23. The number after the E is the exponent. Most programming languages use E-notation.

Small numbers like $1.6022\times 10^{-19}=$ 1.6022E-19 have a minus sign after the E. Logically you should be able to input large numbers with a + sign after the E, $2.998\times 10^{8}=$ 2.998E+8. Even though the server often prints a + sign after the E, it does not accept this as input. Leave the + sign out: $2.998\times 10^{8}=$ 2.998E8.


Sometimes it is necessary to express a mathematical function in a format that a computer will understand. The following table lists some common functions and their computer readable form. If the answer to a question should be a mathematical function the edge of the textbox will be blue. Press the buttons to load some mathematical expressions into the plotting program below. You can try creating your own combinations of mathematical functions.

Function

Computer Notation

$\sqrt{x}$

sqrt(x)

$x^y$

pow(x,y)

$e^x$

exp(x)

$|x|$

abs(x)

$\ln(x)$

log(x)

$\sin(x)$

sin(x)

$\cos(x)$

cos(x)

$\tan(x)$

tan(x)
$f(x)$

x

$f(x)$ = 

from x =  to x = .


Vectors can be represented as column vectors or as a sum of their three components in the $x-$, $y-$ and $z-$directions. Here $\hat{x}$, $\hat{y}$, $\hat{z}$ are unit vectors which have length 1 and points in the $x-$, $y-$, and $z-$direction respectively. In computer code, a vector is typically specified by putting the three components in square brackets [] and separating the components by commas.

Vector

Computer Notation

$\vec{a}= \left(\begin{array}{b} 3 \\ 5 \\ 7 \end{array}\right) = 3\hat{x} + 5\hat{y} + 7\hat{z} $

a=[3,5,7]

Here $\hat{x}$, $\hat{y}$, and $\hat{z}$ are unit vectors that have a length 1 an point in the $x-$, $y-$, and $z-$direction respectively. In computer code, the components of a vector are often given inside square brackets [] and separated by commas.

Question