add Karush-Kuhn-Tucker conditions in the 1d case