In short

f(x) = \max\{g(x),\, h(x)\} takes the larger of the two values at every x — its graph traces the higher of the two curves. f(x) = \min\{g(x),\, h(x)\} takes the smaller value — its graph traces the lower curve. Where g and h cross, the max/min function switches from one curve to the other, often creating a sharp corner.

Two friends run a tea stall together. Ravi earns a flat rate of Rs 200 per day. Priya earns Rs 50 per day plus Rs 30 for every cup she sells. On a slow day (4 cups), Priya earns 50 + 30 \times 4 = 170 — less than Ravi. On a busy day (10 cups), she earns 50 + 30 \times 10 = 350 — more than Ravi.

Suppose each day's earnings go to whoever earned more. The daily payout is:

\text{payout}(x) = \max\{200,\; 50 + 30x\}

where x is the number of cups sold. For small x, the flat rate 200 is larger. For large x, the variable rate 50 + 30x is larger. They are equal when 200 = 50 + 30x, giving x = 5. The payout graph is made of two line segments joined at a corner at x = 5.

That is the core idea of \max and \min functions: at each input, compare the values and pick the higher (or lower) one.

How \max\{g(x), h(x)\} works

Given two functions g and h, both defined at some point x:

\max\{g(x), h(x)\} = \begin{cases} g(x) & \text{if } g(x) \ge h(x) \\ h(x) & \text{if } h(x) > g(x) \end{cases}

Graphically, you draw both curves and at every x, keep the one that is higher. The result is a piecewise function that follows one curve, then switches to the other at the crossing points.

Take two simple functions: g(x) = x and h(x) = 2 - x. These are straight lines that cross at x = 1 (where x = 2 - x, so 2x = 2, so x = 1; both equal 1 there).

For x < 1: g(x) = x < 2 - x = h(x), so \max = h(x) = 2 - x. For x \ge 1: g(x) = x \ge 2 - x = h(x), so \max = g(x) = x.

Graph of max of x and 2 minus xTwo straight lines y equals x and y equals 2 minus x cross at the point (1, 1). The max function follows the higher line at every x, forming a V shape opening upward with vertex at (1, 1). x y 1 2 3 −1 −2 1 2 3 (1, 1) g(x) = x h(x) = 2 − x max{x, 2−x}
The dashed lines are $g(x) = x$ and $h(x) = 2 - x$. The red V-shape is $\max\{x,\, 2-x\}$: it follows whichever line is higher. The crossing point $(1, 1)$ is the vertex of the V — the minimum value of the max function.

The result is a V-shaped graph. The minimum value of \max\{x, 2 - x\} is 1, occurring at x = 1. This is the point where the two functions are equal.

How \min\{g(x), h(x)\} works

The \min function works identically, but picks the lower curve:

\min\{g(x), h(x)\} = \begin{cases} g(x) & \text{if } g(x) \le h(x) \\ h(x) & \text{if } h(x) < g(x) \end{cases}

Using the same two functions g(x) = x and h(x) = 2 - x:

For x < 1: g(x) = x < 2 - x = h(x), so \min = g(x) = x. For x \ge 1: g(x) = x \ge 2 - x = h(x), so \min = h(x) = 2 - x.

Graph of min of x and 2 minus xTwo straight lines y equals x and y equals 2 minus x cross at the point (1, 1). The min function follows the lower line at every x, forming an inverted V shape with peak at (1, 1). x y 1 2 3 −1 −2 1 2 −1 (1, 1) g(x) = x h(x) = 2 − x min{x, 2−x}
The red inverted-V is $\min\{x,\, 2-x\}$: it follows whichever dashed line is lower. The crossing point $(1, 1)$ is now the peak — the maximum value of the min function.

Notice the duality: \max produces a V opening upward (valley at the crossing point), while \min produces a V opening downward (peak at the crossing point). The crossing point is always a corner in both graphs.

A useful identity connecting max, min, and absolute value

There is a beautiful algebraic relationship:

\max\{a, b\} = \frac{a + b + |a - b|}{2}, \qquad \min\{a, b\} = \frac{a + b - |a - b|}{2}

Check it: if a \ge b, then |a - b| = a - b, so \max = \frac{a + b + a - b}{2} = a. Correct. And \min = \frac{a + b - a + b}{2} = b. Correct.

This identity is powerful because it lets you rewrite max/min functions as algebraic expressions involving absolute values, which you already know how to graph.

For example: \max\{x, 2 - x\} = \frac{x + (2-x) + |x - (2-x)|}{2} = \frac{2 + |2x - 2|}{2} = 1 + |x - 1|. That is the V-shape with vertex at (1, 1) — exactly the graph from the figure above.

