Too lazy to take a derivative; this should work.