# Set a minimum threshold value for a function

I have defined the following function in Mathematica

al[z_] := (a/((1 + a*(b/(2 Pi))*Log[z/Mz])))


(a and b are defined constants) Now I want to put in a variable x that I will integrate over from 0 to 100, but for low values of x (up to 3) I want the function al to be fixed, i.e., z should be 3 for x < 3 and x for x > 3.

However, I only want this constraint on al when I fill in x. Any ideas on how to do this?

• Why not use Piecewise[], then? – J. M.'s ennui Jul 1 '16 at 12:11
• Well, I use the function multiple times and if I wanted to fill in a value, say $y$, I did not want that constraint, and trying to be as compact as possible I was wondering whether there was another option. Anyway, thanks. In the end for my specific case the option Min[al[x],al] worked fine as well. – user40834 Jul 1 '16 at 16:46

You could use Clip:
al[ Clip[x, {3, Infinity}] ]

• Note that this is equivalent to suggestion by @J.M. to use Piecewise. Evaluate Clip[x, {xmin, xmax}] // PiecewiseExpand and Clip[x, {3, Infinity}] // PiecewiseExpand – Bob Hanlon Jul 1 '16 at 15:46