Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168703
Image: ubuntu2004
"This is a short tutorial that will take you through the basic functions of sage math software. Let us begin by adding and subtracting. Type in an expression and then click on evaluate." 2+7
9
2-7
-5
"As you can see from above, you can use the + and - key as you normally would to add and subtract. You also use the * and / key to multiply and divide."
'As you can see from above, you can use the + and - key as you normally would to add and subtract. You also use the * and / key to multiply and divide.'
8*7
56
7/3
7/3
7.0/3.0
2.33333333333333
"Notice that if you use whole number and divide, you get a fraction. So to divide, the number needs to have a decimal."
'As you can see, if you use whole number and divide, you get a fraction. So to divide, the number needs to have a decimal.'
x=var('x') solve(x^2+3*x+2,x) "Notice that you need to specify your variable, then tell sage to solve(put the expression in parenthesis followed by a comma and then the variable)
[x == -2, x == -1]
x, y, z=var('x y z') solve([3*x + 2*y - 3*z == 1],x) I want to point out a few things here. Notice that you must put the multiplication sign (*) between 3 and x. Without that sign, you will get an error. Also notice that this solves to x but there are still three variables. Next let us try to solve for more than one variable.
[x == (3*z - 2*y + 1)/3]
x, y = var('x, y') solve([y==3x-4], x, y)
[[x == 2, y == 1]]
circle((0,0), 1, rgbcolor=(1,1,0)) This graphs a circle with radius one.
circle((1,2), 2, rgbcolor=(1,1,0)) this gives you a circle with radius two,centered at point (1,2)
line 4 line((y=x+b), rgbcolor=(_sage_const_1 ,_sage_const_1 ,_sage_const_0 )) ^ SyntaxError: invalid syntax