d: the number of days
The school sells 40 pencils per day, then after d days, 40d pencils are sold.
The school store has 2200 pencils, then after d days, 2200 - 40d pencils are left.
The manager reorders when the number of pencils in stock is 840, then the number of days needed to reorder can be computed by the next equation:
2200 - 40d = 840