Piecewise Functions, GIF, FPF, Modulus, and Max/Min Regions
In all our earlier problems, each boundary curve had a single formula all the way across the region. But very often, a curve changes its formula depending on where \(x\) lies—either because it is defined piecewise by cases (as we saw in Chapter 11, Piecewise Defined Functions), or because it contains special functions like:
- the Greatest Integer Function (GIF), \([x]\) (also written \(\lfloor x \rfloor\)),
- the Fractional Part Function (FPF), \(\{x\} = x - [x]\),
- Modulus expressions, \(|f(x)|\), or
- Maximum and Minimum functions, \(\max(f(x), g(x))\) and \(\min(f(x), g(x))\).
Once you learn how to split the \(x\)-axis cleanly at every point where a formula switches, these intimidating curves break down into ordinary polynomials, lines, and simple rectangles and triangles!
1. General Piecewise Functions
A piecewise function uses different algebraic formulas on different intervals of \(x\). For example:
Notice that at the switching point \(x = 1\), \(f(x)\) does not even have to be continuous—here the graph jumps from height \(1\) up to height \(2.5\)!
The Rule for Any Piecewise Region
To find the area bounded by a piecewise curve over \([a, b]\):
- Mark every breakpoint \(c_1, c_2, \dots, c_k\) inside \((a, b)\) where the formula changes (either top curve, bottom curve, or both).
- Split the integral at every breakpoint—even if there is a jump discontinuity! (Remember from Chapter 24 that a single vertical jump line has zero width and contributes zero area.)
- Integrate each sub-interval separately using the formula valid on that sub-interval, and add the positive areas:
2. Greatest Integer Function (GIF), [x]
Recall that \([x]\) (the Greatest Integer Function) denotes the largest integer less than or equal to \(x\).
- For \(0 \le x < 1\), \([x] = 0\).
- For \(1 \le x < 2\), \([x] = 1\).
- Watch out for negative numbers! For \(-1 \le x < 0\), \([x] = -1\) (NOT \(0\)!), and for \(-2 \le x < -1\), \([x] = -2\).
Geometrically, on every interval \([n, n + 1)\) between consecutive integers, \([x]\) is a flat horizontal step of constant height \(n\). That means finding area under \([x]\) requires zero integration—you are just adding areas of rectangles!
How to Handle [g(x)] (GIF Inside Another Function)
What if \([x]\) is replaced by \([x^2]\), \([\sqrt{x}]\), \([2x]\), or \([2\sin x]\)?
- If \(g(x)\) is strictly increasing or strictly decreasing on \([a, b]\), finding its range \([g(a), g(b)]\) immediately tells you every integer \(k\) that \(g(x)\) crosses, and each equation \(g(x) = k\) has at most one root.
-
Whenever \(g(x)\) has turns (local maxima or minima), finding just the endpoint values can miss intermediate peaks or valleys and hit the same integer level multiple times. Always use the graphical horizontal-line method instead:
-
Draw the graph of \(y = g(x)\) carefully over the interval \([a, b]\).
- Draw horizontal lines at every integer value on the \(y\)-axis (\(y = \dots, -1, 0, 1, 2, 3, \dots\)) spanning the height of the curve. Think of each pair of consecutive lines \(y = k\) and \(y = k + 1\) as the floor (\(y = k\)) and ceiling (\(y = k + 1\)) of one storey of a building.
- Drop vertical lines down to the \(x\)-axis from every point where \(y = g(x)\) intersects a floor or ceiling line. These \(x\)-values (\(x_1, x_2, \dots\)) split \([a, b]\) into sub-intervals.
- Drop every portion of the curve onto its floor: any piece of \(y = g(x)\) lying inside the band between floor \(k\) and ceiling \(k + 1\) (meaning \(k \le g(x) < k + 1\)) loses its extra fractional height above \(k\) and falls straight down onto floor \(k\), turning into a flat horizontal step at \(y = k\)! Notice that floor always means the lower integer line—so for negative values too, a portion lying between floor \(-2\) and ceiling \(-1\) (\(-2 \le g(x) < -1\)) drops down onto floor \(-2\), never up to \(-1\).
Look closely at how this floor-and-ceiling idea reads directly off the figure above:
- On \([x_1, x_2]\), the upper arch of \(y = g(x)\) lies between floor \(2\) and ceiling \(3\) (\(2 \le g(x) < 3\)), so that entire curved bump falls onto floor \(2\) (\([g(x)] = 2\)), forming the green rectangle of height \(2\).
- On \([a, x_1)\), \((x_2, x_3]\), and \([x_4, b]\), the curve lies between floor \(1\) and ceiling \(2\) (\(1 \le g(x) < 2\)), so every one of those pieces falls onto floor \(1\) (\([g(x)] = 1\)).
- On \((x_3, x_4)\), the valley dips between floor \(0\) and ceiling \(1\) (\(0 \le g(x) < 1\)), so it drops all the way onto floor \(0\) (\([g(x)] = 0\)), contributing zero height.
For a strictly increasing curve like \(y = [x^2]\) on \([0, 2]\) below, \(x^2\) rises monotonically from \(0\) to \(4\), crossing the horizontal lines \(y = 1, 2, 3, 4\) once each at \(x = 1, \, \sqrt{2}, \, \sqrt{3}, \, 2\). So the area under \(y = [x^2]\) on \([0, 2]\) is immediately the sum of four rectangles:
3. Fractional Part Function (FPF),
By definition, the Fractional Part Function is the leftover decimal part after removing the integer part:
Look carefully at what \(\{x\}\) looks like on each unit interval \([n, n + 1)\) (where \(n \in \mathbb{Z}\)):
- Since \([x] = n\) on \([n, n + 1)\), we have \(\{x\} = x - n\)—a straight line segment of slope \(1\), starting at \((n, 0)\) and climbing to an open circle at \((n + 1, 1)\)!
- On negative intervals too, it keeps the exact same pattern: for \(x \in [-1, 0)\), \([x] = -1\), so \(\{x\} = x - (-1) = x + 1\), which climbs from \((-1, 0)\) up to \((0, 1)\)!
- Because \(\{x + 1\} = \{x\}\), the fractional part function is periodic with period \(1\), and satisfies \(0 \le \{x\} < 1\) everywhere.
Notice the huge geometric shortcut: over any single unit interval \([n, n + 1]\), the area under \(y = \{x\}\) is just a right triangle of base \(1\) and height \(1\), with area \(\frac{1}{2}\)!
How to Handle {f(x)}: Convert It to GIF
What if a function like \(x^2\), \(2x\), or \(2\sin x\) sits inside the fractional part braces—for example, \(y = \{x^2\}\) or \(y = \{2\sin x\}\)?
Instead of trying to guess the shape of \(\{f(x)\}\) directly, just convert it to GIF! Since \(0 \le \{f(x)\} < 1\) everywhere, \(\{f(x)\}\) never goes below the \(x\)-axis, so writing \(\{f(x)\} = f(x) - [f(x)]\) immediately gives the area on \([a, b]\) as:
Notice why this solves almost every FPF area problem cleanly:
- No sign-flipping is needed for \(\{f(x)\}\) itself, because \(0 \le \{f(x)\} < 1\) stays non-negative everywhere.
- One smooth integral plus one floor problem: \(\int_a^b f(x)\,dx\) is an ordinary integral over \([a, b]\) with no breakpoints at all, while \(\int_a^b [f(x)]\,dx\) is handled by the horizontal floor-and-ceiling method from Section 2.
- (Geometric picture) Subtracting \([f(x)]\) simply lowers every piece of \(y = f(x)\) sitting between floor \(k\) and ceiling \(k + 1\) down by \(k\) units, stacking all the leftover pieces neatly inside the horizontal strip \(0 \le y < 1\).
For example, we already found in Section 2 that \(\int_0^2 [x^2]\,dx = 5 - \sqrt{2} - \sqrt{3}\). So the area under \(y = \{x^2\}\) on \([0, 2]\) takes one line—without ever sketching \(\{x^2\}\):
4. Modulus Expressions
By definition, for any function \(f(x)\):
Rather than solving messy inequalities by hand, draw \(y = f(x)\) first and label the two kinds of branches right on the picture:
- Mark the \(x\)-intercepts where \(f(x) = 0\).
- Keep every portion on or above the \(x\)-axis (\(f(x) \ge 0\)) untouched—that branch has equation \(y = f(x)\).
- Reflect every portion below the \(x\)-axis (\(f(x) < 0\)) straight upward across the \(x\)-axis—that flipped branch has equation \(y = -f(x)\).
Quick Example: Find the area bounded by \(y = |x^2 - 1|\), the \(x\)-axis, and the lines \(x = -2\) and \(x = 2\).
Look at \(y = f(x) = x^2 - 1\) plotted above: it crosses the \(x\)-axis at \(x = -1\) and \(x = 1\), dipping below the axis between \(-1\) and \(1\). Reading the labeled branches directly from the graph (and using \(y\)-axis symmetry on \([0, 2]\)):
- On \([0, 1]\), the arch is the reflected portion: \(y = -f(x) = 1 - x^2\).
- On \([1, 2]\), the outer arm lies above the axis: \(y = f(x) = x^2 - 1\).
So the total area is immediately:
5. Maximum and Minimum Functions: max(f, g) and min(f, g)
Given two continuous functions \(f(x)\) and \(g(x)\):
- \(\max\big(f(x), g(x)\big)\) picks whichever curve is higher at each \(x\) (the upper envelope).
- \(\min\big(f(x), g(x)\big)\) picks whichever curve is lower at each \(x\) (the lower envelope).
How to Sketch and Integrate max and min
Trying to figure out \(\max(f, g)\) or \(\min(f, g)\) by solving inequalities like \(f(x) \ge g(x)\) algebraically is slow and unnecessary—especially with trig or multiple intersecting curves. By sketching the graphs first, you can read the exact answer with your eyes:
- Draw both graphs \(y = f(x)\) and \(y = g(x)\) on the same axes.
- Solve \(f(x) = g(x)\) to find and mark every intersection point where the curves switch places.
-
Read the top and bottom curves straight off the picture: between any two consecutive intersections, simply look at the sketch to see which curve sits higher and which sits lower—no inequality solving needed:
- Trace the upper curve everywhere for \(\max(f, g)\).
- Trace the lower curve everywhere for \(\min(f, g)\).
(Handy identity: Notice that \(\max(f, g) - \min(f, g) = |f(x) - g(x)|\), while \(\max(f, g) + \min(f, g) = f(x) + g(x)\)! So if you need the area between \(\max(f, g)\) and \(\min(f, g)\) on \([a, b]\), it is simply \(\int_a^b |f(x) - g(x)|\,dx\)!)
Worked Examples
Example 1: General Piecewise Function With Both Axes and Corners
Find the area bounded by the curve \(y = f(x)\), the \(x\)-axis, and the lines \(x = -1\) and \(x = 2\), where:
Solution: Check the sign of \(f(x)\) on both pieces:
- On \([-1, 0]\), \(1 - x \ge 1 > 0\).
- On \((0, 2]\), \(x^2 + 1 \ge 1 > 0\).
Since \(f(x) > 0\) everywhere on \([-1, 2]\), we simply split the integral at the formula-switching point \(x = 0\) as shown below:
Example 2: Piecewise Curve Using GIF — Area Under y = [sqrt(x)]
Find the area bounded by \(y = [\sqrt{x}]\), the \(x\)-axis, and the lines \(x = 0\) and \(x = 9\).
Solution: As \(x\) goes from \(0\) to \(9\), \(\sqrt{x}\) climbs from \(0\) to \(3\). It hits integers at:
- \(\sqrt{x} = 0 \implies x = 0\)
- \(\sqrt{x} = 1 \implies x = 1\)
- \(\sqrt{x} = 2 \implies x = 4\)
- \(\sqrt{x} = 3 \implies x = 9\)
On each interval between these breakpoints, \([\sqrt{x}]\) is constant:
- \(x \in [0, 1) \implies [\sqrt{x}] = 0\) (width \(1\), height \(0\)).
- \(x \in [1, 4) \implies [\sqrt{x}] = 1\) (width \(3\), height \(1\)).
- \(x \in [4, 9) \implies [\sqrt{x}] = 2\) (width \(5\), height \(2\)).
Adding the three rectangular step areas gives:
Example 3: Non-Monotonic Curve Inside GIF — Area Under y = [2 sin x]
Find the area bounded by \(y = [2\sin x]\), the \(x\)-axis, and the lines \(x = 0\) and \(x = \pi\).
Solution: Notice what happens if you only look at the endpoints: \(2\sin(0) = 0\) and \(2\sin(\pi) = 0\), even though the curve rises well above \(0\) in between! Because \(g(x) = 2\sin x\) has a turn (a maximum) inside \([0, \pi]\), we sketch \(y = 2\sin x\) first and draw horizontal integer lines at \(y = 0, 1, 2\):
- \(y = 0\) meets the curve at \(x = 0\) and \(x = \pi\).
- \(y = 1\) cuts \(2\sin x = 1 \implies \sin x = \frac{1}{2}\) at two points: \(x = \frac{\pi}{6}\) and \(x = \frac{5\pi}{6}\).
- \(y = 2\) just touches the peak at the single point \(x = \frac{\pi}{2}\).
Dropping vertical lines from these intersections and dropping each piece onto its floor splits \([0, \pi]\) as follows:
- \(x \in \big[0, \frac{\pi}{6}\big)\): lies between floor \(0\) and ceiling \(1\) (\(0 \le 2\sin x < 1\)), so it falls to floor \(0 \implies [2\sin x] = 0\) (height \(0\)).
- \(x \in \big[\frac{\pi}{6}, \frac{5\pi}{6}\big]\) with \(x \neq \frac{\pi}{2}\): lies between floor \(1\) and ceiling \(2\) (\(1 \le 2\sin x < 2\)), so it falls to floor \(1 \implies [2\sin x] = 1\) (height \(1\)).
- \(x = \frac{\pi}{2}\): just touches floor \(2\), so \([2\sin x] = 2\), which is a single point of zero width and contributes \(0\) to the area.
- \(x \in \big(\frac{5\pi}{6}, \pi\big]\): lies between floor \(0\) and ceiling \(1\) (\(0 \le 2\sin x < 1\)), so it falls to floor \(0 \implies [2\sin x] = 0\) (height \(0\)).
So the entire non-zero region is a single rectangle of height \(1\) over \(\big[\frac{\pi}{6}, \frac{5\pi}{6}\big]\):
Example 4: Area Under a Fractional Part Transformation y =
Find the area bounded by \(y = \{2x\}\), the \(x\)-axis, and the lines \(x = 0\) and \(x = 3\).
Solution: First look at the period of \(\{2x\}\). Replacing \(x\) by \(x + \frac{1}{2}\) turns \(\{2(x + \tfrac{1}{2})\} = \{2x + 1\} = \{2x\}\). So \(\{2x\}\) repeats every \(\frac{1}{2}\) unit!
Over each half-unit interval \(\big[0, \frac{1}{2}\big), \big[\frac{1}{2}, 1\big), \dots, \big[\frac{5}{2}, 3\big)\), the graph is a straight triangle starting at height \(0\) and rising up to height \(1\), with base \(\frac{1}{2}\) and height \(1\). Across \([0, 3]\) there are \(3 \div \frac{1}{2} = 6\) identical triangles:
(Or directly by scaling: since \(\{u\}\) has area \(\frac{3}{2}\) on \([0, 3]\)—or \(3\) on \([0, 6]\)—horizontally compressing \(\{x\}\) by \(2\) gives \(\int_0^3 \{2x\}\,dx = \frac{1}{2}\int_0^6 \{u\}\,du = \frac{1}{2}(6 \times \frac{1}{2}) = \frac{3}{2}\)!)
Example 5: Region Bounded by an Inequality With GIF — [x] + [y]
Find the area of the region \(R = \big\{(x, y) : 1 \le [x] + [y] \le 2, \; 0 \le x \le 2, \; 0 \le y \le 2\big\}\).
Solution: Because \(0 \le x \le 2\) and \(0 \le y \le 2\), the integers \([x]\) and \([y]\) divide the \([0, 2] \times [0, 2]\) square into unit \(1 \times 1\) squares: \([x] \in \{0, 1, 2\}\) and \([y] \in \{0, 1, 2\}\) (note \(x = 2\) and \(y = 2\) are just boundary lines of zero area).
Check which interior \(1 \times 1\) squares satisfy \(1 \le [x] + [y] \le 2\):
- \([x] = 0, \, [y] = 0\) (the square \([0, 1) \times [0, 1)\)): \([x] + [y] = 0\) (excluded).
- \([x] = 1, \, [y] = 0\) (the square \([1, 2) \times [0, 1)\)): \([x] + [y] = 1\) (included).
- \([x] = 0, \, [y] = 1\) (the square \([0, 1) \times [1, 2)\)): \([x] + [y] = 1\) (included).
- \([x] = 1, \, [y] = 1\) (the square \([1, 2) \times [1, 2)\)): \([x] + [y] = 2\) (included).
Exactly 3 unit squares satisfy the condition, so:
Example 6: Multi-Modulus Bucket Function
Find the area bounded by the curve \(y = |x - 1| + |x - 2| + |x - 3|\) and the line \(y = 4\).
Solution: The critical points where the modulus terms vanish are \(x = 1, 2, 3\). Write the piecewise formula interval by interval:
- For \(x < 1\): \(-(x - 1) - (x - 2) - (x - 3) = 6 - 3x\).
- For \(1 \le x < 2\): \((x - 1) - (x - 2) - (x - 3) = 4 - x\).
- For \(2 \le x < 3\): \((x - 1) + (x - 2) - (x - 3) = x\).
- For \(x \ge 3\): \((x - 1) + (x - 2) + (x - 3) = 3x - 6\).
Check the corner values: \((1, 3)\), \((2, 2)\), \((3, 3)\), all lying below \(y = 4\). Now find where the outer wings meet \(y = 4\):
- Left wing (\(x < 1\)): \(6 - 3x = 4 \implies x = \frac{2}{3}\).
- Right wing (\(x \ge 3\)): \(3x - 6 = 4 \implies x = \frac{10}{3}\).
Using symmetry about the vertical line \(x = 2\) (integrate from \(x = 2\) to \(\frac{10}{3}\) and double it!):
Notice both pieces are clean right/trapezoid geometry:
Thus:
Example 7: Mixed Modulus, GIF, and FPF — y = |[x]| +
Find the area bounded by the curve \(y = |[x]| + \{x\}\), the horizontal line \(y = 2\), and the vertical lines \(x = -1\) and \(x = 2\).
Solution: Split \([-1, 2)\) at every integer breakpoint (\(-1, 0, 1, 2\)) and evaluate \([x]\), \(|[x]|\), and \(\{x\} = x - [x]\) carefully on each piece—especially on the negative interval \([-1, 0)\)!
- On \([-1, 0)\): \([x] = -1 \implies |[x]| = 1\), and \(\{x\} = x - (-1) = x + 1\). Therefore, \(y = 1 + (x + 1) = x + 2\) (rising from \(1\) at \(x = -1\) up to \(2\) at \(x = 0\)).
- On \([0, 1)\): \([x] = 0 \implies |[x]| = 0\), and \(\{x\} = x\). Therefore, \(y = x\) (rising from \(0\) to \(1\)).
- On \([1, 2)\): \([x] = 1 \implies |[x]| = 1\), and \(\{x\} = x - 1\). Therefore, \(y = 1 + (x - 1) = x\) (continuing smoothly from \(1\) up to \(2\)!).
Look at the figure: the entire curve stays at or below \(y = 2\), forming two simple triangles below \(y = 2\)!
- Left triangle \(A_1\) on \([-1, 0]\): base \(1\), height \(2 - 1 = 1 \implies A_1 = \frac{1}{2}(1)(1) = \frac{1}{2}\).
- Right triangle \(A_2\) on \([0, 2]\): base \(2\), height \(2 - 0 = 2 \implies A_2 = \frac{1}{2}(2)(2) = 2\).
Total area:
Example 8: Mixed GIF and Modulus — y = [x] + |x - 1|
Find the area bounded by \(y = [x] + |x - 1|\), the \(x\)-axis, and the lines \(x = 0\) and \(x = 2\).
Solution: The integer breakpoints are \(0, 1, 2\) (and \(x = 1\) is also where \(|x - 1|\) switches sign!).
- On \([0, 1)\): \([x] = 0\) and \(|x - 1| = 1 - x\), so \(y = 1 - x \ge 0\).
- On \([1, 2)\): \([x] = 1\) and \(|x - 1| = x - 1\), so \(y = 1 + (x - 1) = x \ge 0\).
Splitting at \(x = 1\):
Example 9: Mixed Modulus and GIF in Two Variables — |x| - [x]
Find the area bounded by the curve \(y = |x| - [x]\), the \(x\)-axis, and the lines \(x = -2\) and \(x = 2\).
Solution: Notice how \(|x|\) switches at \(0\) while \([x]\) jumps at \(-2, -1, 0, 1, 2\):
- On \([-2, -1)\): \(|x| = -x\) and \([x] = -2 \implies y = -x - (-2) = 2 - x\) (a trapezoid from height \(4\) down to \(3\), width \(1\), area \(= \frac{4 + 3}{2} = \frac{7}{2}\)).
- On \([-1, 0)\): \(|x| = -x\) and \([x] = -1 \implies y = -x - (-1) = 1 - x\) (a trapezoid from height \(2\) down to \(1\), width \(1\), area \(= \frac{2 + 1}{2} = \frac{3}{2}\)).
- On \([0, 2)\): \(|x| = x\), so \(y = x - [x] = \{x\}\)! Across \([0, 1)\) and \([1, 2)\), this gives two unit triangles of area \(\frac{1}{2}\) each (\(\text{area} = 1\)).
Adding all three parts:
Example 10: Inequality With Both GIF and FPF
Find the area of the region \(R = \big\{(x, y) : \{x\} \le y \le [x] + 1, \; 0 \le x \le 2\big\}\).
Solution: Split \([0, 2]\) at \(x = 1\):
On \([0, 1)\): \(\{x\} = x\) and \([x] + 1 = 1\). Since \(x \le 1\), every strip runs from \(y = x\) to \(y = 1\):
On \([1, 2)\): \(\{x\} = x - 1\) and \([x] + 1 = 2\). Since \(x - 1 < 2\), every strip runs from \(y = x - 1\) to \(y = 2\):
Total area \(= \frac{1}{2} + \frac{3}{2} = 2\text{ sq. units.}\)
Example 11: Minimum of Absolute Value and Downward Parabola
Find the area bounded by the curve \(y = \min\big(|x|, \, 2 - x^2\big)\) and the \(x\)-axis.
Solution: First check symmetry: replacing \(x\) by \(-x\) keeps both \(|x|\) and \(2 - x^2\) unchanged, so the graph is even (\(y\)-axis symmetric). Let us analyze \(x \ge 0\), where \(|x| = x\).
Find where \(y = x\) intersects \(y = 2 - x^2\):
Also \(y = 2 - x^2\) hits the \(x\)-axis at \(x = \sqrt{2}\) (and stays negative for \(x > \sqrt{2}\), so the bounded region above \(y = 0\) stops at \(x = \sqrt{2}\)). Looking directly at the graph on \([0, \sqrt{2}]\):
- From \(x = 0\) to \(1\), the straight line \(y = x\) lies below the parabola \(y = 2 - x^2\), so \(\min(|x|, 2 - x^2) = x\).
- From \(x = 1\) to \(\sqrt{2}\), the parabola plunges below the line down to the \(x\)-axis, so \(\min(|x|, 2 - x^2) = 2 - x^2\).
By symmetry, double the \([0, \sqrt{2}]\) area:
Computing the second bracket:
Therefore:
Example 12: Area Between max(sin x, cos x) and min(sin x, cos x)
Find the area bounded by \(y = \max(\sin x, \cos x)\) and \(y = \min(\sin x, \cos x)\) between \(x = 0\) and \(x = \pi\).
Solution: Instead of trying to compare \(\sin x\) and \(\cos x\) with inequalities, simply draw both \(y = \sin x\) and \(y = \cos x\) on \([0, \pi]\) and find their intersection point:
Now just look at the graph—your eyes instantly tell you which curve is \(\max\) (on top) and which is \(\min\) (on bottom), without solving a single inequality:
- From \(0\) to \(\frac{\pi}{4}\): \(\cos x\) rides on top (\(\max\)) while \(\sin x\) stays on the bottom (\(\min\)), so the vertical height between them is \(\cos x - \sin x\).
- From \(\frac{\pi}{4}\) to \(\pi\): after crossing at \(\big(\frac{\pi}{4}, \frac{1}{\sqrt{2}}\big)\), \(\sin x\) stays on top (\(\max\)) while \(\cos x\) drops to the bottom (\(\min\)), so the vertical height between them is \(\sin x - \cos x\).
Splitting at the intersection \(x = \frac{\pi}{4}\):
Evaluate each integral:
Example 13: Bounded Region Using max(x^2, 1 - x^2) and a Horizontal Line
Find the area bounded by the curve \(y = \max(x^2, 1 - x^2)\) and the line \(y = 2\).
Solution: Sketch both standard parabolas on the same axes—\(y = x^2\) opening upward from \((0, 0)\) and \(y = 1 - x^2\) opening downward from \((0, 1)\)—together with the horizontal line \(y = 2\). Both curves are symmetric about the \(y\)-axis.
Find the intersection points:
- Where the two parabolas cross each other:
- Where the outer rising branches meet \(y = 2\):
Look at how clear the picture makes it—no inequality checking is needed at all! Just trace the higher (upper) curve of the two parabolas on the right half \(x \ge 0\):
- From \(x = 0\) to \(\frac{1}{\sqrt{2}}\), the downward arch \(y = 1 - x^2\) visibly sits above \(y = x^2\), forming the middle hump of \(\max(x^2, 1 - x^2)\).
- From \(x = \frac{1}{\sqrt{2}}\) to \(\sqrt{2}\), the upward parabola \(y = x^2\) rises above \(y = 1 - x^2\), forming the outer wall up to \(y = 2\).
Using \(y\)-axis symmetry, the enclosed area below \(y = 2\) and above \(\max(x^2, 1 - x^2)\) is:
Evaluate each piece cleanly:
Adding the two integrals and multiplying by \(2\):

![Graphical method for [g(x)] using horizontal integer lines on a curve with turns](../pw_gif_horizontal_lines.png)
![Step rectangles of y = [x^2] over [0, 2]](../pw_gif_steps.png)
![Graph of the fractional part function y = {x} on [-1, 3] showing unit right triangles](../pw_fpf_graph.png)

![Comparing y = max(sin x, cos x) and y = min(sin x, cos x) on [0, pi/2]](../pw_max_min_sincos.png)

![Step rectangles for y = [sqrt(x)] over [0, 9]](../pw_ex2_sqrt_gif.png)
![Graphical floor-and-ceiling steps for y = [2 sin x] on [0, pi]](../pw_ex3_2sinx_gif.png)
![Graph of y = {2x} on [0, 3] showing six half-unit triangles](../pw_ex4_fpf_2x.png)
![Unit squares satisfying 1 <= [x] + [y] <= 2 inside [0, 2] x [0, 2]](../pw_ex5_gif_xy.png)

![Area between mixed curve y = |[x]| + {x} and y = 2 on [-1, 2]](../pw_mixed_mod_gif.png)

![Graphs of max(sin x, cos x) and min(sin x, cos x) on [0, pi]](../pw_ex12_maxmin_sincos_pi.png)
