How to solve with complex numbers?