The problem of sensor placement for optimal filtering and smoothing problems is considered. Matrix equations are derived that relate individual changes in sensor locations to changes in the covariance matrix. These gradient matrices are used in formulating a design procedure that seeks the optimal sensor location for a particular estimation problem. The derivation and use of these gradient matrices are the main contributions of this paper. This approach avoids using indirect measures of performance offered through observability and information matrix. A numerical example demonstrates that an optimal sensor location for a filtering problem is not necessarily optimal for a smoothing problem. The particular sensor placement to be chosen will depend then on the type of problem at hand.