Steply

Maximize P = 2x + 3y: x ≥ 0, y ≥ 0, x + y ≤ 6, 2x + y ≤ 8

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

Step by step

The question

Question: maximize P = 2x + 3y, when x ≥ 0, y ≥ 0, x + y ≤ 6, 2x + y ≤ 8.

maximize P = 2x + 3y

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

x and y must follow every rule.

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

1 Draw the lines

A grid for x and y.

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".

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

It crosses the axes at (4, 0) and (0, 8).

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 + y = 6 meets 2x + y = 8: we solve the two together, as in the systems lesson.

x = 2, y = 4.

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

4 Test each corner

At (0, 0): P = 0.

(0, 0): P = 2(0) + 3(0) = 0

At (0, 6): P = 18.

(0, 6): P = 2(0) + 3(6) = 18

At (4, 0): P = 8.

(4, 0): P = 2(4) + 3(0) = 8

At (2, 4): P = 16.

(2, 4): P = 2(2) + 3(4) = 16

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 18, at x = 0, y = 6.

maximum P = 18 at (0, 6)

6 Check

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

That is less than 18.

So the corner is the best!

inside: (1, 2): P = 8 < 18

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 = 18 at (0, 6)

Your turn

Try this one yourself, then check:

maximize P = 3x + 4y
Show the answer
maximum P = 24 at (0, 6)

More from Linear programming

The whole lesson: Linear programming →