Steply

Maximize P = 3x + 5y: x ≥ 0, y ≥ 0, x + y ≤ 8, x + 3y ≤ 12, x ≤ 7

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

Step by step

The question

Question: maximize P = 3x + 5y, when x ≥ 0, y ≥ 0, x + y ≤ 8, x + 3y ≤ 12, x ≤ 7.

maximize P = 3x + 5y

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

x and y must follow every rule.

= x ≥ 0, y ≥ 0, x + y ≤ 8, x + 3y ≤ 12, x ≤ 7

1 Draw the lines

A grid for x and y.

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

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

Solid: "or equal to".

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

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

Solid: "or equal to".

The edge of x ≤ 7: the line x = 7, straight up.

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

x = 6, y = 2.

x + y = 8 and x + 3y = 12: x = 6, y = 2

4 Test each corner

At (0, 0): P = 0.

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

At (0, 4): P = 20.

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

At (7, 0): P = 21.

(7, 0): P = 3(7) + 5(0) = 21

At (6, 2): P = 28.

(6, 2): P = 3(6) + 5(2) = 28

At (7, 1): P = 26.

(7, 1): P = 3(7) + 5(1) = 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 28, at x = 6, y = 2.

maximum P = 28 at (6, 2)

6 Check

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

That is less than 28.

So the corner is the best!

inside: (4, 1): P = 17 < 28

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 = 28 at (6, 2)

Your turn

Try this one yourself, then check:

maximize P = 5x + 4y
Show the answer
maximum P = 39 at (7, 1)

More from Linear programming

The whole lesson: Linear programming →