Restricting trial function to converge the solution

Im not sure what you mean by this.

You can have a look at: