Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168749
Image: ubuntu2004
#f(x)= (x^2)-ln(1+x)# #fp(x)=derivative(f(x))# #phi1(x)=x-(f(x)/fp(x))#
def f(x): return ((x^2)-ln(1+x)) def fp(x): return (2*x-1/(x+1)) def phi1(x): return (x-(f(x)/fp(x))) def newton1(x_start,eps): x=x_start x_old=x+10*eps while(abs(x-x_old)>eps): x_old=x x=phi1(x) return(x)
newton1(0.1,1.e-7)
-0.0203092279291762
fp(1)
3/2
plot(f(x),-0.9,5)