SageMath Worksheets in CoCalc
This is an interactive document for running calculation online.
First, notice the additional button bar below the project specific bar. The "Play" button is for evaluating a block.
Each block of consecutive lines can either be input of code which is run by the interpreter or some text formatted via markdown.
A block is evaluated by placing the cursor into it and either clicking on the "Play" button or by simultaneously pressing the
Shift
+Return
keys.New blocks are inserted at the bottom or when clicking on the delimiter line inbetween two blocks.
The first line of each input block signals the type of cell: e.g.
%md
for markdown,%r
for R,%python3
for Python3 or%sage
for SageMath.For the evaluation the default mode is usually set to SageMath, but it can be customized by running
%default_mode <mode>
.On the left side of each block there is a small triangle. It hides or reveals input and output blocks. This can also be accomplished by placing the cursor inside a block and clicking on the "out" toggle button in the menu.
Let's start with a simple calculation:
Here, we define two symbolic variables in Sage
Build a symbolic expression
... and evaluate it at and
... define a function "f(x)"
... evaluate it at
... and plot it for
Task: where is ?
Unfold the next input block to see the answer!
Next, let's go back to first-steps.tasks