Hi,

I have a simple question regarding solving a quadratic function

$\displaystyle y = ax^2 + bx + c$

I tried to solve it as follows in general for y=y1 find the roots of the quadratic equation:

$\displaystyle 0 = ax^2 + bx + c - y1$

Hence, in more detail...

for $\displaystyle y = y1$:

$\displaystyle k = c - y1$

$\displaystyle d = b^2 - 4 a k$

assuming $\displaystyle d > 0$

$\displaystyle x1 = \frac{(-b + sqrt(d))}{2a}$

$\displaystyle x2 = \frac{(-b - sqrt(d))}{2a}$

However, this is not producing the desired result. For example, assume the following function

$\displaystyle y(x) = 3x^2 + 2x + 1$

$\displaystyle y(3) = 34$

and $\displaystyle x(34)$ following the solution above gives:

$\displaystyle x1=27$ and $\displaystyle x2=-33$

None of them being 3 as I would expect. Can someone point me in the right direction or a link with info I can look up?

Thank you in advance.