Steply

Maximize P = 4x + y: x ≥ 0, y ≥ 0, x + y ≤ 7, x ≤ 5

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

Step by step

The question

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

maximize P = 4x + y

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

x and y must follow every rule.

= x ≥ 0, y ≥ 0, x + y ≤ 7, x ≤ 5

1 Draw the lines

A grid for x and y.

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

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

Solid: "or equal to".

The edge of x ≤ 5: the line x = 5, 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.

4 Test each corner

At (0, 0): P = 0.

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

At (0, 7): P = 7.

(0, 7): P = 4(0) + 1(7) = 7

At (5, 0): P = 20.

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

At (5, 2): P = 22.

(5, 2): P = 4(5) + 1(2) = 22

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 22, at x = 5, y = 2.

maximum P = 22 at (5, 2)

6 Check

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

That is less than 22.

So the corner is the best!

inside: (2, 2): P = 10 < 22

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 = 22 at (5, 2)

Your turn

Try this one yourself, then check:

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

More from Linear programming

The whole lesson: Linear programming →