CoCalc Shared FilesLab 5 / Cheat Sheet (Midterm 2).sagewsOpen in CoCalc with one click!
Author: Caroline Hersman
Views : 41
#BASICS #ADD A CELL #ctrl + ;
#DECLARING VARIABLES (WK 4) var("a") a (a^3)/a a^2 #Note that Sage assumes that a 6= 0. #Symbolic variables don’t have to be single letters. var("sheep, rabbits") (sheep, rabbits) 2*sheep+3*rabbits 3*rabbits + 2*sheep #Once a symbolic variable has been declared, you can use it in subsequent calculations without re-declaring it until you close your worksheet. a*a 2 a^2 #The command factor allows you to factor polynomials. factor(a^2 + 5*a + 6) (a + 2)*(a + 3)
#OVERLAY A POINT plot(x^3, (x,-3,3), color="red") + point([1,3])