# Function working in command line session but not in package [duplicate]

I have this pretty straight-forward function

GetMinimum[function_, xmin_] := First[FindMinimum[{function, x>xmin}, x]]


that works perfectly within a Mathematica command line session. However after moving that code into a package and calling it like

GetMinimum[x^2, -20]


I get the following output:

{y=x^2, UniversalPlotPrivatex\$515 > -20}


where UniversalPlot is the name of the package. I cannot figure out how to make the function work when defining it in the package. Any ideas?

## marked as duplicate by Kuba♦May 29 '17 at 14:01

• e.g GetMinimum[function_, {x_, xmin_}] := First[FindMinimum[{function, x>xmin}, x]]? – Kuba May 29 '17 at 15:18