The exact partial differential equation to design aplanatic freeform-mirror-based optical systems is presented. The partial differential equation is not limited by the number of freeform surfaces or their orientations. The solutions of this partial differential equation can be useful as initial setups that can be optimized to meet higher criteria. One of these solutions is tested as an example of the initial setup, and the results are as expected by the theory.