Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Intro to Sage Assignment Completed

Views: 191
Image: ubuntu2004

Introduction to Sage Assignment


Note 1: Below each question, click on the horizontal gray line. This will create a new input cell. Type your answer directly into this Sage worksheet, and click "Run."


Note 2: If you opened the PDF, please open the .sagews file and put your answers there.


Question 0

Watch the lecture video here.

Did you watch the video? [Type yes or no.]

%md yes

yes

Problem alert: Near the end of the video, I discuss a "gear" button in the upper right hand corner. This button no longer exists. Instead, use the "Account" button. I apologize for the error.

Question 1

Compute the following in Sage. Make sure you have enough parentheses to get the order of operations right.

Part a

12+547\displaystyle\frac{12+5}{4-7}

(12+5)/(4-7)
-17/3

Part b

42×51(7+4)\displaystyle 4^{2\times 5-1}-(7+4)

4^(2*5-1)-(7+4)
262133

Question 2

Find decimal approximations for the following expressions using Sage.

Part a

5sin(37)\displaystyle \sqrt{5\sin(3^7)}

N(sqrt(5*sin(3^7)))
1.47703673538369

Part b

log2(arcsin(13))\displaystyle\log_{2}\left(\arcsin\left(\frac{1}{3}\right)\right)

N(log(arcsin(1/3)),2)
-1.0

Part c

cos(π7)ln(12)\displaystyle \cos\left(\frac{\pi}{7}\right)-\ln(12)

N(cos(pi/7)-ln(12))
-1.58393778188558

Part d

12008+2e4/3\displaystyle\sqrt[8]{1200}+2\cdot e^{4/3}

N(1200^(1/8)+2*e^(4/3))
10.0133741057920

Question 3

Consider the functions

f(x)=3x25x+1f(x)=3x^2-5x+1g(t)=2t19t2+4g(t)=\frac{2t-1}{9t^2+4}

Part a

Define ff and gg in Sage. Don't forget you need explicit multiplications, and use plenty of parentheses.

f(x)=3*x^2-(5*x)+1
g(t)=((2*t)-1)/((9*t^2)+4)
3*(8)^2-5*8+1
153
f(8)
153

Part c

Calculate f(x+h)f(x)h\displaystyle\frac{f(x+h)-f(x)}{h}

[Hint: don't forget to declare hh to be a variable]

%var h
(f(x+h)-f(x))/h
(3*(h + x)^2 - 3*x^2 - 5*h)/h

Part d

Calculate g(21)g(21)

g(21)
41/3973

Part e

Calculate g(t12)g(t-12)

g(t-12)
(2*t - 25)/(9*(t - 12)^2 + 4)

Notes

  • Each lab assignment is worth 5 points.

  • The assignment will be graded in class, although you may choose to work on the assignment before class.