The basic theory of modelling flexible links is the so-called Euler-Bernoulli equation which is given here. It tells you that there is some parameter called EI. E is the modulous of elasticity, I is the inertia. And this is the fourth partial derivative of that u which is the displacement of any element or any particle of the link plus some mass times some acceleration is equal to zero. This is a partial differential equation for which we need boundary conditions, in this case there are four of them, at the end where the motor is located, we assume what is called as a clamped boundary condition which means that the displacement is zero, and the slope is zero and at the other end we assume what is called as a mass boundary condition which has to deal with the moment and the force at that further end.