I'm not sure what's your question.
If you want to solve x, you could set
2x-2=x+2 and then solve
y=2x-2
y=x+2
3 answers
y=2x-2
y=x+2
y=y
2x-2=x+2
2x-x=2+2
x=4
y=2x-2
y=2*4-2=8-2=6
y=x+2
y=4+2=6
x=4
y=6
y=x+2
y=y
2x-2=x+2
2x-x=2+2
x=4
y=2x-2
y=2*4-2=8-2=6
y=x+2
y=4+2=6
x=4
y=6
lo8o