Pkg.add("ApproxFun")
using ApproxFun # this can take a while!
using Plots
x = Fun(x -> x,[-1,1])
f = 1/(1+x^2)
plot(f)
# f is a polynomial at Chebyshev points.
length(f.coefficients)
g = f+x
plot(g)
plot(g') # this is the derivative!
gppppp = differentiate(g, 5)
plot(gppppp)
maximum(gppppp)
h = sin(g)
plot(h)
z = abs(g)
roots(h + z)
plot(h+z)
roots(h+z-1)
plot(cumsum(h+z-1)) # this is the integral!
sum(h+z-1)
k = h+z-1
length(k.coefficients)
f = min(x,x^3)
plot(f)
plot(sqrt(cumsum(f^2)))
norm(f)
sqrt(sum(f^2)) # this is integration!