At this point you should check the Typeset box at the top of this worksheet.
sage: DIf = If.differentiate(x) sage: f - DIf sage: (f - DIf).simplify_full() sage: f = x*cos(x)^2 sage: f sage: plot(f) sage: p = plot(f, xmin=-1, xmax=3.5, ymin=-0.5, ymax=3.5, aspect_ratio=.5, gridlines=True, color='purple', thickness=10, alpha=0.2, figsize=6) sage: p
sage: p.save('plot.pdf')
sage: plotf = plot(f, (x,-1,3.5), color='purple', thickness=3)
sage: origin = point((0,0), color='orange', alpha=.7, size=150)
sage: label = 'MacLaurin polynomial of $%s$ of degree'%latex(f)
sage: @interact
sage: def foo(j=slider(0, 20, 1, default=3, label=label)):
... Tjf = f.taylor(x, 0, j)
... plotTjf = plot(Tjf, (x,-1,3.5), color='green', thickness=1.5, fill=f)
... html('$%s$'%latex(Tjf))
... show(plotf + plotTjf + origin, ymin=-0.5, ymax=3.5, figsize=[7,3])
|
|||||||||||||||
Unckeck the Typeset box now, please.
sage: S4 = SymmetricGroup(4) sage: S4 Symmetric group of order 4! as a permutation group sage: show(S4) sage: S4.conjugacy_classes_representatives() [(), (1,2), (1,2)(3,4), (1,2,3), (1,2,3,4)] sage: len(S4.conjugacy_classes_representatives()), len(S4.subgroups()), len(S4.conjugacy_classes_subgroups()), len(S4.normal_subgroups()) (5, 30, 11, 4) sage: u = S4( (1,2,3,4) ) sage: v = S4( (2,4) ) sage: w = S4( ((1,2),(3,4)) ) sage: u.order(), u*v, w==u^-1*v (4, (1,4)(2,3), True) sage: G = S4.subgroup([u, v]) sage: G.order(), G.is_abelian(), G.center().order(), G.is_isomorphic(DihedralGroup(4)) (8, False, 2, True) sage: (1,4) in G, (1,3) in G (False, True) sage: G.cayley_graph(generators=[u, v]).show(color_by_label=True)
sage: G.cayley_graph(generators=[v, w]).show(color_by_label=True)
sage: T = G.cayley_table()
sage: T
* a b c d e f g h
+----------------
a| a b c d e f g h
b| b a d c f e h g
c| c g a e d h b f
d| d h b f c g a e
e| e f g h a b c d
f| f e h g b a d c
g| g c e a h d f b
h| h d f b g c e a
sage: T.translation()
{'a': (), 'c': (1,2)(3,4), 'b': (2,4), 'e': (1,3), 'd': (1,2,3,4), 'g': (1,4,3,2), 'f': (1,3)(2,4), 'h': (1,4)(2,3)}
sage: from sage.matrix.operation_table import OperationTable
sage: def commutator(h, g): return h*g*h^-1*g^-1
sage: OperationTable(G, commutator)
. a b c d e f g h
+----------------
a| a a a a a a a a
b| a a f f a a f f
c| a f a f f a f a
d| a f f a f a a f
e| a a f f a a f f
f| a a a a a a a a
g| a f f a f a a f
h| a f a f f a f a