In order to maintain utilitarianism, an action should maximize the total well being or the happiness. In this scenario, killing the one in order to save the five matches the goal of optimizing well being since doing so can save 5 lives compared to saving one life, granting the view that happiness should be measured in quantity but not quality.
In the patient scenario, killing the patient will be wrong since giving that the destiny of 5 people dying, choosing to kill a completely healthy person would be wrong since we are not causing the sickness of the 5 patients and killing another would be wrong. Moreover, if it is justified that killing the one is right, it is not reasonable to argue if going into the doctors means you could die for other patients’ lives. In the long run, no one would even go to the doctors and the total well being will decrease.