solving equations

-x^2, if x=-1, etc