Skip to content
spmaddmath.com.my
Tuition

Study

SyllabusFormulasMethodsExam & PapersTools
LocationsPricingBlogOur TeachersContact
EN

Chapter · Linear Programming

How linear programming solves real business problems

Linear programming turns a real limitation, a budget, a time limit, a stock of ingredients, into a set of linear inequalities. Graphing those inequalities marks out a feasible region, and the optimum value of an objective function such as cost or profit always occurs at one of that region's corner points.

The shape of the problem before the maths starts

Every linear programming question begins the same way in real life, even though the exam version is dressed in numbers: a business (or a person, or a factory) wants to get the most out of a limited set of resources, or spend the least while still meeting a set of requirements. A bakery has a limited number of hours of oven time and a limited amount of flour; a delivery company has a limited number of vans and a limited number of drivers; a student planning revision has a limited number of hours before the exam.

Linear programming is the method Add Math offers for turning that kind of everyday limitation into a problem with a definite, checkable answer.

The two moving parts are always the same. Constraints describe the limits, they turn into inequalities.

The objective function describes what is being maximised or minimised, profit, cost, distance, time, and it turns into an expression to evaluate once the constraints have narrowed down the possibilities.

  • Constraints come from the resources or requirements that limit a decision, and are written as linear inequalities.
  • The objective function is the quantity being optimised, written as a linear expression in the same two variables as the constraints.
  • The optimum value, the maximum or minimum, is found by checking the objective function only at the corners of the feasible region, never by testing every point inside it.

Turning a word problem into inequalities

The hardest step for most students is not the algebra, it is translating a paragraph of business context into a short list of inequalities. It helps to ask the same fixed questions every time: what are the two quantities being decided (these become xx and yy), and what limits are placed on them by the situation described?

A furniture workshop making chairs (xx) and tables (yy) each week might face constraints such as a maximum of 40 working hours available, a minimum production requirement to satisfy a standing order, and the simple fact that neither xx nor yy can be negative.

x0,y0x \geq 0, \quad y \geq 0

Those two conditions are worth writing down as a habit on every linear programming question, they are easy to lose marks on simply by forgetting them, even though they follow from the situation without any extra working.

Read for units before variables

Underline the two quantities being decided first, give each one a letter, and only then read the constraints one sentence at a time. A constraint almost always maps to one sentence of the question.

The feasible region and why the answer sits at a corner

Once every constraint is graphed as a line, with the correct region shaded (or left unshaded, following the exam convention used) to show which side satisfies the inequality, the overlap of all the shaded regions is the feasible region, every point inside it satisfies every constraint at once, and represents a combination of xx and yy that is actually possible given the limits described.

The objective function is a straight line too, and as its value changes, the line slides across the graph while keeping the same gradient. The key fact that makes the whole method work is that the optimum value of a linear objective function over a region bounded by straight lines always occurs at a vertex (a corner) of that region, never somewhere in the middle of an edge, and never inside the region.

That is why the standard approach is to identify the corners of the feasible region and evaluate the objective function at each one, rather than searching the whole shaded area.

This is a fact worth trusting rather than re-deriving each time: for a linear objective function over a polygon-shaped feasible region, checking the corners will always find the optimum. Testing points inside the region is unnecessary and, more importantly, does not reliably find the true maximum or minimum.

A worked example, start to finish

A small catering business makes packed lunches (xx) and snack boxes (yy) each day. Preparation time limits production to x+y50x+y\leq 50, ingredient stock limits it to 2x+y802x+y\leq80, and at least 10 packed lunches must be made to fill a standing order, so x10x\geq10, with y0y\geq0.

The profit on each packed lunch is RM4 and on each snack box is RM3, so the objective function to maximise is:

