## Newton's Method (newtons_method)

version 5.0.2 (345 KB) by
Calculates the root of a differentiable, univariate function using Newton's method.

Updated 29 Aug 2021

From GitHub

# `newtons_method`

Calculates the root of a differentiable, univariate function using Newton's method.

## Syntax

`root = newtons_method(f,df,x0)`
`root = newtons_method(f,df,x0,opts)`

## Description

`root = newtons_method(f,df,x0)` returns the root of a function specified by the function handle `f`, where `df` is the derivative of (i.e. ) and `x0` is an initial guess of the root. The default tolerance and maximum number of iterations are `TOL = 1e-12` and `imax = 1e6`, respectively.

`root = newtons_method(f,df,x0,opts)` does the same as the syntax above, but allows for the specification of optional solver parameters. `opts` is a struct that has the following fields:

• `imax` → maximum number of iterations
• `return_all` → all intermediate root estimates are returned if set to `true`; otherwise, only the converged root is returned
• `TOL` → tolerance
• `warnings``true` if any warnings should be displayed, `false` if not

• See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.

### Cite As

Tamas Kis (2021). Newton's Method (newtons_method) (https://github.com/tamaskis/newtons_method-MATLAB/releases/tag/v5.0.2), GitHub. Retrieved .

##### MATLAB Release Compatibility
Created with R2021a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux