selects whichever of the sine and the cosine is larger. Two smooth waves are overlaid and only the upper one is followed, so a corner appears wherever they cross. It is a good place to see what taking a maximum does to a graph.
The two agree when , that is , at . Those points are where the roles swap.
| Interval | Function selected |
|---|---|
This repeats every , so the period is .
The maximum value is , attained twice per period: at where , and at where . The minimum is the lower of the two crossings, namely at .
The range is therefore . The value never sinks to , which both original functions do reach, because whenever one of them is the other is .
At a crossing the one-sided slopes disagree.
| At | Slope |
|---|---|
| coming in from the left | |
| continuing to the right |
The result is a downward-pointing corner, and the same happens at . The crests, by contrast, are the genuine maxima of whichever function is selected, so they are smooth. Two corners and two smooth crests appear in each period.
Using the formula the function can be written as follows.
This follows by substituting and . The function is thus a smooth sine wave plus the absolute value of another, and the corners come entirely from the second term, inherited from the corners of .
A function built with generally fails to be differentiable where its ingredients cross, however smooth those ingredients are. The ramp function bends at the origin for the same reason, being the case where one ingredient is the constant .
Taking a minimum instead traces the lower envelope, and the two are linked as follows.
A circuit that selects the stronger of two signals, or a design in which the tightest of several constraints governs, has a response of this shape. In optimization, minimizing the maximum of several linear expressions is a standard problem, and there too the central issue is how to handle a function with corners1.