Graphing technique: the intersection-first method

To sketch \max\{g(x), h(x)\} or \min\{g(x), h(x)\}:

Step 1. Sketch both g(x) and h(x) on the same axes.

Step 2. Find all intersection points — solve g(x) = h(x). These are where the max/min function switches from one curve to the other.

Step 3. Between consecutive intersection points, determine which function is greater (test any convenient point in each interval).

Step 4. For \max: trace the higher curve in each interval. For \min: trace the lower curve. Mark the corners at each intersection point.

The intersection-first methodThree steps shown as boxes. Step 1: draw both curves. Step 2: find crossings. Step 3: trace the higher or lower curve. Step 1 Sketch both curves g and h Step 2 Solve g(x) = h(x) to find crossings Step 3 Trace the higher (max) or lower (min) curve
The three-step method for graphing max/min functions. The crossing points are the key — they divide the $x$-axis into intervals where one function dominates.

Domain and range of max/min functions

The domain of \max\{g(x), h(x)\} is the intersection of the domains of g and h — you need both functions to be defined at x to compare them.

The range requires more care. The range of \max\{g, h\} is not simply the union of the ranges. You need to consider which function is active in which interval.

For \max\{g, h\}: the minimum value is the value at the crossing point (if the curves cross), or the minimum of the larger function (if they don't cross). The maximum value is the larger of the two individual maxima.

For \min\{g, h\}: the maximum value is the value at the crossing point, and the minimum value is the smaller of the two individual minima.

Two worked examples

Example 1: Max of a line and a parabola

Sketch the graph of f(x) = \max\{x + 1,\; x^2 - 1\} and find its range.

Step 1. Find the intersections. Set x + 1 = x^2 - 1:

x^2 - x - 2 = 0 \implies (x-2)(x+1) = 0 \implies x = 2 \text{ or } x = -1

At x = -1: both equal 0. At x = 2: both equal 3. The crossing points are (-1, 0) and (2, 3).

Why: these intersection points divide the x-axis into three intervals: (-\infty, -1), (-1, 2), and (2, \infty).

Step 2. Determine which function is larger in each interval. Test x = 0 (middle interval): g(0) = 1, h(0) = -1. So g(x) = x + 1 is larger on (-1, 2). Test x = 3: g(3) = 4, h(3) = 8. So h(x) = x^2 - 1 is larger on (2, \infty). Test x = -2: g(-2) = -1, h(-2) = 3. So h(x) = x^2 - 1 is larger on (-\infty, -1).

Why: testing one point in each interval is enough, since the functions are continuous and only switch dominance at intersection points.

Step 3. Assemble the max function:

f(x) = \begin{cases} x^2 - 1 & \text{if } x \le -1 \\ x + 1 & \text{if } -1 \le x \le 2 \\ x^2 - 1 & \text{if } x \ge 2 \end{cases}

Why: the max follows the parabola on the outer intervals and the line in the middle.

Step 4. Find the range. The minimum value of f is 0, at x = -1 (where both functions equal 0). As x \to \pm\infty, f(x) \to \infty (the parabola dominates). The range is [0, \infty).

Result: f(x) = \max\{x+1, x^2-1\} follows the parabola outside [-1, 2] and the line between -1 and 2. Range: [0, \infty).

Graph of max of x plus 1 and x squared minus 1A parabola y equals x squared minus 1 and a line y equals x plus 1 are drawn as dashed curves. They intersect at (negative 1, 0) and (2, 3). The max function, shown in red, follows the parabola on the outer intervals and the line between the intersection points. x y 1 2 3 −1 −2 1 2 3 −1 (−1, 0) (2, 3) x² − 1 x + 1
The dashed curves are $y = x + 1$ (line) and $y = x^2 - 1$ (parabola). The red curve $\max\{x+1, x^2-1\}$ traces the higher of the two. It follows the parabola outside $[-1, 2]$ and the line between the crossing points.

The sharp corners at (-1, 0) and (2, 3) are where the max function switches from one curve to the other. At these points, both functions give the same value, so the transition is continuous but not smooth — the slope changes abruptly.

Example 2: Min of two quadratics

Find the graph and range of f(x) = \min\{x^2,\; 4 - (x-2)^2\}.

Step 1. Understand the two functions. The first is g(x) = x^2, a parabola opening upward with vertex at (0, 0). The second is h(x) = 4 - (x-2)^2, a parabola opening downward with vertex at (2, 4).

Why: h(x) is the parabola (x-2)^2 reflected in the x-axis and shifted up by 4. Its vertex is at (2, 4) and it opens downward.

Step 2. Find the intersections. Set x^2 = 4 - (x-2)^2:

x^2 = 4 - x^2 + 4x - 4 \implies 2x^2 - 4x = 0 \implies 2x(x - 2) = 0

So x = 0 or x = 2. At x = 0: both equal 0. At x = 2: g(2) = 4 and h(2) = 4. The crossing points are (0, 0) and (2, 4).

Why: two crossing points divide the real line into three intervals to analyse.

Step 3. Determine which is smaller in each interval. Test x = 1 (middle interval): g(1) = 1, h(1) = 4 - 1 = 3. So g(x) = x^2 is smaller on (0, 2). Test x = -1: g(-1) = 1, h(-1) = 4 - 9 = -5. So h is smaller on (-\infty, 0). Test x = 3: g(3) = 9, h(3) = 4 - 1 = 3. So h is smaller on (2, \infty).

Why: the min follows g (the upward parabola) between the crossings and h (the downward parabola) outside them.

Step 4. Find the range. The downward parabola h decreases without bound as |x| \to \infty, so the min function also decreases without bound: the range extends to -\infty. The maximum value of f occurs at the crossing points: f(0) = 0 and f(2) = 4. Between the crossings, f follows g(x) = x^2, which reaches x^2 = 1 at x = 1. But the crossing-point values 0 and 4 are both achieved, and the curve between them reaches all values from 0 to 4. However, outside the crossings, h drops arbitrarily low. The maximum value of f is 4 (at x = 2). The range is (-\infty, 4].

Result: f(x) = \min\{x^2, 4-(x-2)^2\} follows the upward parabola on [0, 2] and the downward parabola outside. Range: (-\infty, 4].

Graph of min of x squared and 4 minus (x minus 2) squaredTwo parabolas. The upward opening g(x) equals x squared has vertex at the origin. The downward opening h(x) equals 4 minus (x minus 2) squared has vertex at (2, 4). They intersect at (0, 0) and (2, 4). The min function, shown in red, follows x squared between the crossings and the downward parabola outside. x y 1 2 3 4 −1 −2 1 2 3 −1 (0, 0) (2, 4) 4−(x−2)²
The dashed curves are $g(x) = x^2$ (upward) and $h(x) = 4-(x-2)^2$ (downward). The red curve $\min\{g, h\}$ follows the lower of the two. Between the crossings $(0, 0)$ and $(2, 4)$, the upward parabola is lower. Outside, the downward parabola drops below.

The min function creates a smooth arch between the crossings (following x^2) and then plunges downward outside (following the downward parabola). The transition at the crossing points is continuous — both parabolas give the same value there.

Connection to absolute value

The max and min of two functions can always be written using absolute values:

\max\{g, h\} = \frac{g + h + |g - h|}{2}, \qquad \min\{g, h\} = \frac{g + h - |g - h|}{2}

Another useful relationship: \max\{g, h\} + \min\{g, h\} = g + h. This means if you know one, you can find the other by subtraction.

And there is a complementary identity: \max\{g, h\} - \min\{g, h\} = |g - h|. The "gap" between the max and min at any point equals the absolute difference of the two functions.

Common confusions

Going deeper

If you can sketch the graphs of \max\{g, h\} and \min\{g, h\} for any two given functions, identify the crossing points, and find the domain and range, you have the essentials. The material below explores extensions and connections.

Max and min of more than two functions

The same idea extends to three or more functions:

\max\{f_1(x), f_2(x), \ldots, f_n(x)\}

At each x, the value is the largest among all n functions. The graph traces the "upper envelope" of all the curves — the topmost curve at every point. The min traces the "lower envelope."

For three linear functions y = x, y = -x + 4, and y = 1, the max function is a piecewise linear curve that forms the roof of the triangle formed by the three lines. This kind of construction appears in linear programming and optimization.

Connection to |f(x)|

The absolute value of a function can be expressed as a max:

|f(x)| = \max\{f(x), -f(x)\}

This makes graphical sense: |f(x)| keeps the positive parts and flips the negative parts up, which is the same as choosing the higher of f(x) and -f(x) at every point. When f(x) > 0, f(x) > -f(x), so the max is f(x). When f(x) < 0, -f(x) > f(x), so the max is -f(x).

Interactive: max and min builder

Drag the intersection point to see how the max and min graphs change as two lines pivot.

Interactive max and min of two linesTwo intersecting lines with a draggable intersection point. The max function (upper envelope) and min function (lower envelope) are highlighted. x y 1 2 −1 −2 drag the point
The dashed lines cross at a point. The red curve shows $\max$ of the two lines — the upper envelope. Drag the red point to trace along it and read off the value.

Where this leads next

Max and min functions are piecewise-defined by nature, connecting to several topics you will encounter next.