@@ -6,18 +6,17 @@ Welcome to Sage
6
6
7
7
This is a short tour of Sage as a calculator.
8
8
9
- The Sage command line has a prompt "``sage: ``". You do not have to add it.
9
+ The Sage command line has a prompt "``sage: ``". To experiment with the
10
+ following examples, you only enter the part after the prompt.
10
11
11
12
::
12
13
13
14
sage: 3 + 5
14
15
8
15
16
16
- If you use Sage on the Jupyter notebook, then put everything after the
17
- ``sage: `` prompt in an input cell, and press shift-enter to compute the
18
- corresponding output.
19
-
20
-
17
+ If you use Sage on the Jupyter notebook, then likewise put everything after the
18
+ prompt in an input cell, and press :kbd: `Shift - Enter ` to get the corresponding
19
+ output.
21
20
22
21
The caret symbol means "raise to a power".
23
22
@@ -40,7 +39,8 @@ Here we integrate a simple function.
40
39
41
40
sage: x = var('x') # create a symbolic variable
42
41
sage: integrate(sqrt(x) * sqrt(1 + x), x)
43
- 1/4*((x + 1)^(3/2)/x^(3/2) + sqrt(x + 1)/sqrt(x))/((x + 1)^2/x^2 - 2*(x + 1)/x + 1) - 1/8*log(sqrt(x + 1)/sqrt(x) + 1) + 1/8*log(sqrt(x + 1)/sqrt(x) - 1)
42
+ 1/4*((x + 1)^(3/2)/x^(3/2) + sqrt(x + 1)/sqrt(x))/((x + 1)^2/x^2 - 2*(x + 1)/x + 1)
43
+ - 1/8*log(sqrt(x + 1)/sqrt(x) + 1) + 1/8*log(sqrt(x + 1)/sqrt(x) - 1)
44
44
45
45
This asks Sage to solve a quadratic equation. The symbol ``== `` represents equality in Sage.
46
46
@@ -94,7 +94,8 @@ digits.
94
94
::
95
95
96
96
sage: factorial(100)
97
- 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
97
+ 93326215443944152681699238856266700490715968264381621468592963895217599993229915608
98
+ 941463976156518286253697920827223758251185210916864000000000000000000000000
98
99
99
100
::
100
101
@@ -107,7 +108,8 @@ This computes at least 100 digits of :math:`\pi`.
107
108
::
108
109
109
110
sage: N(pi, digits=100)
110
- 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
111
+ 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998
112
+ 628034825342117068
111
113
112
114
This asks Sage to factor a polynomial in two variables.
113
115
0 commit comments