# Package function not evaluating

I have a short package like this:

BeginPackage["FunctionAnalysis",{"Global"}];
MonoIntervals::usage="returns monotonic intervals of given function";
Begin["Private"];
FunctionAnalysisPrivateMonoIntervals[func_[arg_],var_]:={Reduce[D[func[arg],var]>0,var]}
End[];
EndPackage[];


I include it, and when I call, for example:

MonoIntervals[Sin[x],x]


it executes MonoIntervals. The problems occurs when I try to call MonoIntervals with functions like:

f[x_]:=x^2+2*x-10
MonoIntervals[f[x],x]


this results in

Out[25]=MonoIntervals[-10 + 2 x + x^2, x]


Why doesn't the function execute?

Because MonoIntervals[f[x],x] will evaluate like this:
1. MonoIntervals[f[x], x]
2. MonoIntervals[x^2+2*x-10, x]
And it stops there because x^2+2*x-10 doesn't match the pattern func_[arg_]. What precisely are you trying to achieve by using this pattern?
• I am trying to get intervals where given function is positive. What pattern would suit for my case? I thought I have to use func_[arg_], if I replace it with MonoIntervals[func_,arg_] and use later in Reduce[D[func,arg]>0,arg] it still doesn't evaluate. – Kristians Kuhta Dec 19 '14 at 16:47