<s>[INST] Directrix and focus of $ax^2 + bx + c$ How can you find the directrix and focus of a parabola (quadratic function) $$ax^2 + bx + c,$$ where $a \neq 0?$ I mean, given the focus $x, y$ and directrix (I'll use a horizontal line for simplicity) $y = k$ you can find the equation of the quadratic; how do you do this backwards?
 [/INST] The goal is essentially to get $y = ax^2 + bx + c$ into the form $4p(y - k) = (x - h)^2$. This can be done by completing the square:
\begin{align}
y &= ax^2 + bx + c \\
\frac{y - c}{a} &= x^2 + \frac{b}{a} x \\
\frac{y - c}{a} + \left(\frac{b}{2a} \right)^2 &= x^2 + \frac{b}{a}x + \left(\frac{b}{2a} \right)^2 \\
\frac{1}{a} \left(y - c + \frac{b^2}{4a} \right) &= \left(x + \frac{b}{2a} \right)^2.
\end{align}
Thus the parabola can be written as 
$$
4 \cdot \frac{1}{4a} \left(y - \left(c - \frac{b^2}{4a} \right) \right) = \left(x - \left(-\frac{b}{2a} \right) \right)^2.
$$
The focus is
$$
\left(-\frac{b}{2a}, c - \frac{b^2}{4a} + \frac{1}{4a} \right) = \left(-\frac{b}{2a}, \frac{1 - b^2}{4a} + c \right)
$$
and the directrix is
$$
y = c - \frac{b^2}{4a} - \frac{1}{4a} = c - \frac{1 + b^2}{4a}.
$$

Update: Why $4p(y - k) = (x - h)^2$ is a useful form.
Starting from scratch, suppose we want to construct an upward or downward opening parabola (i.e., one of the form $y = ax^2 + bx + c$). Let its vertex be $(h, k)$. The definition of a parabola is that it is the set of all points equidistant to a point (the focus) and a line (the directrix). So let $(h, k + p)$ be the focus and $y = k - p$ be the directrix for some $p$. (Note that the vertex $(h, k)$ is midway between the focus and directrix, as required.)
Let $(x, y)$ be a point on the parabola. This means that its distance to the point $(h, k + p)$ is equal to its (shortest) distance to the line $y = k - p$. The point $(x, k - p)$ on the directrix is the closest point to $(x, y)$ (draw a picture to see why). So we equate distances:
\begin{align}
\sqrt{(x - h)^2 + (y - (k + p))^2} &= \sqrt{(x - x)^2 + (y - (k - p))^2} \\
(x - h)^2 + (y^2 - 2(k + p)y + (k + p)^2) &= y^2 - 2(k - p)y + (k - p)^2 \\
(x - h)^2 + (y^2 - 2ky - 2py + k^2 + 2kp + p^2) &= y^2 - 2ky + 2py + k^2 - 2kp + p^2 \\
(x - h)^2 &= 4py - 4kp \\
&= 4p(y - k).
\end{align}
Therefore, if we have a parabola with equation $4p(y - k) = (x - h)^2$, its focus will be $(h, k + p)$ and its directrix will be $y = k - p$.
</s>