A procedure for determining a spacewise dependent heat source and the initial temperature