The quantum locking technique, which uses additional short low-loss sub-cavities, is effective in reducing quantum noise in space gravitational wave antenna DECIGO. However, the quantum noise of the main interferometer depends on the control systems in the sub-cavities. Here we demonstrate a new method to optimize the quantum noise independently of the feedback gain by completing the square in the quantum locking system. We successfully demonstrate in simulations that this method is effective in optimizing the homodyne angle to the best quantum-noise-limited sensitivity.