find the thermal stress in a 18 ft long steel beam that embedded in concrete. If the temperature rises by 40 degrees and the beam move a distance of .04 inches on each side.

E=30*10^6 psi

I don't know what you mean by the "sides" of the beam and don't know the direction the "sides' are moving. The problem needs a better description. Is it being stretched 0.08 inches in length? If so, the strain is 0.08/(18*12) = 2.5*10^-4 at constant temperature. However the thermal expansion (5.2*10^-4) must be subtracted from the 2.5*10^-4 to get the actual stress-producing strain. Multiply the difference by E to get the stress. It looks like it will actually be a compressive stress, since the steel wants to expand more (do to heating) than it actually did.

I may be misinterpreting your question, due to uncertainty of what the geometry is.