I have a 2003 bmw that starts and runs but after awhile it just dies what could it?

It only does this after driving for awhile if i the key off ad turm back on car starts and continues running normal

?2015-05-04T06:11:30Z

That is the behavior seen with an electrical problem, usually a bad relay(injector relay, fuel pump relay, crash relay, main relay) or bad motor (main fuel pump, fuel sending unit pump, Idle Air Control motor)
The Motronix ECM has some internal circuit components (solid-state driver relays, power transistors) that can cause this.

The basic electrical problem all of these devices have in common is their tendency to get hot as they work. The heat is low enough to be removed by surrounding air flow, but as they get older and there is insulation loss, they draw more current and get a little hotter. At one point they get hot enough to interrupt current flow, and they stop functioning. They immediately cool down when they shut off, and can be re-started almost immediately. They run normally until they get too hot again.