"My Happy Ending" is a song written and produced by Avril Lavigne and Butch Walker, and engineered by Russ T. Cobb for Lavigne's second album, Under My Skin (2004). It was released as the album's second internationally released single in 2004 and became Lavigne's fourth most successful single. It peaked higher than "Don't Tell Me", the album's first single. In the United Kingdom, it reached the top five; in the United States, it peaked at number nine (staying in #9 for 4 weeks), doing better in Mexico where it peaked at number 1. Structurally, the song is written in 4/4 style and has a repeated hook in both the chorus and in the intro and outro.