proof of special trig limits I'm trying to prove a special trig limit, which is...
$$\lim_{x \rightarrow 0} \frac{1 - \cos{x}}{x}=0$$
So far, this is what I have (and I'll explain where I'm confused)
Using the squeeze theorem,
$h(x) \leq f(x) \leq g(x)$
$$-x^2 + 1 \leq \cos{x} \leq 1 $$
$$-x^2 + 1 - 1 \leq \cos x - 1 \leq 1 - 1$$
$$-x^2 \leq \cos{x} - 1 \leq 0$$
$$0 \leq 1 - \cos{x} \leq x^2 $$
$$0 \leq \frac{1- \cos{x}}{x} \leq x$$
Since limit of $0$ and $x$ equals zero (as $x$ approaches zero), so does $\displaystyle{\frac{1-\cos{x}}{x}}$.
My first confusion, is when I try to graph the last line as separate functions
In quadrant $3$ and $4$, it holds up. However, in quadrant $1$ and $2$, it becomes 
$\displaystyle{x \leq \frac{1-\cos{x}}{x} \leq 0}$.
I'm not sure if this is allowed in squeeze theorem, but I'm a tad bit confused.
I have another guess as to why the end result is incorrect because $-x^2 + 1 \leq \cos{x} \leq 1$  are not the correct "sandwich" functions. $f(x) = \cos{x}$ touches $g(x) = 1$ in more than one spot. Every diagram of squeeze theorem I've seen, the sandwich functions only touch $f(x)$ at one spot. Is this a criteria I'm unaware of for picking $h(x)$ and $g(x)$?
PS, I know I could have used $h(x) = -x^2 + 1$ and $g(x) = x^2 + 1$, but I'd still like to know what I did wrong up top, please.
Thanks for any helps, guys/gals/automatons
 A: It's not exactly correct to go from
$$0\le1-\cos x\le x^2$$
to
$$0\le{1-\cos x\over x}\le x$$
because dividing through by $x$ reverses the inequalities if $x$ is negative.  What is OK is to conclude
$$0\le\left|{1-\cos x\over x}\right|\le |x|$$
The squeeze theorem still applies.
However, where did the opening inequality, $-x^2+1\le\cos x$, come from?
A: I would recommend that you use L'Hospital's Rule. That's probably easier, since you can get rid of the denominator instantly.
$$\lim_{x \to 0} \frac{1-\cos x}{x} \rightarrow \lim_{x \to 0} \frac{\sin x}{1} = 0$$
A: The reason your inequality fails to hold for negative $x$ is because you divided by $x$, so when $x$ is negative, the inequality signs will be reversed.  You could take your third line
$$ 0 \le 1 - \cos x \le x^2$$
and argue that, since all of the terms are nonnegative,
$$ 0 \le \left|1 - \cos x\right| \le \left|x^2\right|.$$
Then divide both sides by $|x|$ to obtain
$$0 \le \frac{|1 - \cos x|}{|x|} = \left|\frac{1-\cos x}{x}\right| \le |x|$$
so that
$$\lim\limits_{x \to 0} \left|\frac{1-\cos x}{x}\right| = 0.$$
This also proves that $\lim\limits_{x \to 0} \frac{1-\cos x}{x} = 0$.
(Intuitively, because the only numbers with magnitude close to zero are also close to zero.  You can also prove this in a more general setting using the sandwich theorem: for any function $f(x)$, $-|f(x)| \le f(x) \le |f(x)|$, so if $|f(x)| \to 0$  as $x \to c$, then $f(x) \to 0$ as $x \to c$, as well.)
A: I think what you are overlooking is that n going from the fourth line of your solution to the fifth, you are dividing through the inequality by $x$...  right?
But if $x$ is negative, dividing by $x$ should reverse the direction of the inequality.
So you end up with two inequalities:
$$0 \leq \frac{1-\cos x}{x} \leq x  $$ for $x \geq 0$, and
$$x \leq \frac{1- \cos x}{x} \leq 0 $$
for $x < 0 $.
Now compute the left- and right-hand limits separately, using the squeeze theorem together with the above inequalities.
A: Here's my simplification:
$$\lim_{x \rightarrow 0} \frac{1 - \cos{x}}{x}= \lim_{x \rightarrow 0} \frac{1 - \cos{x}}{x}\cdot\frac{1 + \cos x}{1 + \cos x} = \lim_{x \rightarrow 0} \frac{\sin^2 x}{x(1 + \cos x)} $$
$$= \frac{\sin 0}{1 + \cos 0}\cdot \lim_{x \rightarrow 0} \frac{\sin x}{x} = 0\cdot\lim_{x \rightarrow 0} \frac{\sin x}{x}=0$$
All that's left is to use the squeeze theorem to prove that
$$\lim_{x \rightarrow 0} \frac{\sin x}{x} = 1$$
The proof would be similar to this proof Find the limit $\displaystyle \lim_{x \to 0^+} (\sin x)^\frac1{\ln x}$
