The purpose of this study is to explore the mathematical model of the optimal control of the time and distance in swimming teaching. This model can be used as a reference for the contents of every teaching unit in the future. It will positively help to achieve the teaching goals. The subjects of this study were fifty-one freshmen of the four-year college of St. John’s & St. Mary’s Institute of technology. The students were taught the basic skills. Of swimming for eight weeks, two hours each week, in the first semester. They then had swimming lessons for eight weeks, two hours each week, in the second semester. A precise value was calculated with the solution acquired through the mathematical model, resulting in the following findings: if the students are to be required to swim the target distance of fifty meters continuously without stopping by the end of the eight weeks in the second semester, then we will use the optimal training time in the optimal control model to control and train the students in order to achieve teaching goals.