Page History: Beginner’s introduction to creating and editing equations
Compare Page Revisions
Page Revision: 2011/02/10 05:53
If you happen to have come across this page, it is still under construction. I had to post it prematurely in order to workout an image display issue. Only the first of several pages are posted here. If you like where it is going, it will be finished in one or two weeks.(Present date: Feb 8 2010).
When using SMath you are not entering equations into a simple text field as you might do in a simpler calculator or graphing program. This program uses a rich and interactive process to create and edit formulas, functions and matrices. This tutorial discusses that process.
Note that this tutorial begins at the absolute beginning for the benefit of new users.
It is highly recommended that you set up your browser window to fill one half of the screen and your SMath window to fill the other half.
Using SMath as a simple calculator
To use the program as a simple calculator you basically type in the desired expression and an equal sign. In an SMath window, type in the simple expression, 12.3*45= ,followed by Enter to get the following...

When the calculation is a more complicated you will at times have to advance the curser using the right arrow key to move it from one text segment to the next. Type in the following to appreciate this fact. 12^3*44/5=

When entering an equation it is often more convenient to use the Spacebar instead of the right arrow key to advance the curser.
At this point, we will immediately introduce the subject of variables and functions so that we will be dealing with the subject matter in the most general terms.
Defining variables
Create a variable by typing, b1=40+60 ,and press Enter
You end up with...

Because the variable b1 had not been previously defined the program assumed that you wished to define it and inserted a colon before the equal sign.
If below that definition you were to attempt redefine b1 to be equal to 22 using the similar set of keystrokes, b1=22 ,you end up with the expression below immediately after pressing the equal key = .

The program this time assumed, at the moment that you entered the equal key, that you wished to know what b1 is presently equal to.
If one wishes to redefine b1 to a different value lower on the page, one would instead need to indicate this by using the colon symbol, : ,instead of the equal sign, = . Typing, b1:77 ,results in....
b1:=77
In short, := ,with a colon, is the “definition” symbol and, = ,is the “evaluation” symbol.
Note, variables themselves can contain variables and functions, for example…
b2:= 12 + b1^2*sin(pi/3)
Inserting functions
If you wish to insert a function into an expression you can use the dialog box at Insert(menu) >> Function...
However if the function name is known to you it is quicker to use the dropdown list that automatically appears when a partial function name is typed.
To insert the log function, type in the characters, 12 +lo ,and the below will appear.
.
.
.
Use of the program’s curser
To learn how to use the program’s curser, first enter the expression ln(30)*12^3 + b1 = to get the below
ln(30)*12^3 + b1 = xxxxxxx
Note that this expression must be below the point on the page where b1 is defined.
As expected, one can edit a single number, variable or function name, in much the same way that one edits any general text field. Specifically, you backspace over the character to the left of the curser and delete the character to the right. However when doing so the range of the curser can not be extending beyond a single number, variable or function name. Refer to the examples below.
.
.
.
Useful hints on editing an existing expression
- To make an existing value such as b1 the argument of a function you first have to put the value in brackets and then enter the appropriate text segment before it.
ln(30)+|b1=xxxxxxxxx : Place curser
ln(30)+(b1)=xxxxxxxxx : Create brackets
ln(30)+sin(b1)=xxxxxxxxx: Then enter the name of the function
- When entering new terms into a expression you must at times enter the operator before entering the associated text segment.
For example, to multiply the two separate values ln(30)+b1 by 6 from the left hand side you must, after extending the curser under ln(30)+b1, first insert the multiplication operator before entering the value of 6.
|ln(30)+b1=xxxxxx :Extend curser
■*(ln(30)+b1) =xxxxx : Insert operator, The brackets are inserted automatically
6*(ln(30)+b1) = xxxxx : Enter value
.
.
.
Idiosyncrasies
When editing expressions one needs to be aware of some idiosyncrasies.
Toward this end we will discuss the systematic behaviour of the curser. Enter the equation, 1+2 +3 + 4 = ,and slowly press the left and right arrows studying the position and range of the curser as you do. Below is a summary of the different curser positions and ranges.
Odds and Ends
- You can cause answers to be expressed symbolically rather than in decimal notation by using the right-arrow, Evaluate Symbolically symbol instead of the, = ,sign. It is accessible in the side panel and its shortcut is Ctrl+ >.
{3^2+sqrt(4+1)}/{5+2}=1.6052@#
{3^2+sqrt(4+1)}/{5+2}—{9+sqrt(5)}/7@#
- We mentioned earlier that internal functions appear in the drop down list. It is also true that one’s own created variables, formula and functions appear in the list. Out of order
For example, if you typed in the function and formula examples above and now type in the following width=33*Leng those two examples will also appear in the list.
width:=33*Leng--
--
This feature allows you to use long names for user functions, formula and variables and not get bogged down with a lot of typing.
.
.
.
Quick list of some SMath features
Formula
- The line between a formula and a variable is really just a matter of ones point of view. They are mathematically identical expect that a formula always contains a variable while a variable may not necessarily contain another variable. Formulas are also generally more complex. The below is a formula...
.
.
.
User functions
- You can define User functions. You follow the desired name of the function with a left bracket and then a variable or set of variables separated by commas.
.
.
.
Matrices
SMath handles matrices, below are some examples.
.
.
.
The Solve( f(x)=g(x), x ) function
Using the, solve( f(x)=g(x), x ) ,function you can solve for the variable of a general equality.
If you have an equality such as f(x)= g(x) you place it into the first argument and the variable you wish to solve for in the second argument. For example...
.
.
.
The polyroots(Vector) function
The polyroots(Vector) function will solve a polynomial even if it has complex roots.
In this case the function’s argument is a column matrix which contains the coefficients of the polynomial.
To solve...
.
.
.
Graphs
-You can plot 2D and 3D graphs in SMath. To insert one at the red insertion curser, go to insert in the menu or press Shift + @.
I know I don’t need the “Shift +” part but I like this convention{Sample graph of sin(x) and sin(x)^2}
.
.
.
Units
SMath can keep track of units and perform conversions.
To make simple conversions you insert units after your numbers or variables by evoking the Units dropdown list using the single quotation mark, ‘ .
For example, to find out how many meters there are in 100 ft you would do the following...
100*'ft=30.48*'m@# : Type, 100 >> ‘ >> ft >> Tab >> =
.
.
.
Programming
You can perform simple programming procedures. For example you can define functions with the IF procedure like below
Func(x)←if(abs(x)≥1,2*x,x)
.
.
.
Solving Derivatives
You can find the derivatives of functions. Evoke the derivative function by clicking the option in the side panel or type, dif , and use the dropdown list.
.
.
.
Solving Integrals
.
.
.