Software for Algebra and Geometry Experimentation
while Mathematica, Matlab, and Maple are very expensive.
SAGE = Python + Local Web Interface + Tons of Work
A GOOD CALCULATOR - but a lot better than others
We can do simple arithmetic with SAGE:
Use: * for multiplication, + for addition, - for subtraction, / divide, ^ or ** for exponentiation
Place mouse on the cell below. Then press "evaluate" that appears below this cell. Or press Shift-Enter. (Note: don't put the equals (=) sign! )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
At the very least, it can do what any calculator can do. SAGE will try to perform everything according to the standard ORDER of operations.
FRACTIONS
It can handle fractions symbolically (manipulate algebraically as if all are symbols) and numerically. More on the difference later. We will use the pound sign "#" to place a comment within the cell without affecting what you're calculating. SAGE-python knows this.
|
|
|
|
Now we can further process that last result using the following method:
|
|
|
|
|
|
|
|
Handling Exponents using the caret ^ symbol or double asterisk **.
|
|
|
|
|
|
SQUARE ROOTS
Using the square root function sqrt( )
|
|
|
|
|
|
Notice that if it can't get the exact value of the square root of 5, it will handle it just symbolically. And it would seem like it didn't do anything. You see it simply wants to try to maintain an exact value. To force it to perform and provide at least an estimate of the square root, just add a decimal point so that SAGE knows your input is a decimal and you want it to give an answer in decimal form. Then in the next cell we introduce the number "n" operator to control the number of digits of our final answer/estimate.
|
|
Then in the next cell we introduce the number "n" operator to control the number of digits of our final answer/estimate. This is even better.
|
|
|
|
|
|
Using the UNDERSCORE "_ " and the SHOW( ) functions or commands:
We use the underscore "_" symbol to mean "use the last result" OR more precisely, the result of the last cell that was evaluated. This is a really great time-saver as it aids in better manipulation w/o retyping longer and complicated expressions if they happen to be one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PI and the SEMICOLON
SAGE can be used do display \pi's approximate value up to a certain number of digits. Note: we use a semicolon to separate the instructions or commands we want SAGE to do for us. This means we can do multiple instructions within one cell.
|
|
BASIC ALGEBRA: VARIABLES, EXPRESSIONS, AND EQUATIONS
In SAGE, x is considered a variable. To use other letters as variables, one must "declare" them using the var command:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASSIGNing (using one equal sign =) a whole expression to another letter makes it easier to manipulate expressions. We demonstrate this below:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GREATEST COMMON FACTOR(DENOMINATOR)
|
|
|
|
|
|
|
|
LEAST COMMON MULTIPLE (LCM)
|
|
|
|
|
|
|
|
|
|
Here's a "trick" you can use to get the LCM of two variable expressions like x^{2} and 2x^{5}. First, make them the denominators of unit fractions (1 over your expression). Pretend you will add them all. Then use the factor command to force SAGE to combine them into one rational expression. Then you can also use "show" to get a better view of the result. Finally, you can see that the LCD (or our LCM) here is 2x^{5}.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PRODUCTS: Forgetting to use *
|
|
|
|
SOLVING EQUATIONS
We use the double equal signs "= =" to write an equation. The single equal sign "=" as in some examples above mean just assigning an expression to, say, a variable so we can reuse that expression without retyping it.
|
|
We use solve(equation, variable to be solved). Note: use parenthesis ( ) not square brackets [ ].
|
|
|
|
|
|
|
|
Or we can directly put the equation inside the solve( put equation here, put variable to be solved here) like this:
|
|
|
|
|
|
|
|
PLOTTING
|
|
|
|
|
|
|
We can plot several graphs at a time for easy comparison: x^{2} + 2 \, x - 1, x^{2} + 2 \, x, x^{2} + 2 \, x + 1, x^{2} + 2 \, x + 2
|
|
|
|
SAGE can also do 3D plots and animation. See numerous published worksheets.
THE END
|
|