The max function is a function of 2 variables and is defined as follows
max(x,y) = x if x is greater or equal to y or it's = y if x is less than y
How would I go about expressing this piecewise function in one line using an absolute value function?
My apologies, but
when x>y, |x-y|-(x-y) = 0
and when x<y, |x-y|-(x-y) = 2(y-x)
Now the midpoint between them can be expressed as (x+y)/2. And I know that we want to 'go' from the midpoint to the maximum point, so something needs to be added to (x+y)/2 to move from that point. I also know that this expression that we add should be the same regardless of whether x>y or x<y.
This is where I'm stuck. What do I do now?