The correct equations that form a system of equations to determine the number of boxes of pens, x, and the number of boxes of pencils, y, that Mr. Kelly buys are:
A. x+y = 40 (since he buys a total of 40 boxes)
E. 5x + 2y = 131 (since he spends a total of $131)
Therefore, the correct answers are A and E.