In this article, we propose an economic order quantity inventory model for items not only deteriorate continuously but also have their maximum lifetime. The demand rate varies by time in each cycle and follows a power pattern. Shortages are allowed and backlogged. The considered cost are holding cost, backlogging cost, ordering cost, deteriorated cost and purchasing cost. The two decision variables are the time at which the inventory level falls to zero and the length of the scheduling period. An algorithm is proposed to minimize the total cost per inventory cycle and to find the optimal ordering period and quantity. Numerical examples are provided to illustrate the theoretical results.