# Thread: problem with defining a function

1. ## problem with defining a function

I need to define a function f(x) so that:

f(x) = 0, when x=0
=1, when x >0

while, x >=0 and integer only

2. NWell, you have defined it! You've told us exactly what its domain of definition is, and what its value is for every element of the domain. Do you want a name for it (it's a step function or Heaviside function or sign function or signum) or are you trying to express it as an algebraic formula of some kind?

3. ## defining th fn. as algebraic formula

I am trying to to express it as an algebraic formula . Can u please help me ?

4. Algebraic formulae tend to define continuous functions, and yours has a step discontinuity. I suppose you could say something like $\vert x \vert = \sqrt{x^2}$ and then write $\frac{d}{dx} \vert x \vert$ but that's rather dubious.