Section2.2How to define functions
xxxxxxxxxx
def f(z): return 2*z^3 - z^2 - 7*z + 2
type(f)
xxxxxxxxxx
f(2)
xxxxxxxxxx
plot(f, -2, 3)
xxxxxxxxxx
f(x) = (cos(x)-1)/x^2
show(f)
xxxxxxxxxx
f(3)
xxxxxxxxxx
show(f(pi))
xxxxxxxxxx
plot(f(x), (-2*pi, 2*pi),ymin = -1, ymax = 1)