#include /* define your function f and derivative fp below */ double f( double x) { return -1 + x*x*( -1 + x); } double fp( double x) { return x*(-2 + x*3); }