I don't want to alarm you but UA arrivals at LAX are a bit of a mess at the moment due to lack of gates. I recently had to sprint to make a connection, after landing 10 mins early we got put in the penalty box for 30 min waiting for a gate. If you get that sort of delay making a terminal change in 40 mins is going to be challenging. I would consider SDC onto an earlier flight?
http://www.flyertalk.com/forum/unite...rival-lax.html