derivative solver expanded