This work considers optimal tracking of difficult paths for mobile robots in 2D space in the presence of obstacles. For determination of optimal trajectory, heuristic methods such as Genetic Algorithms and Random Particle Optimization (RPO) method are used due to their computational efficiency for NP-hard problems. The optimal path thus found is fed as a reference trajectory to compute the optimal control required to enable the robot to follow the path. This paper uses the Linear Quadratic formulation with a variational approach for the robot represented by Newton's second law of motion. The adequacy of a linear model and the effect of the sampling time on numerical convergence is examined to determine its accuracy i.e in maintaining low off-track error.