Restrict $x$ in an equation, but keeping only one equation How do you put restrictions on the $x$ in an equation without writing more than one equation? This is a two part question:


*

*How to take out a section of the graph of an equation?

*How to take out everything but a section of the graph of an equation?


For example, to take out $x$ from $-1$ to $1$ in $y=|x|$, you can change the equation to $$y=|x|\times\dfrac{\sqrt{|x|-1}}{\sqrt{|x|-1}}$$
I need to take a function, say $f(x)$, and restrict it to $1 < x < 4$.

The easiest thing to do is to introduce something like the characteristic function,the Kronecker delta function, or an Iverson bracket, or the heaviside step function. You can find information on those on wikipedia or proofwiki.org. They allow you to assign a variable that takes on $1$ under some condition and $0$ otherwise. Then your function won't be undefined otherwise, it will be zero, but in practical applications that's generally just fine, if not better.
Let's say you don't want to do that, for some reason.
For a restriction to an unbounded interval, start with a function that has an easy to manipulate domain. I'll use $\ln$, but $\sqrt{\phantom{x}}$ works just as well.
$$\ln x : x > 0$$
You can easily switch the direction of this by a minus sign:
$$\ln (-x) : -x > 0$$
and we have $-x > 0 \iff x < 0$
Let's say I want to limit my function to $x < -2$. Then I can multiply by:
$$\frac{\ln (-x-2)}{\ln (-x-2)} = 1: -x - 2 > 0$$ 
and we have $-x - 2 > 0 \iff x < -2$
You can do this more than once. Let's say I want to limit the function to $-10 < x < -2$. Then we can combine the restrictions of $x > -10$ and $x < -2$:

$$\frac{\ln (-x-2)}{\ln (-x-2)} \frac{\ln (x+10)}{\ln (x+10)} = 1: -x - 2 > 0,x+10 > 0$$ 

and we have $x < -2 \text{ and } x> -10$. 
Offhand, I can't think of a way to exclude the endpoints in the restriction, but if I think of one I'll update this answer.
Edit: AlexR has an excellent way to exclude the endpoints in the restriction.
