Hello, I've come across a problem in my textbook that really baffles me.

Task: to use substitution to solve the equation for x:

It was easy to make the quadratic equation,

but solving for x was a bit "ugly" (quoted because math is NOT ugly )

I've spent quite a time over this, any pointers?