In this paper, we have considered an inhomogeneous beam with a damping distributed along the length of the beam. The beam is clamped at both ends and is assumed to vibrate longitudinally. We have estimated the total energy of the system at any time t. By constructing suitable Lyapunov functional, it is established directly that the energy of this system decays exponentially.