| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168738Image: ubuntu2004
Sage Demo
Calculus
5
sqrt(pi)*((sqrt(2)*I + sqrt(2))*erf((sqrt(2)*I + sqrt(2))*x/2) + (sqrt(2)*I - sqrt(2))*erf((sqrt(2)*I - sqrt(2))*x/2))/8
\frac{{\sqrt{ \pi } \left( {\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right) \text{erf} \left( \frac{{\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right) x}}{2} \right)} + {\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) \text{erf} \left( \frac{{\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) x}}{2} \right)} \right)}}{8}
\frac{{\sqrt{ \pi } \left( {\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right) \text{erf} \left( \frac{{\left( {\sqrt{ 2 } i} + \sqrt{ 2 } \right) x}}{2} \right)} + {\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) \text{erf} \left( \frac{{\left( {\sqrt{ 2 } i} - \sqrt{ 2 } \right) x}}{2} \right)} \right)}}{8}
X = \frac{-\left( \sqrt{ {b}^{2} - {{4 a} c} } \right) - b}{{2 a}}
Linear Algebra
Time: CPU 0.17 s, Wall: 0.17 s
1625
Factoring
1099511627791 * 2037035976334486086268445688409378161051468393665936250636140449354381299763336706183397533
CPU time: 5.41 s, Wall time: 5.53 s
[1099511627791, 2037035976334486086268445688409378161051468393665936250636140449354381299763336706183397533]
CPU time: 0.25 s, Wall time: 0.82 s
[1237940039285380274899124357, 2475880078570760549798248507] 4.17
Elliptic Curves
y^2 + y = x^3 - x
Graph Theory
True
5
Multivariate Polynomial Rings
Time: CPU 2.46 s, Wall: 2.46 s
Time: CPU 0.29 s, Wall: 0.29 s
Sage/Singular 4.872305
Traceback (most recent call last): print 'MAGMA', magma.cputime(t)
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/magma.py", line 349, in cputime
return float(self.eval('Cputime()'))
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/magma.py", line 278, in eval
ans = Expect.eval(self, x).replace('\\\n','')
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.py", line 917, in eval
return '\n'.join([self._eval_line(L, **kwds) for L in code.split('\n') if L != ''])
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.py", line 613, in _eval_line
self._start()
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/magma.py", line 285, in _start
Expect._start(self)
File "/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.py", line 450, in _start
self.__name, cmd, self._install_hints())
RuntimeError: Unable to start magma because the command 'magma -n' failed.
Combinatorics
Combinations of [0, 1, 2, 3, 4]
[[], [0], [1], [2], [3], [4], [0, 1], [0, 2], [0, 3], [0, 4], [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4], [0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4], [0, 1, 2, 3], [0, 1, 2, 4], [0, 1, 3, 4], [0, 2, 3, 4], [1, 2, 3, 4], [0, 1, 2, 3, 4]]
[1, 2]
Interfaces
1
176
176
176
176
<class 'sage.interfaces.gap.GapElement'>
[2, 4; 11, 1]
Curve Fitting
scipy.linalg.basic.lstsq curve fitting example
fitting data to quadratic equation y = a + bx + cx^2
yields: x data y data calc value error
5.357 0.376 0.355 -0.021
5.457 0.489 0.472 -0.017
5.797 0.874 0.882 0.008
5.936 1.049 1.055 0.006
6.161 1.327 1.341 0.014
6.697 2.054 2.054 0.000
6.731 2.077 2.101 0.024
6.775 2.138 2.162 0.024
8.442 4.744 4.688 -0.056
9.769 7.068 7.010 -0.058
9.861 7.104 7.181 0.077
3D Plotting
Sequences of Integers
Searching Sloane's online database...
40 The prime numbers.
41 a(n) = number of partitions of n (the partition numbers).