In this paper we present an exact method for computing the Weibull renewal function and its derivative for application in maintenance optimization. The computational method provides a solid extension to previous work by which an approximation to the renewal function was used in a Bayesian approach to determine optimal replacement times. In the maintenance scenario, under the assumption an item is replaced by a new one upon failure, the underlying process between planned replacement times is a renewal process. The Bayesian approach takes into account failure and survival information at each planned replacement stage to update the optimal time until the next planned replacement. To provide a simple approach to carry out in practice, we limit the decision process to a one-step optimization problem in the sequential decision problem. We make the Weibull assumption for the lifetime distribution of an item and calculate accurately the renewal function and its derivative. A method for finding zeros of a function is adapted to the maintenance optimization problem, making use of the availability of the derivative of the renewal function. Furthermore, we develop the maximum likelihood estimate version of the Bayesian approach and illustrate it with simulated examples. The maintenance algorithm retains the adaptive concept of the Bayesian methodology but reduces the computational need. Copyright © 2014 John Wiley & Sons, Ltd.