Newton | solve an equation numerically with Newton's method |
FindRealRoots | find the real roots of a polynomial |
NumRealRoots | return the number of real roots of a polynomial |
MinimumBound | return lower bounds on the absolute values of real roots of a polynomial |
MaximumBound | return upper bounds on the absolute values of real roots of a polynomial |
Newton(expr, var, initial, accuracy) Newton(expr, var, initial, accuracy,min,max) |
var -- free variable to adjust to find a zero
initial -- initial value for "var" to use in the search
accuracy -- minimum required accuracy of the result
min -- minimum value for "var" to use in the search
max -- maximum value for "var" to use in the search
The function will iterate using Newton's method until it estimates that it has come within a distance accuracy of the correct solution, and then it will return its best guess. In particular, it may loop forever if the algorithm does not converge.
When min and max are supplied, the Newton iteration takes them into account by returning Fail if it failed to find a root in the given range. Note this doesn't mean there isn't a root, just that this algorithm failed to find it due to the trial values going outside of the bounds.
In> Newton(Sin(x),x,3,0.0001) Out> 3.1415926535; In> Newton(x^2-1,x,2,0.0001,-5,5) Out> 1; In> Newton(x^2+1,x,2,0.0001,-5,5) Out> Fail; |
FindRealRoots(p) |
In> p:=Expand((x+3.1)^5*(x-6.23)) Out> x^6+9.27*x^5-0.465*x^4-300.793*x^3- 1394.2188*x^2-2590.476405*x-1783.5961073; In> FindRealRoots(p) Out> {-3.1,6.23}; |
NumRealRoots(p) |
In> NumRealRoots(x^2-1) Out> 2; In> NumRealRoots(x^2+1) Out> 0; |
MinimumBound(p) MaximumBound(p) |
In> p:=SquareFree(Rationalize((x-3.1)*(x+6.23))) Out> (-40000*x^2-125200*x+772520)/870489; In> MinimumBound(p) Out> 5000000000/2275491039; In> N(%) Out> 2.1973279236; In> MaximumBound(p) Out> 10986639613/1250000000; In> N(%) Out> 8.7893116904; |