The way these equations are arranged helps.
First only deal with the left handside.
X^2+20x= (x+a)^2 -b where we are looking for a,b
You need to know the general formula for (x+a)^2=x^2+2ax+a^2
20x = 2*10x so a will be 10
(x+10)^2= x^2+20x+100
Now lets look at the original question:
X^2+20x=10
we know now that (x+10)^2= x^2+20x+100
Thus X^2+20x=(x+10)^2 -100
So X^2+20x=10 becomes
(x+10)^2 -100 =10
(x+10)^2=110
For the other question you need to follow the same logic.