is this what you want?
there no need for calculus if when calculating the work done and force since the only force i see in your simulation is gravity force.

workdone by gravity force= m*g*(yi-y);
force = m*g;

/htdocs/ntnujava/ejsuser/14019/users/sgeducation/lookang/simulador_pkg/simulador.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(1476.9kB):double click downloaded file to run it. (7 times by 6 users) , Download EJS source (1 times by 1 users) View EJS source