# How do you solve for x in y = x^2 - 2x?

Apr 8, 2015

Rewrite as ${x}^{2} - 2 x - y = 0$. This is a quadratic equation in variable $x$.
Don't be confused, I'm just pointing out that we will temporarily be thinking of $y$ as a constant. (a number).

We would solve by factoring if we could, but we can't so we'll use the quadratic formula, which says that
the solutions to $2 {x}^{2} + b x + c = 0$ are $x = \frac{- b \pm \sqrt{{b}^{2} - 4 a c}}{2 a}$.

In this equation, $a = 1$, $b = - 2$ and $c = - y$, so we get:

$x = \frac{- \left(- 2\right) \pm \sqrt{{\left(- 2\right)}^{2} - 4 \left(1\right) \left(- y\right)}}{2 \left(1\right)}$ so

$x = \frac{2 \pm \sqrt{4 + 4 y}}{2} = \frac{2 \pm \sqrt{4 \left(1 + y\right)}}{2} = \frac{2 \pm 2 \sqrt{1 + y}}{2}$ and finally,

$x = 1 \pm \sqrt{1 + y}$

(You can check the answer by substituting for $x$ and simplifying:

${\left(1 + \sqrt{1 + y}\right)}^{2} - 2 \left(1 + \sqrt{1 + y}\right)$ to get $y$.

And similarly for the other solution.