Checking a rectangle recovered from area and a side difference
A rectangle with a known area and a known difference between its sides leads to a quadratic equation with two roots. This guide builds the equation, solves it and explains why only one root describes a real rectangle.
A puzzle that leads to a quadratic
A classic problem says that a rectangle has an area of 40 and that one side is 3 longer than the other. What are the sides? There is no direct formula for the sides, but the two facts combine into a single equation. Call the shorter side x. The longer side is x plus 3, and the area is the product, x times x plus 3, which equals 40. Expanding gives x squared plus 3x minus 40 equal to zero. That is a quadratic equation, and the Quadratic Equation Calculator solves it from its coefficients. The roots of the equation are candidates for the shorter side. A candidate is valid only if it makes sense as a length, which means it must be positive. This guide goes through that filtering step with the Rectangle Calculator as a final check.
Setting up the equation
The setup is where most mistakes happen, so it is worth slowing down. Define the unknown clearly: x is the shorter side. State the relationship between the sides: the longer side is x plus 3. Write the area condition: x times x plus 3 equals 40. Expand and move everything to one side so that the right side is zero, giving x squared plus 3x minus 40. The coefficients, in the standard form a x squared plus b x plus c, are a equal to 1, b equal to 3 and c equal to negative 40. The negative constant comes from moving the 40 across the equals sign. Entering c as positive 40 would solve a different problem, with different roots, so check the sign of each coefficient against the expanded expression.
Solving with the quadratic formula
The quadratic formula gives x as negative b plus or minus the square root of b squared minus 4ac, all divided by 2a. Here the discriminant is 3 squared minus 4 times 1 times negative 40, which is 9 plus 160, or 169, and the square root of 169 is 13. The roots are negative 3 minus 13, divided by 2, which is negative 8, and negative 3 plus 13, divided by 2, which is 5. The Quadratic Equation Calculator reports these as x1 equal to negative 8 and x2 equal to 5. Both satisfy the equation: 5 squared plus 15 minus 40 is zero, and 64 minus 24 minus 40 is also zero. Algebra alone does not tell us which root to use. The geometry does.
Choosing the positive root
A side length must be positive, so x equal to negative 8 is rejected. It solves the polynomial but does not describe any rectangle. The positive root, 5, is the shorter side, and the longer side is 5 plus 3, which is 8. The rectangle is 5 by 8. Check both conditions: the area is 5 times 8, which is 40, and the difference is 8 minus 5, which is 3. The Rectangle Calculator, given a length of 8 and a width of 5, returns an area of 40, matching the condition. Interestingly, the negative root is related to the solution: if x is negative 8, then x plus 3 is negative 5, so the pair is negative 8 and negative 5, the same rectangle with both sides reflected. That explains why its product is also 40.
Why there is always exactly one positive root
The product of the roots of a x squared plus b x plus c equals c divided by a, a result usually attributed to Vieta. Here c over a is negative 40, so the two roots multiply to a negative number and must have opposite signs. For any positive area and any difference, the equation x squared plus d x minus A equal to zero has a negative constant term, so one root is always positive and the other negative. The discriminant d squared plus 4A is also always positive, so both roots are real. This means that for a positive area and any side difference, a rectangle exists and is unique. The positive root is the shorter side, and the sum of the roots, negative d, tells you the other root is negative d minus the positive one.
A second example with different numbers
Try an area of 60 and a difference of 7. The equation is x squared plus 7x minus 60 equal to zero. The discriminant is 49 plus 240, or 289, whose square root is 17. The roots are negative 7 minus 17, over 2, which is negative 12, and negative 7 plus 17, over 2, which is 5. The Quadratic Equation Calculator with coefficients 1, 7 and negative 60 returns negative 12 and 5. The positive root, 5, is the shorter side, and the longer side is 12. The Rectangle Calculator with length 12 and width 5 gives an area of 60. All the conditions hold: 5 times 12 is 60 and 12 minus 5 is 7. The pairs (5, 12) with a hypotenuse of 13 are a well-known right triangle, but that is a coincidence unrelated to this problem.
The general closed form
For an area A and a side difference d, the shorter side is the positive root of x squared plus d x minus A. In closed form, x equals negative d plus the square root of d squared plus 4A, all divided by 2. For the first example, d is 3 and A is 40: negative 3 plus the square root of 9 plus 160, which is 13, divided by 2, giving 5. For the second, d is 7 and A is 60: negative 7 plus 17, divided by 2, giving 5 again. Only the positive square root appears, because the other sign leads to the negative root. When d is zero, the formula gives the square root of A, which is the side of a square. That agrees with intuition, since a zero difference means equal sides.
Testing the solution against both conditions
Every solver result should be tested against the original conditions, not only against the equation. For the 5 by 8 rectangle, area 40 is confirmed and difference 3 is confirmed. This guards against a setup error, such as writing the equation for a perimeter or an area of 40 with a difference of 4. A solution that satisfies the equation but not the original statement points to an error in the algebra. It also catches the case where the wrong root is chosen. Substituting the negative root into the geometry gives a negative side, which is plainly impossible, and the check takes seconds. Keep the equation and its domain together in your notes, so that the reason for discarding a root is recorded with the result.
Variations on the problem
The same method handles other versions. If the problem gives the perimeter instead of the area, the equation is linear and no root selection is needed. If it gives the area and the ratio of the sides, say the longer is 1.6 times the shorter, then x times 1.6x equals A, and x is the square root of the quantity A divided by 1.6. If it gives the diagonal and the difference, the equation is quadratic in a different form. Each variation yields its own equation, and the positive-length requirement applies every time. Whenever a geometric problem leads to a quadratic, expect one root to be physically meaningless and check which one. The skill carries over to fields such as fence layouts and floor plans, where a negative length has no meaning.
Real measurements and tolerances
The example uses exact numbers. Real dimensions are measured with finite precision, and the solution inherits the uncertainty. If the area of a plot is known only to within a few percent, the recovered sides are known only to a similar degree. Report them with appropriate digits, perhaps 5.0 by 8.0 rather than 5.0000 by 8.0000. The model also treats the plot as a perfect rectangle with square corners, which real land and materials seldom are. For construction or purchasing, add allowances for cuts, joints and waste, and verify with a physical measurement. The calculation produces the ideal dimensions, and the project decides how far the real object may depart from them. A gardener or builder using this method should also measure the same rectangle on the ground. Pace out or tape the 5 by 8 layout and confirm the diagonal, which should be the square root of 25 plus 64, about 9.43. If the diagonal differs noticeably, the corners are not square, and the area is no longer the product of the sides.
Completing the square as a cross-check
The quadratic formula is not the only way to the roots. Completing the square gives an independent check and also shows the geometry. Start with x squared plus 3x equals 40. Add the square of half the coefficient of x, which is 1.5 squared or 2.25, to both sides: x squared plus 3x plus 2.25 equals 42.25. The left side is x plus 1.5 squared, and the right side is 6.5 squared. So x plus 1.5 equals plus or minus 6.5, which gives x equal to 5 or negative 8. The picture behind it is a square of side 6.5 whose area is the rectangle plus a small square of side 1.5. The method returns exactly the same pair of roots as the calculator, and because it relies only on squares and square roots, it can be done without the calculator when a quick estimate is enough.
Reproduce the checks
Quadratic candidates
Open the Quadratic Equation Calculator and enter:
- Coefficient a
1- Coefficient b
3- Coefficient c
-40
Expected output:
Root using minus sign
-8Root using plus sign
5The polynomial has two real algebraic roots.
Positive geometric check
Open the Rectangle calculator and enter:
- Length
8- Width
5
Expected output:
Area
40The valid dimensions also have the stated difference.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- OpenStax ↗ · 2026-10-08
- OpenStax: rectangle, triangle and trapezoid properties ↗ · 2026-10-17