My iphone's battery life plummeted last week, from a half day to just a few hours. Naturally my warranty had just expired, and I feared that I'd have to buy a new phone, pay an exorbitant battery replacement fee, or spend time learning how to replace the battery myself.
Ultimately, I found the cause -- a botched migration from one Exchange server to another -- and I was able to restore battery life to normal. Here's how I diagnosed the problem:
1. Search Google. This wasn't very fruitful. Most of the advice I found to increase battery life was tantamount to "Don't use your phone the way you want to."
2. Ask on Twitter and Facebook. Lots of friends came to the rescue. One friend had had success using a "full restore". Another had tried two full restores unsuccessfully, and eventually exchanged his phone for another at an Apple Store. Thankfully I didn't have to go to those extremes. The most helpful response was the question "Is your phone warm when it's not charging and you're not using it?" Answer: yes.
3. Delete applications you don't use. I had accumulated quite a few applications that I never use. Deleting all of them was a painless test to see if one was burning up the battery. No luck in my case.
4. Disable push notifications. I like push notifications, so this wouldn't be an acceptable solution, but it's a good test. I disabled global push notifications and each application's sounds, alerts, and badges. Still no luck in my case.
5. Delete email accounts. I remembered that my company's IT group had recently changed the address of our Exchange server. To get my email after the switch, I had changed the hostname on my phone. I suspect my phone retained the old hostname somewhere and periodically tried to connect to it.
After deleting my Exchange account, my battery life improved again. I recreated the Exchange account, and my phone continues to behave normally.