3 things to check.. alternator, if this isn't working right nothing you do to the battery is going to help you keep it running.. 2 battery is no longer holding *any* sort of charge, you may need a new one.. 3 you could possibly have a dead ground short. if your ground is shorted out it could compromise that whole circuit. .. well or if it is a newer vehicle could be something else with the computer I guess.. I know nothing about those though
The reason the car dies when taking off could be because of poor connections from the battery to the alternator. It could also be caused by corrosion on the battery terminals. It is advisable to consult a dealer and have these checked and fixed.
Alternator or bad battery. Take the battery to an auto supply or garage or automotive at Walmart ir similar. They can check the battery and tell you if its bad or not. You just may need a new battery which will be less expensive than if you need a new alternator.