After I bought a 2001 325i with one key I bought a 2nd one from the dealer. I had a very hard time finding correct instructions to reprogram the car to recognize the new key. The key type I have is the rechargeable, non-replaceable battery, and has 3 buttons: 1) unlock; 2) lock; 3) open trunk
Have all your keys with you when you do this. This works:
Get in and close all the doors.
Turn the ignition to "Run" and the turn it off quickly. (Note: this is the middle position for the key, not "Accessory" or "Start")
Remove the key.
Hold the key up to your left shoulder.
Hold down the UNLOCK button and Press the LOCK button (center button) 3 times. After you release the LOCK button the third time the doors will lock to confirm the operation.
Quickly repeat the key-button-clicking steps (ONLY) for all your other keys. Note: Do not put any of the keys back in the ignition until you have reprogrammed all your keys