Question: plot a pair of data?

Hi, All, Please look at this example. I am using Newton's method to solve for the equation x^2-a=0. > restart: > Digits := 30: > f :=x-> x^2-a: > df :=x-> 2*x: > for a from 1 to 6 do > x0 := trunc(sqrt(a)): > for j from 1 to 5 do > x1 := x0 - f(x0)/df(x0); > x0 := x1; > rsd := f(x0); > end: > printf(`%3.10f\t %3.10e\n`, x0,rsd): > end: Now, I want to plot the solution x and the residue rsd against a in 2 separate figures, how to write the code? David
Please Wait...