Focusing on high-speed tracking scenarios of autonomous electric formula race cars, this paper proposes an optimal control method for minimizing the completion time of one lap. Firstly, a minimum-time optimal control problem is constructed in the time domain based on the longitudinal dynamics and driving system model of a race car. By combining nonsmooth analysis with Pontryagin’s minimum principle, an analytical optimal control strategy is derived. Secondly, to obtain the key costates of the analytical optimal control strategy, the optimal control problem is transformed from the time domain to the space domain, and further converted into a convex optimization problem in the second-order cone form. Finally, the convex optimization problem is modeled and numerically solved using MATLAB’s YALMIP and MOSEK solver tools, and therefore, the optimal trajectories of key costates are obtained. Simulation results show that, with the key costates obtained from convex optimization, the analytical optimal control strategy can provide accurate optimal driving and braking operations.