Final answer:
The width of the carpet is 3 meters, and the length of the carpet is 6 meters.
Step-by-step explanation:
To find the length of the carpet, let's assume that the width of the carpet is x meters. Since the length of the carpet is 3 meters longer than the width, the length can be represented as x + 3 meters.
Now, we know that the area of a rectangle is given by the formula length × width. So, we can set up the equation:
(x + 3) × x = 18
x^2 + 3x - 18 = 0
Using the quadratic formula, we can solve for x, and we find that x = 3.
Therefore, the width of the carpet is 3 meters, and the length of the carpet is 3 + 3 = 6 meters.