sd24-demo-stein

678 days ago by wstein

automatic_names 
       
var('x') 
       
x
x
f = 1 / sqrt(x^2 + 2*x - 1); f 
       
1/sqrt(x^2 + 2*x - 1)
1/sqrt(x^2 + 2*x - 1)
show(f) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{\sqrt{x^{2} + 2 \, x - 1}}
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{1}{\sqrt{x^{2} + 2 \, x - 1}}
plot(f, (x,1/2,3), thickness=3, color='red', gridlines=True ) 
       
show(f.integrate(x)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\log\left(2 \, x + 2 \, \sqrt{x^{2} + 2 \, x - 1} + 2\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\log\left(2 \, x + 2 \, \sqrt{x^{2} + 2 \, x - 1} + 2\right)
show(f.diff(x)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{-x + 1}{{\left(x^{2} + 2 \, x - 1\right)}^{\frac{3}{2}}}
\newcommand{\Bold}[1]{\mathbf{#1}}\frac{-x + 1}{{\left(x^{2} + 2 \, x - 1\right)}^{\frac{3}{2}}}
x0 = 2 p = plot(f,1/2,5, thickness=2) dot = point((x0,f(x0)),pointsize=80,rgbcolor=(1,0,0)) @interact def Foo(order=(1..12), clr=Color('red')): ft = f.taylor(x,x0,order) pt = plot(ft, -1, 5, color=clr, thickness=2) html('$f(x)\;=\;%s$'%latex(f)) html('$\hat{f}(x;%s)\;=\;%s+\mathcal{O}(x^{%s})$'%(x0,latex(ft),order+1)) show(dot + p + pt, ymin = -.5, ymax = 1) 
       

Click to the left again to hide and once more to show the dynamic interactive window