Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
4217 views

Intro to working in Sage

Tips:

  1. To execute a command, hit "Run" or press "shift+enter".

  2. Multiplciation must be written as , e.g. 4x must be typed 4x

  3. To define variables use =, in an equation use == to represent the equals sign.


Practice:

- Part 1: Practice evaluating expressions and basic equations

  1. Evaluate 1/2+3/7, show answer as a fraction and decimal

  2. Simplify the expressions: 5*(x-3)+(x-3)^2+7x

  3. Assign the value of -5 to a and evaluate a^2-3a

  4. Define y as a variable

  5. Solve 5y^2-8y-4=0

  6. Solve the system 5x+3y=13, -3x-2y=-9

- Part 2: Practice Graphing functions and equations

  1. Define f(x)=-3x+6 (explicit)

  2. Plot f(x) on the window [-3,3]x[-3,15]

  3. Graph the equation 3x+2y=12 (implicit)

ASSIGNMENT - Part 3: Conics and systems practice

  1. Graph the conic equation 3x^2+6x+2y^2-8y-5=0, on an appropriate window

  2. Graph the equation x+2=-4(y-1)^2 on an appropriate window

  3. Solve the system of equations x^2-2xy+y^2=7, x^2-2xy+y^2=1

Part 1 - you will see examples worked out for each problem. Copy the code and change it for the assigned problem!

#1. Evaluate 1/2+3/7, show answer as a fraction and decimal #example: 2/3+4/9 (2/3+4/9).n()
1.11111111111111
1/2+3/7
13/14
#2. Simplify the expressions: 5(6x-3)+(x-3)^2+7x #example: 4*(2*x+4)-2*(x+4)-10*x
-4*x + 8
5*(6*x-3)+(x-3)*(x-3)+7*x
(x - 3)^2 + 37*x - 15
#3. Assign the value of -5 to a and evaluate a^2-3a #example: b=4 b^3-2*b
56
#4. Define y as a variable #example: z=var('z') z
z
#5. Solve 5y^2-8y-4=0 #example: solve(z^2-5*z-6==0,z)
[z == 6, z == -1]
#6. Solve the system 5x+3y=13, -3x-2y=-9 #example: var('y') solve([2*x-y==-4,-5*x+2*y==2],(x,y))
y [[x == 6, y == 16]]

Part 2: Graphing functions and equations

#5. Define f(x)=-3x+6 and evaluate f(3),f(-1),f(0) and f(b) #example g(x)=2*x-4 g
x |--> 2*x - 4
var('b') (g(3),g(-1),g(0),g(b))
b (2, -6, -4, 2*b - 4)
#6. Plot f(x) on the window [-3,3]x[-3,15] #example:
plot(g(x),(-3,3))
#7. Graph the equation 3x+2y=12 (implicit) #example: var('x y') implicit_plot(2*x-y==4,(x,-3,3),(y,-5,5),axes=true,aspect_ratio=.6)
(x, y)
#OR you can define f(x,y)=2*x-y-4, and plot f(x,y) f(x,y)=2*x-y-4 implicit_plot(f,(-3,3),(-5,5))

Part 3 Your turn to apply the above to conic sections!

  1. Graph the conic equation 3x^2+6x+2y^2-8y-5=0, on an appropriate window

  2. Graph the equation x+2=-4(y-1)^2 on an appropriate window

  3. Solve the system of equations x^2-2xy+y^2=7, x^2-2xy+y^2=1