2*3
2^5
20/4
2/3
2/3 + 7/3
4/3+11/3
2/3+10/17
4/7+11/7
13*7
43*2
print(13*7)
43*2
a = 3
a+5
This is a "markdown" cell for text
Now we are going to do graphing $x^2$
2^4
plot(x^2)
z = var('z') # have to tell sage that z should be a symbolic variable
plot(z^2)
plot(sin(x),(-6,6))
sin(pi) # this is a comment - sin is evaluated in degrees
# typing a question mark after a command gives a help page about it
plot?
sin?
p1 = plot(sin(x^2), (-6,6), color='red')
p2 = plot(sin(x), (-6,6))
p1+p2
# doesn't work on SINC site computers, may work on yours
y= var('y') # tells sage that y is a symbolic variable
plot3d(x^2+y^2, (x,-2,2), (y,-2,2))
factor(24) # factors number into primes
factor(1102129121293812302138)
factor(2^501-1) #takes too long, we should interrupt using stop bottom
factor(24)
divisors(24)
factor(x^2+2*x+1) # x^2+2x+1 doesn't work
factor(x^4-1)
expand((x-4)*(x^2+17))
diff(x^3)
list_of_divisors = divisors(24) # stores divisors(24) into list_of_divisors
list_of_divisors
list_of_divisors[0] # list indexing starts at 0
list_of_divisors[7]
list1 = [4,5,6]
list2 = [13,15,17]
list1+list2
list3 = [1,2,3,"word"] # "word" is a string
list1+list3
"word" + "another word" # adding strings
list3[1:3] # includes list3[1], but not list3[3]
list3[1]
list3[2]