Complete the square: $ x^2 + x + 1 = (x^2 + x + \tfrac 1 4) + \frac 3 4 = \left(x + \frac 1 2 \right)^2 + \frac 3 4. $ That gets you the second one.
For the first one, put everything on one side of the inequality and $0$ on the other side, and procede similarly.
Later addendum in response to vitno's question in the comments below: In general, the process of completing the square looks like this: $ \begin{align} ax^2 + bx + c & = a\left(x^2 + \frac b a x\right) + c \\[12pt] & = a\left(x^2 + \frac b a x + \frac{b^2}{4a^2}\right) + c - a\left(\frac{b^2}{4a^2}\right) \tag{$\begin{array}{c} \text{completing} \\ \text{the square}\end{array}$} \\[12pt] & = a\left(x + \frac{b}{2a}\right)^2 + \frac{4ac - b^2}{4a}. \end{align} $ Say you have a particular case: $ 3x^2 + 20 x + 7. $ Proceed as follows: $ 3\left(x^2 + \frac{20}{3} x \right) + 7. $ Take half the coefficient of the first-degree term and square it, getting $(10/3)^2$. Add this in the appropriate place, and substract it out later: $ 3\underbrace{\left(x^2 + \frac{20}{3} x + \left(\frac{10}{3}\right)^2 \right)}_{\text{a perfect square}} + 7 - 3\left(\frac{10}{3}\right)^2 $ $ = 3\left(x + \frac{10}{3}\right)^2 - \frac{79}{3}. $
Knowing how and when to complete the square is useful.
Remember this: The purpose of completing the square is always to reduce a quadratic polynomial with a first-degree term to a quadratic polynomial with no first-degree term.