‘Hopelessly Devoted to You’ was written and recorded after Grease had wrapped. The producers felt they needed a strong ballad and had Olivia Newton-John come back to film her singing this song. The song ended up receiving an Academy Award nomination.
When Olivia Newton-John was cast as Sandy, her character’s background had to be changed to accommodate Newton-John’s own background. In the original Broadway musical of Grease, Sandy was an all-American girl and her last name was Dumbrowski. In the movie version, she became Sandy Olsson, from Australia. Also, because of Newton-John’s casting, John Farrar (Newton-John’s frequent songwriter) had to write two new songs for the film, including ‘Hopelessly Devoted to You’, while other songs from the Broadway musical were dropped. – IMDB