Math & Computer Science Server > ASCIIMathML Tutorial

 

 

ASCIIMath Notation for Calculus and beyond

Authored by Chapman University undergraduate students

Subscripts and Superscripts are used for a wide variety of math formulas. You have probably seen them before in logarithmic functions or sums of infinite series. They are very simple to type out in the editor. Here are a few examples.

\`log_b(x) = y\` is `log_b(x) = y`
\`ln(x) = log_e(x)\` is `ln(x) = log_e(x)`

Superscripts are used in sums of series, integrals, and numerous other functions. Simply put the superscript after the subscript as an exponent. The basic notation is: \`Symbol_subscript^superscript\` which will appear as `"Symbol"_"subscript"^"superscript"`. Depending on the symbol, the editor will place the subscript and superscript in their appropriate places.

\`sum_(n=1)^oo 1/(2n)=1\` `sum_(n=1)^oo 1/(2n)=1`

More examples are given below since we will be using these a lot in upcoming examples. Keep formatting in mind at all times. If you use parentheses correctly, you can even have subscripts and superscripts on either. For example \`X_1_b\` `X_1_b` is wrong but \`X_(1_b)\` `X_(1_b)` would show a subscript on the 1. There are more possibilities like \`X_(1_(b_2))^(3_(a-1)^(B_c^d)\` `X_(1_(b_2))^(3_(a-1)^(B_c^d)` but you won't ever deal with anything that complicated wink.

Limits and Continuity

Now that we know how to use subscripts and superscripts, we can properly format almost any math expression in the editor. Here we illustrate this using the definition of continuity. A function \`y = f(x)\` `y=f(x)` is

  1. continuous at a number `a` of its domain if \`lim_(x->a) f(x) = f(a)\` `lim_(x->a) f(x) = f(a)`
  2. continuous from the right at a number `a` of its domain if \`lim_(x->a^+) f(x) = f(a)\` `lim_(x->a^+) f(x) = f(a)`
  3. continuous from the left at a number `a` of its domain if \`lim_(x->a^(-)) f(x) = f(a)\` `lim_(x->a^(-)) f(x) = f(a)`

Pretty simple to type out, but let's try doing an actual example. The function `f(x)` is defined by \`f(x) = (x^2-1)/(x-1)\` `f(x) = (x^2-1)/(x-1)` when \`x != 1\` `x != 1` and by \`f(1)=2\` `f(1)=2`. Is `f` continuous at `x=1`? The Continuity Test states that the function `f(x)` is continuous at `x=a` if and only if all three of the following statements are true.

  1. `f(a)` exists (`a` lies in the domain of `f`)
    `f(1) = 2` therefore it lies in the domain of `f`
  2. \`lim_(x->a) f(x)\` `lim_(x->a) f(x)` exists (`f` has a limit as \`x-> a\` `x-> a`).
    \`lim_(x->1) f(x) = 2\` `lim_(x->1) f(x) = lim_(x->1)(x^2-1)/(x-1) = lim_(x->1) x+1 = 2` where the first two equalities hold since, for the limit, `x` is approaching `1` but is not equal to `1`.
  3. \`lim_(x->a) f(x) = f(a)\` `lim_(x->a) f(x) = f(a)` (the limit equals the function value).
    \`lim_(x->1) f(x) = 2 and f(1) = 2\` `lim_(x->1) f(x) = 2 and f(1) = 2`
    So the function `f(x)= (x^2-1)/(x-1)` is continuous at `x=1`

Notice in the previous example, we had to define the function separately when `x=1` in order to make it continuous. This is an example of a piece-wise defined function. Piece-wise defined functions in the editor are based off of matrix notation. Don't worry too much about matrices right now, but in order to make a matrix type an open and closing bracket of any type. Depending on the number of rows and columns, put in a new open and closed bracket separated by commas for each row. Any expressions typed between those new brackets will be your column expressions. You can separate these by commas in order to add more columns. It sounds complicated, but it is fairly easy to type out.

\`[(row1column1, row1column2),(row2column1, row2column2)]\` will appear as `[(row1column1, row1column2),(row2column1, row2column2)]`

A piecewise defined function is a matrix that starts with an open curly brace { and ends with an "invisible bracket" (a colon followed by a closing brace) :}. Then for each piece of the function, add a new row and type out the function and the condition on the next column. \`{(function1,if condition1),(function2,if condition2),(function3,if condition3):}\`
`{(function1,if condition1),(function2,if condition2),(function3,if condition3):}`
Here is an example using our previous function:

\`f(x)={((x^2-1)/(x-1), if x!=1),(2, if x=1):}\` will appear as `f(x)={((x^2-1)/(x-1), if x!=1),(2, if x=1):}`

Piece-wise defined function notation can also be used to indicate where a function is undefined. Example:

\`x/x={(1,if x!=0),(text{undefined},if x=0):}\` will appear as `x/x={(1,if x!=0),(text{undefined},if x=0):}`

Derivatives and Integrals

Let `y=f(x)` be a function. The derivative of `f` is the function whose value at `x` is the following limit:

\`f'(x) = lim_(h->0) (f(x+h)-f(x))/h\` `f'(x) = lim_(h->0) (f(x+h)-f(x))/h`
Derivatives of a function are often written as \`d/dx f(x)\` `d/dx f(x)` . The editor recognizes certain notations for derivatives. If the output of `f(x)` is another variable, for example, if `y=f(x)` we can write the derivative as: \`dy/dx\` `dy/dx`. Sometimes you will have to use variables other than `x` and `y`. The notation for these derivatives is not recognized immediately by the editor as it was for `dy/dx`. For example, the product rule states that \`d/dx(u*v)=v*(du)/dx+u*(dv)/dx\` `d/dx(u/v)=v*(du)/dx+u*(dv)/dx`. Notice how the editor requires you to put `du` in parentheses. If you were to type out \`du/dx\` it would appear as `du/dx` because the editor does not recognize "du" as a single name (it only recognizes `dx,dy,dz` and `dt`). Here is another example.

Suppose we have a function `y = f(u(v(x)))`. Let `f(u)=u-1 and u(v)=v^2 and v(x)=2x+1`. The function would be `y = (2x+1)^2 -1`

The Chain Rule dictates that \`d/dx(y)=(df)/(du)*(du)/(dv)*(dv)/dx\` `d/dx(y)=(df)/(du)*(du)/(dv)*(dv)/dx` . We simply find the derivative of `f(u)`, `u(v)`, and `v(x)`.
\`(df)/(du) = 1\` `(df)/(du) = 1`
\`(du)/(dv)=2v\` `(du)/(dv)=2v`
\`(dv)/(dx) =2\` `(dv)/dx =2`
\`dy/dx=1*2v*2 = 4v\` `dy/dx=1*2v*2 = 4v` . Plug `v` into the equation and you see that the derivative of `y=(2x+1)^2-1` is `4(2x+1)`

In order to type integrals into the editor, simply type \`int\` `int`. Follow this by a subscript and superscript to show the range that you will be solving for. For example:

The Fundamental Theorem of Calculus

Suppose `f` is continuous on `[a,b]`.

  1. If \`g(x) = int_a^x f(t)dt\`, then \`g'(x)=f(x)\` (displays as: If `g(x) = int_a^x f(t)dt`, then `g'(x)=f(x)`).
  2. \`int_a^b f(x)dx = F(b)-F(a)\` `int_a^b f(x)dx = F(b)-F(a)`, where `F` is any antiderivative of `f`, that is, `F'=f`.

Let's use the 2nd rule to find the area under the curve `f(x)=x^2` on the interval `[2,5]`.
\`int_2^5 x^2 dx\` `int_2^5 x^2 dx`
The antiderivative of `x^2` is `1/3(x)^3`. In other words, `f(x) = x^2 and F(x)= 1/3(x^3)`.
Now evaluate `F(b)-F(a)`. This could be written as \`[F(x)]_a^b\` `[F(x)]_a^b`. You can put subscripts and superscripts on the closed square bracket to show the values of `a` and `b` you will be substituting into `F`. So:

\`[1/3(x)^3]_2^5 = 1/3(5)^3 - 1/3(2)^3 = 39\` `[1/3(x)^3]_2^5 = 1/3(5)^3 - 1/3(2)^3 = 39`

You now have all the skills you need to type any basic calculus equations in the ASCIIMath Editor. If you have any further questions, feel free to ask your instructor.

Chapman University . One University Drive, Orange, CA 92866   Phone: 714-997-6815