Nobody here works for Apple so we can not say for sure about what will be done under warranty. Only Apple can say for sure. If it truly is a bad battery then it likely will be covered by warranty as long as you are still in the same country where the phone originated from Apple.
Go to this web site for information about how to request battery service for your iPhone: iPhone Battery Repair & Replacement - Apple Support
For cost and availability, enter your model information in the "Get an estimate" box at the bottom. (It is best that you do this since sometimes price estimates posted by contributors here do not take into account that you may not be in the same country as the person providing the estimate.)
For instructions on how to get your iPhone, iPad, or iPod touch ready for service click here --> Get your iPhone, iPad, or iPod touch ready for service - Apple Support