Let x be the width of the frame.
Then, x + 3 is the length of the frame.
The area of a rectangle is the product of its length and its width.
So, x(x+3) = 40
x^2 + 3x = 40
x^2 + 3x - 40 = 0
(x-5)*(x+8)=0
x-5 = 0 or x+8 = 0
x = 5 or x = -8
x = 5
The width is 5 and the length is 5 + 3 = 8