Steply

Maximize P = 5x + 4y: x ≥ 0, y ≥ 0, x + 2y ≤ 10, x + y ≤ 6

Step by step, with the reason for every step · Linear programming · Algebra 1

Step by step

The question

Question: maximize P = 5x + 4y, when x ≥ 0, y ≥ 0, x + 2y ≤ 10, x + y ≤ 6.

maximize P = 5x + 4y

Maximize means: make P as big as it can be.

x and y must follow every rule.

= x ≥ 0, y ≥ 0, x + 2y ≤ 10, x + y ≤ 6

1 Draw the lines

A grid for x and y.

The edge of x + 2y ≤ 10 is the line x + 2y = 10.

It crosses the axes at (10, 0) and (0, 5).

Solid: "or equal to".

The edge of x + y ≤ 6 is the line x + y = 6.

It crosses the axes at (6, 0) and (0, 6).

Solid: "or equal to".

2 Shade the region

x ≥ 0 and y ≥ 0: right of the y-axis, above the x-axis.

"Less than or equal": the side of each line with (0, 0).

The shaded part fits every rule.

3 Find the corners

The corners are where two edges of the region meet.

Where x + 2y = 10 meets x + y = 6: we solve the two together, as in the systems lesson.

x = 2, y = 4.

x + 2y = 10 and x + y = 6: x = 2, y = 4

4 Test each corner

At (0, 0): P = 0.

(0, 0): P = 5(0) + 4(0) = 0

At (0, 5): P = 20.

(0, 5): P = 5(0) + 4(5) = 20

At (6, 0): P = 30.

(6, 0): P = 5(6) + 4(0) = 30

At (2, 4): P = 26.

(2, 4): P = 5(2) + 4(4) = 26

Careful!

The biggest value is always at a corner of the shaded region.

So we only test the corners.

Careful: the best point is always a corner of the region

5 Pick the best

The biggest is 30, at x = 6, y = 0.

maximum P = 30 at (6, 0)

6 Check

Let's check with a point inside the region, (2, 2): P is 18.

That is less than 30.

So the corner is the best!

inside: (2, 2): P = 18 < 30

Let's look back.

First: draw the lines.

Then: shade the region.

Then: find the corners.

Then: test each corner.

Then: pick the best.

Last: check.

Answer
maximum P = 30 at (6, 0)

Your turn

Try this one yourself, then check:

maximize P = 4x + 5y
Show the answer
maximum P = 28 at (2, 4)

More from Linear programming

The whole lesson: Linear programming →