This paper presents an optimal trajectory planning method for industrial robots. The paper specially focuses on the applications of path tracking. The problem is to plan the trajectory with a specified geometric path, while allowing the position and orientation of the path to be arbitrarily selected within the specific ranges. The special contributions of the paper include (1) an optimal path tracking formulation focusing on the least time and energy consumption without violating the kinematic constraints, (2) a special mechanism to discretize a prescribed path integration for segment interpolation to fulfill the optimization requirements of a task with its constraints, (3) a novel genetic algorithm (GA) optimization approach that transforms a target path to be tracked as a curve with optimal translation and orientation with respect to the world Cartesian coordinate frame, (4) an integration of the interval analysis, piecewise planning and GA algorithm to overcome the challenges for solving the special trajectory planning and path tracking optimization problem. Simulation study shows that it is an insufficient condition to define a trajectory just based on the consideration that each point on the trajectory should be reachable. Simulation results also demonstrate that the optimal trajectory for a path tracking problem can be obtained effectively and efficiently using the proposed method. The proposed method has the properties of broad adaptability, high feasibility and capability to achieve global optimization.