One edge of a painting is 6 in. Longer than the other edge. The painting has a 2-inch-wide frame. The function f(x) = x2 + 14x + 40 represents the total area of the painting and frame. Find the total area of the painting and the frame if the longer side of the frame is 14 inches long.