Obtaining a function from an equation