Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004
var('x') @interact def taylor(f=sin(x)*e^(-x), order=slider([0..12],default=1), center = (0,4)): p = plot(f,-1,5, thickness=2) dot = point((center,f(center)),pointsize=80,rgbcolor=(1,0,0)) ft = f.taylor(x,center,order) pt = plot(ft,-1, 5, color='green', thickness=2) html('$f(x)\;=\;%s\;\\approx\;%s$'%(latex(f), latex(ft))) show(dot + p + pt, ymin = -0.5, ymax = 1)
order 
center 
[removed]
[removed]
[removed]
[removed]
CPU time: 0.17 s, Wall time: 0.73 s
f=e^(-x)*sin(x)
f.taylor(x,0,4)
x - x^2 + x^3/3
[f.taylor(x,0,n) for n in [0..4]]
[0, x, x - x^2, x - x^2 + x^3/3, x - x^2 + x^3/3]