History
SAGE = Python + Local Web Interface + Tons of Work
Introduction: 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
Use 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.
|
|
PREALGEBRA stuff: VARIABLES, EXPRESSIONS, AND EQUATIONS
In SAGE, x is considered a variable. To tell SAGE we want to use other letters as variables, one must "declare" them using the var command:
|
|
|
|
|
|
ASSIGNMENT (=)
There are times we want to re-use an expression(s) or an equation(s) and we don't want to retype those. What we want is to have some way of "storing" them. Indeed, in SAGE we used the "assignment" symbol: the single equal sign "=":
ASSIGNING (using one equal sign =) a whole expression to another letter makes it easier to manipulate expressions. We demonstrate this below:
|
|
We can now perform operations on "a" and "b":
|
|
Or we can assign complicated expressions that you can think of. This will erase the previous values assigned to both a and b !
|
|
|
|
|
|
|
|
|
|
We can form expressions out of expressions stored in a and b:
|
|
Greatest Common Denominator (GCD) or Factor (GCF)
(You can skip this for now!)
|
|
|
|
|
|
Least Common Multiple (LCM)
(You may skip this section for now!)
|
|
|
|
|
|
|
|
SOLVING EQUATIONS
We use the double equal signs "= =" to write an equation. Recall that the single equal sign "=" means just assigning or storing an expression to a symbol.
Consider the equation: 8x + 13 = -11. Then store this equation in "a":
|
|
We use the solve command:
solve( type your equation here, type the variable to be solved).
Note: use parenthesis ( ) not square brackets [ ].
|
|
|
|
|
|
|
|
|
|
A proportion problem: 12 is to x as 2.4 is to 0.35
|
|
|
THE END
published by dg1234 (summer 2011)
|
|
|
|