Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168703
Image: ubuntu2004
To solve an equation of the form f=0f=0, you first declare what the function ff is. In this example we have chosen a degree four polynomial.
f=-10.2*x^4-8*x^3+2*x^2-3.34*x+8
Then the command find_root will find a root in a given interval [a,b] in the form "find_root(f,a,b)". In the example we choose a=0 and b=2 .
find_root(f,0,2)
0.7505680692581952
The plot command provide us with a graph and is used to verify or make a guess about the answer. In this case we are verifying the numerical result with a graph of the function f in the interval [0,2]:
plot(f,0,2)