Following the tracks of Malbet, Yu, & Shao (1995) on dark hole algorithms, we present analytical methods to measure and correct the speckle noise behind an ideal coronagraph. We show that, in a low aberration regime, wavefront sensing can be accomplished with only three images, the next image being fully corrected (no iterative process needed). The only hardware required is the coronagraph deformable mirror and an imaging detector in the focal plane, thus there are no non-common path errors to correct. Our first method, speckle field nulling, is a fast FFT-based algorithm requiring the deformable mirror influence functions to have identical shapes. Our second method, speckle energy minimization is more general and based on matrix inversion. Numerical simulations show that these methods can improve the contrast by several orders of magnitude.