Optimal polio prevention control is modeled through a functional target of direct and indirect costs linked to a system of nonlinear differential equations that interprets the dynamics of the transmission of the bacterium in the human population. It is analyzed by the maximum principle of Pontryagin obtaining a contour problem that is solved by MATLAB using hypothetical values for the parameters.