Optimal Research and Development Expenditure