how to sove complimentary function