This has to be the stupidest question for the whole week but,
I watched this video: http://www.khanacademy.org/video/introduction-to-limits--hd?playlist=Calculus
and the guy defined a function
$$f(x) =\left\{ \begin{array}{ll} x^2, & \hbox{if }x\neq 2; \\ 1, & \hbox{if }x=2. \end{array} \right.$$
I believe that's the proper notation, please check the video at 5:52 if I messed it up.
My question is, is there a way to figure out the function's "body", just by making up rules like this?
For example, can I say that I have a function $f(x)$ that for
$$f(x) =\left\{ \begin{array}{ll} \sin(x), & \hbox{if }-1 < x < 1; \\ 0, & \hbox{if }x < -1\mbox{ or }x > 1. \end{array} \right.$$
How would I figure out the function's body just by using those preset rules?
Just pointing me in the right direction would be more than enough, please use the catalogue at khanacademy.org and tell me what to watch. Thank you for your time!
P.S. This might not make a ton of sense at first, but it's interesting for me because I'm a front-end web developer and I'm doing lots of graphic or motion related programming, which involves math.