If for some reason your car forgets your key's RF id then it will need to be recoded. Below are the steps to recode the key to the car. This works on both the old key and the new diamond shape keys. Have all the keys with you when recoding! Old Key/New Key information.
Step 1. Get in the car and shut all the doors.
Step 2. Put a key in the ignition and turn it to Accessory and within 5 seconds, turn the ignition Off and remove the key.
Step 3. Press and hold the Unlock (Arrow) button and press and release the Lock button three times within 10 seconds. Release the Unlock button and the car should lock and then unlock the doors to let you know you did it right. Repeat step 3 for any other keys within 30 seconds.
Step 4. Insert a key into the ignition and turn it to Accessory. This terminates the key coding procedure.
If it doesn't work try it again. The timing is not critical. If you have tried it several times and it doesn't work then something must be wrong with the key or
The order in which the keys are initialized is not critical. If they are not initialized in the same order as they were originally the key memory functions will not be assigned to the correct key.
Don't like my instructions then you can read instructions posted on the net by other people, although they emphasize things that just aren't that important.
http://forum.e46fanatics.com/showthread.php?t=592731