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 function $\frac{\ln x}{\ln x}$ is the identity on $(0,\infty)$ and the function $\frac{1+\sqrt x}{1+\sqrt x}$ is the identity on $[0,\infty)$. These can be used to "retain" intervals with one endpoint at infinity. For example to restrict to $[a,b)$ we multiply by $\frac{1+\sqrt{x-a}}{1+\sqrt{x-a}} \cdot \frac{\ln b-x}{\ln b-x}$.
For more complicated unions of intervals, you can use polynomial equations with $p(x) \ge 0 \Rightarrow x\in \bar \Omega$ where $\Omega$ is your desired domain and then multiply by $\frac{\ln p(x)}{\ln p(x)}$ or $\frac{1+\sqrt{p(x)}}{1+\sqrt {p(x)}}$ depending on whether you want to include the endpoints or not. If these are also mixed, you can exclude a single point by using $\frac{\ln |x-a|}{\ln |x-a|}$ as a factor.
Restriction to $(1,4)$ as you ask, can be done with the $\ln$-template:
$$f|_{(1,4)}(x) = f(x) \cdot \frac{\ln(x-1)}{\ln(x-1)} \cdot \frac{\ln(4-x)}{\ln(4-x)}$$
Or, more elegantly, $f(x) \cdot \frac{\ln(\frac32 - |\frac52-x|)}{\ln(\frac32-|\frac52 - x|)}$ where $\frac52 = \frac12(1+4)$ and $\frac32 = \frac12(4-1)$ are the midpoint and radius of the interval.
