This problem regards keeping a signal x between the bounds of the interval $[D, B]$, by specifying the derivative of $x$ with respect to time as a function of some external input, say a real between $-1$ and $1.$ For example, if there were no bounds, this equation could be $dx/dt = \text{input}.$
When bounds $D$ and $B$ are present, the equation is:
$\dfrac{dx}{dt} = (B - x)*\max(0, \text{input}) + (D - x)*\max(0, -\text{input})$
Obviously, what this achieves is that when input is positive, $x$ grows towards $B$ and becomes saturated close to it, and if it was larger than $B,$ it gets lowered back. Vice versa for $D.$
My questions is whether a similar behavior (boundaries, saturation, proportional correction when $x$ is beyond boundaries) can be achieved without splitting the input signal into a positive and negative case using the max function, that is, using only basic algebraic operations?
For example, at first I incorrectly thought that a second-degree polynomial in the form $-(x - B)(x - D)*\text{input}$ may be used, because it has roots $D$ and $B$ between which it is positive, so the signal $x$ would increase for a positive input, and decrease for a negative input, and also if $B>x$ a positive signal would knock it back; but this falls apart once a negative signal is given when $x$ is over $B,$ or a positive signal is given when $x<D.$ I gave this example just to illustrate what could be an acceptable alternative that wouldn't use two cases and max--the appearance of the function could change however as long as those essential properties of controlling $x$ remain.
This may or may not help, as I indicated in chat. You can write $$\max(x,y) = \frac12\big(x+y+|y-x|\big).$$ Perhaps that's no more helpful (as absolute value is, in truth, defined by cases).