Introduction | Selecting Equations | Solving Equations |
At the Mathomatic prompt, you can enter:
Mathomatic has about 30 different commands. They are described below, mostly in alphabetical order. If the command is longer than 4 letters, you only need to type in the first 4 letters for Mathomatic to recognize the command. The command is not executed until you press the Enter key. Most commands operate on the current equation by default.
Many commands have an "equation number range" argument. An equation number range may be a single equation number, a range of equation numbers separated by a dash ("-"), or the word "all", which specifies all equations. If omitted, the operation is performed on the current equation.
Syntax: #equation-number-to-select[[:] new-equation]
To change the current equation number, type a pound sign ("#") followed by the number of the equation you wish to select. If the number is followed by a space and a new equation, the equation at the number is replaced with the new equation. To enter an equation without any simplification, append a colon (":") to the equation number.
Syntax: variable-to-solve-for
Mathomatic can solve the current equation for any single variable or for zero.
To solve for a variable, just type the variable in at the prompt. Mathomatic will proceed to manipulate the current equation until all of the solutions for the specified variable are determined. If successful, the solutions are stored in the current equation and displayed. Cubic and quintic equation solving is not supported. Quartic equations (fourth degree polynomials) can be solved if they are bi-quadratic (only degree four and degree two terms).
To solve for zero, type in "0" at the prompt. A solve operation for zero will always be successful.
Syntax: calculate ["factor"] [equation-number]
This command prompts you for the values of each variable in the Right Hand Side of the current or specified equation. It then simplifies the result and automatically substitutes "sign" variables with all possible values, displaying each solution as it does so. If all variables are supplied with constant values, then each solution will be a constant, otherwise the result will contain the variables you didn't enter the values for. The equation is not modified by this command.
The "factor" option factors all integers into their prime factors before display, if they are less than or equal to 14 digits long.
This command should be used to temporarily plug in values and expand confusing "sign" variables in a solved equation. It is also automatically invoked when you type in a numeric expression, without any variables, at the Mathomatic prompt. No need to get out your calculator when you are using Mathomatic!
Syntax: clear [equation-number-range]
This command clears equation spaces so that they can be reused. The specified equations are deleted from memory.
The argument may be the equation number to delete, a range of equation numbers to delete, or "all" to delete all equations. As with other commands, the default equation is the current equation.
Syntax: code [equation-number-range] [">"file-name]
This command displays the current or specified equations in C language code. The output can be redirected to "file-name". This output should compile and emulate the equation from Mathomatic, using any precision floating point arithmetic. Just define and assign the variables used in the C program.
Syntax: compare equation-number ["with" equation-number]
This command compares two equations for equality. If only one argument is supplied, the comparison is between the current equation and the specified equation. The comparison will be faster and more accurate if both equations are previously solved for the same variable.
If this command says the equations are identical, then the equations are definitely identical. If this command says the equations may differ, then the equations might be identical if one of the equations is too hard for Mathomatic to simplify completely.
This command first compares the Right Hand Sides of both equations, if they are solved for a variable. If they are not equal, it solves both equations for zero, so it can compare the whole equations.
Syntax: copy [equation-number-range]
This command simply duplicates the current or specified equations and displays them.
Syntax: derivative [variable or "all"] [order]
This command computes the symbolic derivative of a function with respect to the specified variable, using the Right Hand Side of the current equation as the function. The current equation should first be solved for a normal variable. If successful, the derivative is placed in the next available equation space, displayed, and becomes the current equation. The original equation is not modified.
Differentiation in Mathomatic is rule based and very fast.
Specifying "all" computes the derivative with respect to all normal variables. It is equivalent to adding together the derivatives with respect to each variable.
Specifying the order allows you to repeatedly differentiate all at once. The default is to differentiate only once (order = 1).
Syntax: divide [variable]
This command is for doing and experimenting with polynomial and numerical division and Greatest Common Divisors. Mathomatic has a symbolic polynomial division routine which this command calls without any other processing, unless just numbers are entered.
This command prompts for the dividend (the main polynomial) and the divisor (what you want to divide the main polynomial by). The quotient and remainder are displayed. Then the GCD (Greatest Common Divisor) is displayed. If just numbers were entered, the LCM (Least Common Multiple) is also displayed. The LCM is the same as the Lowest Common Denominator, if both entered numbers are denominators.
A variable may be specified on the command line as the base variable of the two polynomials, but it is usually not necessary because Mathomatic automatically selects a base variable.
The Greatest Common Divisor of "a" and "b" is defined as the greatest number or polynomial that evenly divides both "a" and "b". The Euclidean algorithm is used by Mathomatic to arrive at the GCD for both numbers and polynomials.
Syntax: edit [file name]
Under MS-DOS, this command will execute the editor specified in the file "amedit.bat" on all loaded equations or on an existing Mathomatic input file. When you are not running Mathomatic, use a text editor to edit "amedit.bat" to change the editor for Mathomatic to your favorite editor.
Under Unix, this command invokes the editor specified in the "EDITOR" environment variable.
Just type "edit" at the Mathomatic prompt to edit all equations stored in the equation spaces. When you are done editing Mathomatic equations and commands, save and exit the editor to have them automatically read in by Mathomatic. If Mathomatic gets an error reading in its new input, observe where the error is and continue, to automatically re-enter the editor.
Syntax: eliminate variables ["using" equation-number]
This command is used to combine simultaneous equations. It will replace all occurrences of the specified variables in the current equation with solved equations, essentially eliminating the specified variables from the current equation. If you are eliminating only one variable, the equation to solve can be specified using the "using" argument. If the "using" equation number is not specified, Mathomatic will search backwards, starting at the current equation minus one, for the first equation that contains the specified variable.
The equation to solve is solved for the specified variable, then the Right Hand Side is inserted at every occurrence of the specified variable in the current equation. This effectively eliminates the specified variable from the current equation, resulting in one less unknown.
There is an advantage to eliminating multiple variables in one command: each equation will be used only once. If the same equation is solved and substituted into the current equation more than once, it will cancel out.
For an example of how to use this command to combine and solve simultaneous equations for all unknowns, see the file "simul.in". This file is a text input file for Mathomatic that can be read in with the "read" command.
Syntax: factor [equation-number-range] [variables]
This command does some basic simplification and trivially factors any variables it can, unless variables are specified, in which case only those variables are factored out.
For example, with the following equation:
a = (b*c)+(b*d)
variable "b" factors out and the result of this command is:
a = b*(c+d)
This command usually cannot factor polynomials. To factor polynomials, use the "simplify" command.
Syntax: graph [equation-number]
This command is only available in the MS-DOS version of Mathomatic.
This command displays a 2 dimensional graph of the current or specified equation. Since it is a 2D graph, it can only graph functions of a single variable. The equation must be a solved equation and may contain any number of "sign" variables (which usually make a more interesting graph). The variable to the left of the equals sign is represented by the Y axis (vertical) and the variable to the right of the equals sign is represented by the X axis (horizontal).
The X-intercepts, where Y equals 0, are displayed on the right hand side of the screen.
In asymptote viewing mode (enabled with the "a" key), the asymptotes are displayed as blue lines on the graph and the asymptote equations are displayed on the right hand side of the screen. An asymptote in Mathomatic is a straight line which approximates the graphed function as its X or Y value approaches positive or negative infinity. The asymptotes are numerically approximated as the graph program starts up.
This command executes the program "graph.exe" and requires EGA or VGA. The file "graph.exe" must be in the current directory or in the executable search path, to function.
Once you are in the graph program, you can:
Syntax: group ["factor"] [equation-number-range]
This command groups divisors together and displays equations in fraction format. It makes equations with divides in it more readable. For example, "a/b/c" will convert to "a/(b*c)", and then be displayed as:
a ----- (b*c)
Non-integer constants are converted to reduced fractions, if they are exactly equal to a fraction and it would improve readability.
The "factor" option causes all integers, less than or equal to 14 digits long, to be factored into their prime factors, including the numerator and denominator of fractions.
Syntax: help [command-name or "equations" or "all" or "geometry"]
This command is provided as a quick reference. If the argument is a command name, a short description and syntax of that command is displayed. The command name may be abbreviated. If the argument is "equations", equation help is displayed. If the argument is "all", a short description and syntax of all commands is displayed. If the argument is "geometry", some commonly used geometric formulas will be displayed.
Syntax: imaginary [equation-number]
This command copies the imaginary part of a complex equation to the next available equation space. If the equation is not complex, it will tell you and abort. A complex equation is an equation that contains both imaginary and real parts. To copy the real part, see the "real" command.
The equation to be separated should first be solved and simplified. If you want to exclude the "i#" constant from the result, type the following command after the "imaginary" command:
replace i# with 1
Syntax: list [equation-number-range]
This command displays the current equation in single line format, if typed with no arguments. It is typically used with the argument "all" to display all stored equations.
To display equations in fraction format, see the "group" command.
Syntax: optimize [equation-number]
This command splits the specified equation into smaller multiple equations with no repeated expressions. Each repeated expression becomes a new equation solved for a temporary variable ("t").
To undo this, use the "eliminate" command.
Syntax: pause
This command waits for the user the press the Enter key. It is useful in text files that are read in to Mathomatic.
Syntax: print ["factor"] equation-number-range [">"file-name]
This command outputs equations to the printer, or a file, in fraction format. This command will work with any printer that can print ASCII text.
The "factor" option causes all integers in the specified equations to be factored into their prime factors, before they are printed.
Syntax: quit
Type in this command to exit Mathomatic. All equations are discarded. To save your equations, see the "save" command.
Syntax: read file-name
This command reads in a text file as if you typed the text of the file in at the prompts. The text file should contain Mathomatic equations and commands. "read" commands may be nested.
Equations saved with the "save" command are restored using this "read" command.
This command is automatically executed when you start up Mathomatic with file names on the command line.
The default file name extension for Mathomatic input files is ".in".
Syntax: real [equation-number]
This command copies the real part of a complex equation to the next available equation space. If the equation is not complex, it will tell you and abort. A complex equation is an equation that contains both imaginary and real parts. To copy the imaginary part, see the "imaginary" command.
The equation should be solved and simplified before this command is executed. There will be no imaginary numbers in the result.
Syntax: remark [comment]
This command does nothing. You can put comments in your Mathomatic text files using this command. You can also put comments after Mathomatic input by preceding them with a semicolon (";"). Everything on the line after the semicolon is ignored.
Syntax: replace ["temp"] [variables ["with" expression]]
By default, this command prompts you for a replacement expression for each variable in the current equation. If an empty line is entered for a variable, the variable remains unchanged. The result is placed in the current equation and displayed. If "temp" is included on the command line, no equations are modified and the simplified result is displayed.
This command is very useful for renaming or substituting variables in an equation. It is smart enough to do variable interchange.
If variables are specified on the command line, you will be prompted for those variables only and all other variables will be left unchanged.
Syntax: roots
This command displays all complex roots of a given root of a complex or real number. The number of the root is prompted for, first. For example, "3" would give the 3 roots of the cubed root. Next, the real and imaginary parts of the complex number are prompted for. Then each root is displayed, along with an "Inverse Check" value, which should equal the original complex number.
Syntax: save file-name
This command saves all equations in the specified text file. If the file exists, Mathomatic will ask you if you want to overwrite it. The saved equations can be reloaded at a later time by using the "read" command. You can edit the saved equations with your favorite ASCII text editor.
Syntax: sensitivity variables
This command computes the exact sensitivity equation for the specified variable or variables in the current equation. The current equation must first be solved for a single variable. The sensitivity equation is placed in the next available equation space. The original equation is not modified.
The sensitivity equation will show you what percent the output variable value changes when the input variable changes a certain percent. It does NOT show you the maximum change within an interval, instead it shows you the exact change at a certain percent.
If you have an equation:
y = f(x)
the sensitivity of "x" is found by using the following equation:
f(x)*(1+(y_percent_change/100)) = f(x*(1+(x_percent_change/100)))
and then solving for "y_percent_change".
An example:
1-> y=ax #1: y = a*x 1-> sensitivity x #2: y_percent_change = x_percent_change 2->
Syntax: set ["no"] [option]
This command sets various options for the current session. They remain in effect until you exit Mathomatic. Typing "set" with no arguments shows you the current option settings.
"set debug" followed by an integer sets the debug level number. If the level number is 2, Mathomatic will show you how it solves equations. Level 4 debugs the "simplify" command and its polynomial routines. Levels 5 and 6 show all intermediate expressions. The initial debug level is 0, for no debugging.
"set case" will set alphabetic case sensitive mode, while "set no case" will set case insensitive mode (all alphabetic characters will be converted to lower case). "set no case" is the default.
"set color" enables ANSI color mode.
"set columns" followed by a positive integer sets the number of character columns on the screen. When an equation is displayed in fraction format and it is wider than the number of screen columns, single line format is used, instead. "set no columns" does no checking for screen size and always displays in fraction format.
"set no groupall" will set the display mode to single line format, instead of fraction format. This may be helpful when Mathomatic is used by other programs as an algebraic processor.
Syntax: simplify ["symbolic" or "quick"] [equation-number-range]
This command completely simplifies the current or specified equations.
Use this command whenever you think an equation is not completely simplified or if you don't like the way an equation is factored.
The "symbolic" option indicates ((a^n)^m) should always be reduced to (a^(n*m)). This removes any absolute value operations ((a^2)^.5 = a^(2*.5) = a^1 = a).
The "quick" option skips expanding expressions raised to the power of 2 or higher, like ((x+1)^99). This prevents "Expression too big!" errors. Algebraic fractions are kept simple.
This command applies some simple algebraic transformations and then tries to do polynomial division, smart (heuristic) division, and factor polynomials with repeated or symbolic factors, to simplify equations completely.
Smart division is like polynomial division, but it tries every term in the dividend, instead of just the terms raised to the highest power, to make the expression smaller.
Syntax: tally
This command does nothing more than prompt for a value, add it to a running total, simplify, display the running total, and repeat. No equations are modified. It is very useful for adding and subtracting many numbers. Enter an empty line to end.
Syntax: taylor variable
This command computes the Taylor series expansion of the current equation with respect to the variable specified on the command line. The expansion is performed on the expression to the right of the equals sign only. It prompts you for the "point" of expansion, which is usually a variable, but may be a constant or expression. Then it prompts you for the order of the series, which is an integer indicating how many derivatives to take in the expansion. The result is placed in the next available equation space, displayed, and becomes the current equation. The result is not simplified so you usually need to use the "simplify" command after this command.
Syntax: unfactor [equation-number-range]
This command unfactors the current equation if typed with no arguments. The argument specifies which equations to unfactor.
Unfactoring is also known as "expanding" or "multiplying out". To illustrate what unfactoring does, suppose you have the following equations:
a = b*(c+d) z = (x+y)^2
If you unfactor the above equations, you will get:
a = (b*c)+(b*d) z = (x^2)+(2*x*y)+(y^2)
Copyright © 2000 George Gesslein II