CoCalc Public Filestmp / 2018-03-01-121432.sagewsOpen in with one click!
Author: William A. Stein
R.<x, y> = ZZ[] show(R)
Z[x,y]\displaystyle \Bold{Z}[x, y]
%md \$ x^2 \$ $30 for this and \$50 for that...

$ x^2 $

$30 for this and $50 for that...

show((x+y)^10)
x10+10x9y+45x8y2+120x7y3+210x6y4+252x5y5+210x4y6+120x3y7+45x2y8+10xy9+y10\displaystyle x^{10} + 10 x^{9} y + 45 x^{8} y^{2} + 120 x^{7} y^{3} + 210 x^{6} y^{4} + 252 x^{5} y^{5} + 210 x^{4} y^{6} + 120 x^{3} y^{7} + 45 x^{2} y^{8} + 10 x y^{9} + y^{10}
b = matrix(GF(5), 3, [2,-1,3, 3,2,1, 1,6,-2, 1,2,3]) b
[2 4 3 3] [2 1 1 1] [3 1 2 3]
b.parent()
Full MatrixSpace of 3 by 4 dense matrices over Finite Field of size 5
b + b
[4 3 1 1] [4 2 2 2] [1 2 4 1]
a = random_matrix(ZZ,3) show(a)
(213321162)\displaystyle \left(\begin{array}{rrr} 2 & -1 & 3 \\ 3 & 2 & 1 \\ 1 & 6 & -2 \end{array}\right)
z = a.smith_form()
a.smith_form
<built-in method smith_form of sage.matrix.matrix_integer_dense.Matrix_integer_dense object at 0x7f07446abeb0>
len(a)
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> TypeError: object of type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense' has no len()
z
([ 1 0 0] [ 0 1 0] [ 0 0 21], [ 0 0 1] [ 0 1 0] [ 1 -10 -14], [ -7 -4 -10] [ 5 3 7] [ 11 7 16])
show(z)
((1000100021)\displaystyle \left(\begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 21 \end{array}\right), (00101011014)\displaystyle \left(\begin{array}{rrr} 0 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & -10 & -14 \end{array}\right), (741053711716)\displaystyle \left(\begin{array}{rrr} -7 & -4 & -10 \\ 5 & 3 & 7 \\ 11 & 7 & 16 \end{array}\right))
integrate(1 + x + x^2, x)
1/3*x^3 + 1/2*x^2 + x
points = [(2,0,0), (0,2,0), (0,0,2), (-1,0,0), (0,-1,0), (0,0,-1)] show(LatticePolytope(points).plot3d())
3D rendering not yet implemented