A major branch in mathematical sciences, which has been given special attention recently, is optimization, including various methods such as linear programming, integer programming, and last not the least dynamic programming. Due to the unique characteristics of water and wastewater systems, specifically multi stage nature of such systems, dynamic programming has been widely applied. In dynamic programming a systematic procedure is used to determine a combination of consecutive decisions such that the overall system performance is maximized.The purpose of this research is the minimization of cost for industrial water treatment systems. To attain this goal in dynamic programming, it is necessary to determine the cost of each subsystem in various conditions. Next the dynamic programming procedure, determines the optimum system.In this paper, first the general case is considered, i.e., a cost function is defined for each treatment unit. Further, these are applied to the system under consideration, which may be any industrial plant whatsoever, and ~cost is evaluated for each and every subsystem. Finally the optimum system is obtained for the general function given below,Minimize z=[rn(Sn,dn)+rn-1(Sn-1,dn-1)+...+r1(S1,d1)]In determining the cost function of industrial water systems by reverse osmosis, ion exchange, and chemical precipitation, a number of factors should be considered. Among these foreign exchange rates, current domestic and international market prices, manufacturer's proposals, system components' life span, and bank deposit interest rates are of prime importance.