Jupyter Snippet CB2nd 08_sage
Jupyter Snippet CB2nd 08_sage
15.8. Getting started with Sage
3 * 4
12
2 ^ 3
8
f = 1 - sin(x) ^ 2
f.simplify_trig()
cos(x)^2
f(x=pi)
1
f.diff(x)
-2*cos(x)*sin(x)
f.integrate(x)
1/2*x + 1/4*sin(2*x)
find_root(f - x, 0, 2)
0.6417143708729726
f.plot((x, -2 * pi, 2 * pi))
x, y = var('x,y')
plot3d(sin(x ^ 2 + y ^ 2) / (x ^ 2 + y ^ 2),
(x, -5, 5), (y, -5, 5))