The equation w(w + 6) = 40 represents the area of a rectangle where w represents the width. What are the dimensions of the rectangle?