We begin by considering a free-body diagram of a short portion of the beam.
This element of the beam has a length Δx.