solve square equation