FYI there is a dedicated thread only a few posts down for this type of question. Someone asked about a similar 40 min connection earlier, it's fine at DFW if you're on time but obviously doesn't leave much room for error.
AA Guide: DFW / Dallas - Fort Worth International Airport - MCT, Connection, etc