Skip to content
spmaddmath.com.my
Tuition

Study

SyllabusFormulasMethodsExam & PapersTools
LocationsPricingBlogOur TeachersContact
EN

Method · Linear Programming

Graphing constraints and optimising in linear programming

Turn the conditions into inequalities, draw each boundary line, shade the region that satisfies them all, then test the corner points in the objective function to find the maximum or minimum.

What this method is for

Linear programming answers a very practical question: given a set of limits, what choice makes some quantity as large or as small as possible? A workshop might ask how many of two products to make to maximise profit, subject to limits on time and materials.

Each limit becomes a linear inequality in two variables xx and yy.

We draw all the inequalities on one set of axes and shade the feasible region, the set of points that satisfy every constraint at once. The thing we want to maximise or minimise (profit, cost, score) is the objective function, a linear expression such as k=3x+2yk=3x+2y.

Because the objective is linear, its greatest and least values over the region always occur at a corner (vertex), so the method finishes by testing those corners.

When to reach for it

Reach for this method when a question gives two unknowns and several conditions expressed as 'at least', 'at most', 'not more than', or 'no fewer than', then asks for the maximum or minimum of some quantity. The words 'greatest profit', 'least cost', 'shade the region RR', or 'find the maximum value of' are strong signals.

You will usually first translate a short story into inequalities, then graph. If a problem has only one variable, or asks simply to solve equations rather than to optimise within a region, it is not a linear programming question.

The presence of a region to shade together with a quantity to make as big or as small as possible is what marks this topic out.

The method, step by step

  1. 1

    Define the variables

    Let xx and yy stand for the two unknown quantities, stating clearly what each represents.

  2. 2

    Form the inequalities

    Translate every condition into an inequality, and include x0x\ge 0 and y0y\ge 0 where the quantities cannot be negative.

  3. 3

    Draw the boundary lines

    Treat each inequality as an equation and draw its line, using two clear points per line.

  4. 4

    Shade the feasible region

    Test a point (often the origin) in each inequality and shade the region RR that satisfies all of them.

  5. 5

    Write the objective function

    State the quantity to optimise, for example k=3x+2yk=3x+2y.

  6. 6

    Test the vertices

    Find the corner points of RR by solving pairs of lines, then substitute each into the objective function.

  7. 7

    State the optimum

    Choose the vertex giving the largest (or smallest) value and quote both the point and that value.

Worked example

Q1[5 marks]

A small workshop makes xx tables and yy chairs, where xx and yy satisfy x+y6x+y\le 6, x4x\le 4, x0x\ge 0 and y0y\ge 0. The profit is k=3x+2yk=3x+2y.

Find the values of xx and yy that maximise the profit, and state the maximum profit.

Show worked solution

The feasible region is bounded by the lines x+y=6x+y=6, x=4x=4, the xx-axis (y=0)(y=0) and the yy-axis (x=0)(x=0). Find the corner points by taking the boundary lines in pairs.

The corners are: (0,0)(0,0); (4,0)(4,0) from x=4x=4 and y=0y=0; (4,2)(4,2) from x=4x=4 and x+y=6x+y=6 (so y=64=2y=6-4=2); and (0,6)(0,6) from x=0x=0 and x+y=6x+y=6.

Substitute each corner into k=3x+2yk=3x+2y:

(0,0):  k=3(0)+2(0)=0(4,0):  k=3(4)+2(0)=12(4,2):  k=3(4)+2(2)=16(0,6):  k=3(0)+2(6)=12\begin{aligned}(0,0):&\;k=3(0)+2(0)=0\\(4,0):&\;k=3(4)+2(0)=12\\(4,2):&\;k=3(4)+2(2)=16\\(0,6):&\;k=3(0)+2(6)=12\end{aligned}

The largest value is 1616, at the point (4,2)(4,2).

So the profit is a maximum when x=4x=4 and y=2y=2, giving a maximum profit of k=16k=16.

Common mistakes to avoid

  • Getting the inequality direction wrong (\le versus \ge) and shading the wrong side of a line.
  • Forgetting the hidden constraints x0x\ge 0 and y0y\ge 0, which changes the shape of the region.
  • Reading vertex coordinates off the graph by eye instead of solving the two lines simultaneously for exact values.
  • Testing only some corners, or testing an interior point, the optimum of a linear objective always sits at a vertex.
  • Mixing up which variable is xx and which is yy when translating the story into inequalities.

How one-to-one teaching helps

The step where marks slip away is forming the inequalities and shading the right side, get one direction wrong and the whole region, and answer, follow it. In a one-to-one lesson our teachers work through the translation with you sentence by sentence, then check each shading by testing a point, so the region is correct before any optimising begins.

We also insist on solving lines simultaneously for exact vertices rather than reading them off the graph. Teachers at spmaddmath.com.my are experienced, and lessons are online and taught in English.

To see how we teach linear programming, message us on WhatsApp to arrange a one-hour paid class from RM50/hr at the teacher's rate.

Get 1-to-1 help.

Book a Trial Class

Frequently asked questions

How do I know which side of a line to shade?

Pick a test point not on the line, the origin (0,0)(0,0) is easiest when the line does not pass through it. Put it into the inequality: if the statement is true, shade the side containing that point; if false, shade the other side.

Why do I only need to test the corner points?

The objective function is linear, so over a polygon-shaped feasible region its maximum and minimum always occur at a vertex. Testing every corner and comparing the values is therefore enough, you never need to check interior points.

What does the feasible region represent?

It is the set of all points (x,y)(x,y) that satisfy every constraint at the same time. Any point inside or on its boundary is an allowed choice; the best allowed choice is the vertex that optimises the objective function.

Do I always include x0x\ge 0 and y0y\ge 0?

Include them whenever the quantities cannot be negative, which is almost always the case for counts of items, amounts of money, or time. These constraints keep the region in the first quadrant and are easy to forget, so add them as you list the inequalities.

Source:SRC-DSKP-EN

Written by the spmaddmath.com.my editorial team.· Last updated 5 September 2026

Ready to get started?

Book a Trial Classfrom RM50/hr · One-hour paid trial · Same-day reply
Book a Trial ClassOne-hour paid trial · Same-day reply