It was written by Ryan Tedder , Evan Bogart and Knowles for her third studio album , I Am ... Sasha Fierce .
The song was composed by Ryan Tedder , Evan Bogart , and Knowles .