The optimal distributed tracking control algorithms over nonlinear cooperative wireless sensor networks (WSNs) are presented in this paper. In order to solve transfer delay and packet loss problem, the architecture of wireless active sensor (WAS) is employed, where a state estimator is embedded, which can provide the needed state information. Furthermore, the optimal distributed tracking control algorithm is proposed. By solving the matrix equations and the adjoint difference equations, the optimal control law can be obtained easily, in which an increment integral regulator is designed to implement tracking target without steady-state error and a nonlinearity compensation term is designed to compensate for the effect produced by system nonlinearity. Moreover, the observer-based dynamical algorithm is given considering the physically unrealizable disturbance states and the unavailable sensor states. Finally, computer simulations are carried out with application to two nonlinear pendulums, which prove that the algorithm is effective and easy to implement, and the system achieves the desired performance based on tradeoff between tracking error and control energy consumption.