  The Euler-Bernoulli equation describing the deflection of a beam is a vital
tool in structural and mechanical engineering. However, its derivation usually
entails a number of intermediate steps that may confuse engineering or science
students at the beginnig of their undergraduate studies. We explain how this
equation may be deduced, beginning with an approximate expression for the
energy, from which the forces and finally the equation itself may be obtained.
The description is begun at the level of small "particles", and the continuum
level is taken later on. However, when a computational solution is sought, the
description turns back to the discrete level again. We first consider the
easier case of a string under tension, and then focus on the beam. Numerical
solutions for several loads are obtained.
