Sub topic 14
Modulus equations and regions they enclose
This chapter assumes you can graph a line from its equation, read slope and intercepts, find the area of a triangle, rectangle or rhombus, and solve two linear equations together. It also assumes you know that |t| equals t when t ≥ 0 and −t when t < 0.
Why modulus equations give polygons
The modulus |t| is a piecewise linear function. Inside each region where the sign of t is fixed, |t| is just t or −t. So an equation built from linear expressions inside moduli becomes a set of straight-line pieces. The pieces join at corners, and the corners sit where an expression inside a modulus is zero.
This is why CAT asks "find the area enclosed by..." for these equations. The answer is almost always a polygon: a diamond, a rectangle, a parallelogram or a triangle.
The basic shapes
Start with the simplest equations and learn their shapes.
- |x| = k gives two vertical lines x = k and x = −k, for k > 0.
- |y| = |x| gives the two lines y = x and y = −x.
- y = |x| is a V with its vertex at the origin and arms of slope 1 and −1.
- |x| + |y| = k gives a diamond (a square tilted 45°).
To see the last one, split into the four quadrants:
| Quadrant | Equation becomes | Segment |
|---|---|---|
| x ≥ 0, y ≥ 0 | x + y = k | from (k, 0) to (0, k) |
| x ≤ 0, y ≥ 0 | −x + y = k | from (0, k) to (−k, 0) |
| x ≤ 0, y ≤ 0 | −x − y = k | from (−k, 0) to (0, −k) |
| x ≥ 0, y ≤ 0 | x − y = k | from (0, −k) to (k, 0) |
The vertices are (±k, 0) and (0, ±k). The diagonals have length 2k and are perpendicular, so the area is ½ · 2k · 2k = 2k².
The general form |x/a| + |y/b| = 1 has vertices (±a, 0) and (0, ±b). It is a rhombus with diagonals 2a and 2b, so its area is 2ab. It is a square only when a = b.
Moving the centre gives |x − h| + |y − k₀| = c. This is the same diamond with centre (h, k₀), and the area is still 2c². Shifting does not change area.
Worked example: a shifted diamond
Find the area enclosed by |x − 2| + |y + 1| = 3.
- The centre is (2, −1), because x − 2 = 0 and y + 1 = 0 there.
- Compare with |X| + |Y| = 3 where X = x − 2 and Y = y + 1. The constant is k = 3.
- Area = 2k² = 2 · 9 = 18.
The vertices are (5, −1), (2, 2), (−1, −1) and (2, −4). The horizontal diagonal runs from x = −1 to 5 (length 6) and the vertical one from y = −4 to 2 (length 6), so ½ · 6 · 6 = 18. This agrees.
Inequalities: the region, not the boundary
For |x| + |y| ≤ k, the enclosed region is the filled diamond. Test the origin: 0 ≤ k holds, so the inside is included. The area is the same 2k². For |x| + |y| ≥ k, the region is everything outside, which is unbounded and has no finite area.
Combined conditions are common. For example, |x| + |y| ≤ 4 together with x ≥ 0 gives the right half of the diamond, with area 16. Always test one point to see which side of each boundary the region lies on.
For an area between two nested shapes, subtract. The region 2 ≤ |x| + |y| ≤ 4 has area 2 · 16 − 2 · 4 = 24.
Max-type and difference-type equations
Not every modulus equation gives a diamond.
- max(|x|, |y|) = k gives a square with sides parallel to the axes, vertices (±k, ±k), and area 4k². It is the square circumscribed around the diamond |x| + |y| = k.
- |x + y| + |x − y| = k is a disguised case. Since |x + y| + |x − y| = 2 · max(|x|, |y|), the equation says max(|x|, |y|) = k/2. That is a square with side k and area k².
- |x| − |y| = k is not closed. For k > 0 it consists of open V-shaped rays, so it encloses no region by itself.
Tilted versions: |ax + by| + |cx + dy| = k
Let u = ax + by and v = cx + dy. In the (u, v) plane, |u| + |v| = k is a diamond of area 2k². The map from (x, y) to (u, v) multiplies areas by |ad − bc|. So the enclosed area in the (x, y) plane is
Area = 2k² / |ad − bc|
The shape is a parallelogram, because the map is linear and keeps parallel lines parallel.
Example: |2x + 3y| + |2x − 3y| = 12. Here a = 2, b = 3, c = 2, d = −3, so ad − bc = −6 − 6 = −12. The area is 2 · 144 / 12 = 24. Check with the max form: the left side equals 2 · max(|2x|, |3y|), so max(|2x|, |3y|) = 6. That means |x| ≤ 3 and |y| ≤ 2 with the boundary reached, which is a 6 by 4 rectangle with area 24. ✓
Graphs of y = |expression| and bounded regions
Regions are often bounded by V-shaped graphs and horizontal lines.
Example. Find the area enclosed by y = |x − 1| and y = 3.
- The V has its vertex at (1, 0).
- It meets y = 3 where |x − 1| = 3, so x = −2 or x = 4.
- The region is a triangle with base 6 (from x = −2 to 4) and height 3.
- Area = ½ · 6 · 3 = 9.
Example with two V's. Find the area between y = |x| and y = 6 − |x|.
- They meet where |x| = 6 − |x|, so |x| = 3 and x = ±3. The meeting points are (3, 3) and (−3, 3).
- The region has vertices (0, 0), (3, 3), (0, 6) and (−3, 3). The diagonals have lengths 6 (vertical) and 6 (horizontal) and are perpendicular.
- Area = ½ · 6 · 6 = 18.
For irregular corner sets, list the vertices in order and use the shoelace formula from the earlier chapter on polygon area.
Counting lattice points
CAT sometimes asks how many integer points (x, y) satisfy |x| + |y| ≤ n. For each x from −n to n, y can take 2(n − |x|) + 1 values. Summing gives 2n² + 2n + 1. For n = 4 that is 41.
The code below checks the area formula and the lattice-point count.
def shoelace(points):
total = 0
for i in range(len(points)):
x1, y1 = points[i]
x2, y2 = points[(i + 1) % len(points)]
total += x1 * y2 - x2 * y1
return abs(total) / 2
def diamond_vertices(a, b, h=0, k=0):
# vertices of |x-h|/a + |y-k|/b = 1, listed in order
return [(h + a, k), (h, k + b), (h - a, k), (h, k - b)]
def lattice_count(n):
count = 0
for x in range(-n, n + 1):
for y in range(-n, n + 1):
if abs(x) + abs(y) <= n:
count += 1
return count
print(shoelace(diamond_vertices(3, 2)))
print(shoelace(diamond_vertices(3, 3, 2, -1)))
print(lattice_count(4), 2 * 4 ** 2 + 2 * 4 + 1)The first line prints 12.0, which is 2ab for a = 3, b = 2. The second prints 18.0, matching the shifted-diamond example. The third prints 41 twice.
Common errors
- Writing the area of |x| + |y| = k as k² or 4k². The correct value is 2k².
- Reading |x/a| + |y/b| = 1 as having vertices at (±1, 0). Dividing by a and b stretches the diamond so the vertices lie at ±a and ±b.
- Forgetting the shift. The area is unchanged, but the vertices and centre move.
- Taking only one quadrant's equation and reporting that piece. The full shape needs all four cases.
- Using the determinant shortcut when the two moduli have different right-hand constants. The shortcut needs |u| + |v| = k exactly.
Exercises
Exercise
Find the area enclosed by |x + 3| + |y − 2| = 5.
Show answer
The centre is (−3, 2), and the equation has the form |X| + |Y| = 5. The area is 2 · 5² = 50.
Exercise
Find the area enclosed by |x|/4 + |y|/6 = 1, and then the number of integer points (x, y) with |x| + |y| ≤ 3.
Show answer
The first shape is a rhombus with a = 4 and b = 6, so its area is 2ab = 48. For the lattice count, n = 3 gives 2 · 9 + 2 · 3 + 1 = 25.
Exercise
Find the area enclosed by |x + y| + |x − y| = 8.
Show answer
Since |x + y| + |x − y| = 2 · max(|x|, |y|), the equation gives max(|x|, |y|) = 4. This is a square with vertices (±4, ±4), side 8, and area 64. Check with the shortcut: a = 1, b = 1, c = 1, d = −1, so |ad − bc| = 2, and the area is 2 · 64 / 2 = 64.
Exercise
Find the area of the region bounded by y = |x| and y = 5 − |x|... then state the area of the region 2 ≤ |x| + |y| ≤ 5.
Show answer
The two V's meet where |x| = 5 − |x|, so x = ±2.5, at (±2.5, 2.5). The region has vertices (0, 0), (2.5, 2.5), (0, 5) and (−2.5, 2.5), with perpendicular diagonals of length 5 and 5, so the area is ½ · 5 · 5 = 12.5. For the second part, the area is 2 · 25 − 2 · 4 = 42.