<s>[INST] Find $p$ and $q$ such that $x^2+px+q
Find $p$ and $q$ such that $$x^2+px+q<x$$ iff $$x \in (1,5)$$
I tried the following:
$$x^2+px+q = (x+\frac{p}{2})^2+q-\frac{p^2}{4}$$
where the global minimum is $$q-\frac{p^2}{4}$$ if $$x = \frac{-p}{2}$$
However this doesn't seem to help with the problem at hand...
 [/INST] So $1$ and $5$ are the roots of $x^2+px + q = x$:
$$\begin{align*}
(x-1)(x-5) &= 0\\
x^2 - 6x + 5 &= 0\\
x^2 - 5x + 5 &= x\\
p &= -5\\
q&= 5
\end{align*}$$
</s>