Optimization in Solving Elliptic Problems