On this page
Say the sides of a rectangle are 3x + 2 and x − 1, and you are asked for its perimeter. The method is always two moves: add every side, then simplify. Here are three worked examples, from a rectangle to an L-shape, and a quick check you can use on any answer.
What does perimeter mean when the sides are in x?
The perimeter of a polygon is the sum of the lengths of all its sides, as NCERT's Grade 6 Ganita Prakash chapter on perimeter and area puts it. A side written as 2x + 1 is still a length, just one whose value depends on x.
NCERT's Grade 7 chapter on expressions using letter-numbers builds the rectangle formula this way: p = l + b + l + b, which becomes 2l + 2b because l + l = 2l and b + b = 2b. The same chapter calls terms with the same letter-numbers "like terms" and shows that like terms can be added into a single term, while terms with different letters, such as 18c and 11d, cannot. So the job is two skills you already have: tracing a boundary and combining like terms.
How do you write the perimeter of a rectangle in terms of x?
Say the length is 3x + 2 and the breadth is x − 1.
Write all four sides, with brackets: (3x + 2) + (x − 1) + (3x + 2) + (x − 1).
Group the x terms: 3x + x + 3x + x = 8x.
Group the numbers: 2 − 1 + 2 − 1 = 2.
Answer: perimeter = 8x + 2.
You can also use 2(length + breadth) = 2(4x + 1) = 8x + 2. Both routes must agree.
Brackets matter most when a question asks how much longer one perimeter is than another; see our guide to subtracting algebraic expressions by changing every sign.
How do you find the perimeter of a triangle with sides in x?
Take a triangle with sides 2x + 1, x + 5 and 3x − 2.
x terms: 2x + x + 3x = 6x
numbers: 1 + 5 − 2 = 4
perimeter = 6x + 4
For the triangle above, x = 3 gives sides 7, 8 and 7, which add to 22. The expression 6x + 4 also gives 18 + 4 = 22. NCERT uses the same idea, checking that l + b + l + b and 2l + 2b both give 14 when l = 3 and b = 4.
How do you write the perimeter of an L-shape?
In an L-shape, two sides are usually not labelled. In the diagram at the top of this post, the bottom is 3x, the left side is 2x + 4, the top is x and the short right side is x + 1.
Find the missing horizontal side. The bottom is the top plus the step, so the step is 3x − x = 2x.
Find the missing vertical side. The left side is the short right side plus the step, so the step is (2x + 4) − (x + 1) = x + 3.
Go round the boundary once and list all six sides: 3x, x + 1, 2x, x + 3, x, 2x + 4.
x terms: 3x + x + 2x + x + x + 2x = 10x. Numbers: 1 + 3 + 4 = 8.
Perimeter = 10x + 8.
Check with x = 2: the sides are 6, 3, 4, 5, 2 and 8, which add to 28, and 10(2) + 8 = 28.
The shortcut: slide the two inner sides outwards and they fill the missing corner exactly, so an L-shape has the same perimeter as the rectangle around it: 2(3x) + 2(2x + 4) = 10x + 8. This only works when every corner is a right angle and the cut-out is at a corner. For area the rule is different, which is why our post on the area of an L-shaped figure splits the shape instead.
What mistakes should you watch for?
Skipping a side, especially the two unlabelled sides of an L-shape. Tick each side as you add it.
Dropping brackets, so 2(x − 1) becomes 2x − 1 instead of 2x − 2.
Adding unlike terms, as in 8x + 2 = 10x.
Writing cm² for a perimeter. A perimeter is a length, so its unit is cm.
For more practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can see where a sign or a side went missing. If like terms still feel shaky, the Fermi Concept Library gives each concept its own lesson.
Try it now: a rectangle has length 5x − 3 and breadth 2x + 1. Write its perimeter, then check your answer with x = 2.



