To try to clarify things, I generated 10 values [x(i) = i / 10] and the corresponding values y[i] are [0.58, 0.65, 0.72, 0.78, 0.83, 0.87, 0.90, 0.92, 0.94, 0.96].
Based on these, I wrote function f(w) as given in your post (sum of 10 terms). When plotted as a function of w, f(w) exhibits (as totally normal) a paraboloid shape with a marked minimum around 3.15 (to give you an idea, for f(2.0)=0.0337713, f(2.5)=0.00852217, f(3.0)=0.000357495, f(3.5)=0.00181296, f(4.0)=0.00843496. The absolute minimum corresponds to w=3.13938 for which f(w)=0.000031942 and this is the solution.
Using the second approach, I wrote function f'(w). Ploted against w, this function has a very nice shape and becomes exactly zero at w=3.13938 and this is the solution.
You must remember than solving an equation is much simpler than minimizing a function (almost if not constrained). For illustration purposes, to solve f'(w)=0, I used Newton method starting at w=2.0 (value which is far away from the one I suggested you to generate using some changes). The successive iterates for w are 2.45293, 2.75188, 2.93280, 3.03609, 3.09582, 3.13997.