Function Repository Resource:

NewtonsMethodFindRoot

Source Notebook

Determine the root of an equation using Newton's method

Contributed by: Jason Martinez

ResourceFunction["NewtonsMethodFindRoot"][f,{x,x0},tol]

searches for a numerical root of f starting at x0 with digits equal to tol.

ResourceFunction["NewtonsMethodFindRoot"][lhsrhs,{x,x0},tol]

searches for a numerical solution to the equation lhs==rhs.

ResourceFunction["NewtonsMethodFindRoot"][f,{x,x0},tol,property]

returns a property of the search for the root of f.

Details

ResourceFunction["NewtonsMethodFindRoot"] supports two options for property:
"Solution"return root of f
"Steps"return a table of steps taken to reach the root
"PropertyAssociation" can be used to return an Association of the properties.

Examples

Basic Examples (2) 

Find the root of an expression using Newton’s method:

In[1]:=
ResourceFunction["NewtonsMethodFindRoot"][x - Sqrt[30], {x, 5}, 10]
Out[1]=

Determine the steps to find the root of an equation:

In[2]:=
ResourceFunction["NewtonsMethodFindRoot"][
 Cos[x] == x, {x, 1}, 8, "Steps"]
Out[2]=

Scope (1) 

Get the property Association of Newton's method:

In[3]:=
ResourceFunction["NewtonsMethodFindRoot"][
 x^2 - 2 x, {x, 5}, 5, "PropertyAssociation"]
Out[3]=

Version History

  • 1.0.0 – 15 June 2021

Related Resources

License Information