A probability density function(PDF) optimal control strategy for a class of bounded affine nonlinear dynamic stochastic system is presented to drive the PDF of systems output to follow a desired PDF. An affine nonlinear state space model and PDF approximation equation can be obtained by using the linear ??-spline approximation, which transfer PDF tracking to output tracking about nonlinear state model. Then a linear time-varying sequence approximation is employed to transfer the nonlinear systems to linear time-varying systems, and the optimal tracking controller of nonlinear dynamic stochastic system is obtained by using linear time-varying system iteration method. Theoretical analysis and simulation results show the effectiveness of the control algorithm.