P=4x+3yP = 4x + 3y
  1. Plot the boundary lines x+y=50x+y=50, 2x+y=802x+y=80, x=10x=10, and y=0y=0, shading the region that satisfies all four inequalities.
  2. Identify the corners of the resulting feasible region, the points where boundary lines intersect, checked against every constraint.
  3. Substitute each corner's coordinates into P=4x+3yP=4x+3y and compare the results.

Working through the intersections gives corners at, among others, (10,40)(10,40) and (30,20)(30,20). At (10,40)(10,40), P=4(10)+3(40)=160P=4(10)+3(40)=160; at (30,20)(30,20), P=4(30)+3(20)=180P=4(30)+3(20)=180.

Checking every corner this way, not guessing from the shape of the region, is what the method requires.

Q1[5 marks]

A tailor makes shirts (xx) and trousers (yy) each week, subject to x+2y40x+2y\leq 40, 3x+y603x+y\leq60, x0x\geq0, y0y\geq0. Profit is RM15 per shirt and RM20 per pair of trousers.

Write the objective function and state, without solving fully, which two lines' intersection is most likely to give the maximum profit.

Show worked solution

Objective function: P=15x+20yP=15x+20y. Since trousers earn more profit per unit, the maximum is likely to occur near the corner where the trouser-related constraint is tightest, the intersection of 3x+y=603x+y=60 and x+2y=40x+2y=40, though every corner of the feasible region should still be checked to confirm which gives the true maximum.

Where marks usually slip

The method has several steps, and Add Math linear programming questions tend to lose marks at predictable points rather than through a single hard idea.

  • Shading the wrong side of a boundary line, which produces the wrong feasible region entirely.
  • Forgetting the non-negativity constraints x0x\geq0 and y0y\geq0, which are implied by context even when not stated outright.
  • Testing only one or two corners instead of every vertex of the feasible region.
  • Mixing up whether the objective function is being maximised or minimised, and picking the wrong extreme value as a result.

Read the objective carefully

A cost function is minimised; a profit function is maximised. The two require checking the same corners but picking the opposite extreme value, misreading this loses the whole question even when every other step is correct.

Linear programming questions can appear in either paper, Paper 1 (2 hours, 80 marks) or Paper 2 (2 hours 30 minutes, 100 marks), and marking across both is analytic. Labelling the feasible region and marking each corner clearly on the graph itself protects marks even if the final comparison of objective values has an arithmetic slip.

How one-to-one teaching can help

Linear programming rewards a particular kind of practice, translating word problems into inequalities cleanly, drawing an accurate graph, and checking every corner without skipping one out of habit. A teacher working with you one-to-one can watch exactly where a word problem gets misread into the wrong inequality, or where a corner gets missed on the graph, and correct it in the moment rather than after a mark has already been lost.

Our teachers are experienced; lessons run online and are taught in English, while SPM papers themselves are set bilingually in Bahasa Melayu and English.

If linear programming, or the graph-reading skills it depends on, is a sticking point, a one-hour paid trial class at the teacher's own rate (from RM50 per hour, depending on experience) is a reasonable place to start.

Get 1-to-1 help.

Book a Trial Class

Frequently asked questions

Why does the optimum value in linear programming always occur at a corner?

Because the objective function is linear, its value changes at a constant rate across the feasible region. Moving along any straight edge, the value only increases or only decreases, so the extreme values are found where edges meet, at the corners, never in the middle of an edge or inside the region.

Do I need to shade every constraint separately?

It is usually clearer to shade the region that satisfies all the constraints at once, the overlap, rather than shading each inequality on a separate diagram, so the feasible region is visible as a single connected area.

How do I know whether to maximise or minimise the objective function?

The context decides it. A profit or output quantity is maximised; a cost, time, or distance quantity is minimised.

Read the question's final instruction carefully, since the method for finding corners is identical either way, only the choice of extreme value differs.

What if two corners give the same objective value?

Then every point on the line segment joining those two corners also gives that same optimum value, the optimum is not unique to a single point, but the value itself is still correctly identified by comparing the corners.

Source:SRC-FORMAT

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