# Maximum and Minimum Values — AM-GM, Quadratics and Squares

Source: https://skills101.in/learn/aptitude/aptitude-maximum-and-minimum-values — Skills101 free tutorial (Quantitative Aptitude). Updated 2026-11-21.

"What is the **largest** area a farmer can fence with 100 m of wire?" "What is the **least** value of x² − 6x + 13?" Questions like these appear in TCS, Infosys and eLitmus-style papers, in CAT-type quant and in engineering maths. Calculus can solve them, but in an aptitude test you need a faster way.

This lesson gives you four tools: **equal parts**, **completing the square**, the **vertex formula**, and a few standard results. Each one comes with the reason it works.

## 1. Fixed sum → biggest product when the parts are equal

If two positive numbers have a **fixed sum**, their **product is largest when they are equal**.

> **If x + y = S, then xy is largest at x = y = S/2, and the largest product is S²/4.**

**Why:** write x = S/2 + d and y = S/2 − d. Then xy = S²/4 − d². The d² can only take something away, so the best is d = 0.

### Example 1
*Two numbers add up to 20. What is the largest possible product?*

10 × 10 = **100**. Compare: 9 × 11 = 99, 8 × 12 = 96, 5 × 15 = 75 — always smaller.

This is a special case of the **AM-GM inequality**: for positive numbers, the arithmetic mean (AM) is at least the geometric mean (GM), with equality only when all numbers are equal. For two numbers: (x + y)/2 ≥ √(xy). The same rule works for three or more parts.

## 2. Fixed product → smallest sum when the parts are equal

Turn the same idea around: if xy = P is fixed, x + y is **smallest** when x = y = √P.

> **x + y ≥ 2√(xy)**

### Example 2
*Two positive numbers multiply to 36. What is the smallest possible sum?*

6 + 6 = **12**. (4 + 9 = 13, 3 + 12 = 15, 2 + 18 = 20.)

**A favourite:** for any positive x, **x + 1/x ≥ 2**, with equality at x = 1. Here the product x × (1/x) = 1 is fixed, so the smallest sum is 2√1 = 2.

## 3. Rectangles and fencing

For a rectangle of fixed perimeter, length + width is fixed, so by section 1 the **area is largest for a square**.

![Bar chart of areas for rectangles with perimeter 40: 2×18 gives 36, 6×14 gives 84, and the 10×10 square gives the largest area, 100](https://skills101.in/learn-img/aptitude/rect-area-max.svg)

### Example 3 (fence with a wall)
*A farmer has 100 m of fencing to enclose a rectangular field. One side is a long wall and needs no fence. Find the largest area.*

Let the two sides touching the wall be w each. The side opposite the wall is 100 − 2w. Area = w(100 − 2w).

Careful: the "parts" w and 100 − 2w do not have a fixed sum, but **2w and 100 − 2w** do (their sum is 100). Their product is largest when 2w = 100 − 2w → w = 25. Area = 25 × 50 = **1,250 m²**.

So with a wall, the best field is **twice as long as it is wide**, not a square.

## 4. Completing the square

A perfect square is never negative: (anything)² ≥ 0. So if you can write an expression as **(x − h)² + k**, its smallest value is **k**, reached at x = h.

### Example 4
*Find the least value of x² − 6x + 13.*

x² − 6x + 13 = (x² − 6x + 9) + 4 = (x − 3)² + 4. The square is at least 0, so the least value is **4**, at x = 3.

![Graph of y = x² − 6x + 13, a U-shaped curve whose lowest point is (3, 4); written as (x − 3)² + 4 it can never go below 4](https://skills101.in/learn-img/aptitude/parabola-min.svg)

## 5. The vertex formula for any quadratic

For **y = ax² + bx + c**, the turning point (vertex) is at:

> **x = −b ÷ 2a**, and the value there is **c − b² ÷ 4a**.

- If a > 0, the curve is a "U" and this is the **minimum**.
- If a < 0, the curve is an upside-down "U" and this is the **maximum**.

### Example 5
*Find the maximum value of −2x² + 8x + 5.*

a = −2 < 0, so there is a maximum. x = −8 ÷ (−4) = 2. Value = −8 + 16 + 5 = **13**.

### Example 6 (pricing)
*A shop sells (100 − 2p) units when the price is ₹p. What price gives the largest revenue?*

Revenue R = p(100 − 2p) = −2p² + 100p. Vertex: p = −100 ÷ (−4) = **₹25**. Revenue = 25 × 50 = **₹1,250**.

Notice it is the same numbers as the fencing problem — the same quadratic in a different story.

## 6. Two standard results worth memorising

**a sin θ + b cos θ** lies between −√(a² + b²) and +√(a² + b²).

*Maximum of 3 sin θ + 4 cos θ* = √(9 + 16) = **5**. (Not 3 + 4 = 7: sin θ and cos θ cannot both be 1 at the same angle.)

**Sum of distances |x − a| + |x − b|** (with a < b) is smallest, and equal to **b − a**, for every x between a and b.

*Least value of |x − 2| + |x − 8|* = 8 − 2 = **6** (for any x from 2 to 8). Think of it as walking: the total distance from a point to two posts is smallest when you stand between them. For three points, stand at the **middle** one.

## Common mistakes

- Using AM-GM with negative numbers. It is true only for positive (non-negative) values.
- Assuming the square is always best in fencing problems. With a wall on one side, it is not.
- Forgetting to check the sign of a: a > 0 gives a minimum, a < 0 a maximum.
- Adding the coefficients for a sin θ + b cos θ. The maximum is √(a² + b²), not a + b.
- Giving the x where the extreme happens when the question asks for the extreme **value** (or the other way round).

## Quick recap

- Fixed sum → product is largest when the parts are equal (S²/4 for two parts).
- Fixed product → sum is smallest when the parts are equal (2√P); x + 1/x ≥ 2.
- Fixed perimeter → the square has the largest area; with one wall, length = 2 × width.
- (x − h)² + k has least value k at x = h.
- ax² + bx + c turns at x = −b/2a; minimum if a > 0, maximum if a < 0.
- Max of a sin θ + b cos θ = √(a² + b²); min of |x − a| + |x − b| = b − a.


Practice quiz and free certificate: https://skills101.in/learn/aptitude/aptitude-maximum-and-minimum-values