Is this question too easy or am I getting it wrong?

In my homework, I am asked to find the limit

$$\lim\limits_{x\to0}{\frac{x}{e^x}}$$

But obviously, you could just substitute $x = 0$:

$$\lim\limits_{x\to0}{\frac{x}{e^x}} = \lim\limits_{x\to0}{\frac{0}{e^0}}=\lim\limits_{x\to0}{\frac{0}{1}}=\lim\limits_{x\to0}{0} = 0$$

This seemed – by far – too easy. Is this really all there is to it? Is my solution valid?

Edit:

Apparently, this is valid. Still, I do wonder if these are the only conditions that allow me to actually substitute my limit variable.

-
Yup, that's it. If you want, you can justify why your substitution was valid using common properties of limits. –  Alex G. Jun 11 at 19:26
@AlexG. Would it be enough to mention that, by substituting, we don't stumble across undefined or undeterminate values? :) –  chiru Jun 11 at 19:29
@Glacier We use L'Hôpital's rule only and only if we have a $\pm\infty/\infty$ or a $0/0$ form which isn't the case here since if you plug in $x=0$ you get a well defined value $0/1=0$. –  Hakim Jun 11 at 19:35
@حكيمالفيلسوفالضائع Touché. :) –  chiru Jun 11 at 19:57
You seemed surprised at how easy this one was, but the point of problems like this is to impress upon students that techniques for resolving undefined or indeterminate values (like L'hôpital's Rule) can give you the wrong answer if applied in this context. –  Zimul8r Jun 11 at 20:17

The limit is correct, but you have to justify that you can do the substitution. In general $$\lim\limits_{x\rightarrow x_0} f(x)=f(x_0)$$ holds only if $f$ is continuous at $x_0$. So to answer your question: you can do the substitution only if the function $f$ is continuous and of course the function must be defined at the point $x_0$. Since $f(x) = x/e^x$ is continuous for every $x\in\mathbb{R}$ and the value $f(0)$ is defined we have that $$\lim\limits_{x\rightarrow 0}\frac{x}{e^x} = \frac{0}{e^0}=0.$$

-
This answer is much more precise than mine and also answers the additional question that I've edited into my original question. +1 –  chiru Jun 11 at 20:12
Is this actually an answer? The definition of continuity itself involves limits, you're just using circular reasoning. –  Mehrdad Jun 12 at 2:01
@Mehrdad: depends which definition you use; the one I was taught doesn't use limits. (According to Wikipedia this is called the Weierstrass definition. Since it is more general, I'd argue that it is preferable.) –  Harry Johnston Jun 12 at 2:42
@HarryJohnston: The Weierstrass definition of continuity literally is the statement that $f$ is continuous at $c$ whenever $\lim_{x\to c} f(x) = f(c)$... so I'm not sure what you're talking about. Using the Weierstrass definition is circular reasoning by its very nature. The only thing you can really do to avoid circular reasoning is to actually do the epsilon-delta proof, otherwise your assumption (that the proof holds) is exactly what you're trying to prove. –  Mehrdad Jun 12 at 2:53
@Mehrdad: the Weierstrass definition is trivially equivalent to the statement using the limit plus the definition of the limit, true. But you wouldn't generally actually calculate the limit in order to prove continuity. MJD's answer fills in some of the parts this answer skips lightly over. –  Harry Johnston Jun 12 at 3:20

One of your questions is “When can I substitute the limit variable”, which I take to mean

“When is $$\lim_{x\to a} f(x) = f(a)?”$$

A sufficient condition for this to work is that $f$ must be continuous at $a$. (In fact, this is the definition of what it means for a function to be continuous at $a$!) This doesn't immediately answer the question, because continuity can be very complicated. However, the following rules cover a great many situations:

1. Constant functions $x\mapsto c$ are continuous everywhere (“$x\mapsto c$” means “the function that takes $x$ and maps it to $c$”.)
2. The identity function $x\mapsto x$ is continuous everywhere
3. The addition and multiplication functions $(x,y)\mapsto x+y$ and $(x,y)\mapsto xy$ are continuous everywhere
4. The division function $(x,y)\mapsto \frac xy$ is continuous except where the denominator $y$ is $0$
5. The exponential function $x\mapsto e^x$ is continuous everywhere
6. Compositions of continuous functions are continuous

Here we have the function $x\mapsto \frac x{e^x}$. The function $x\mapsto x$ is continuous by (2). The function $x\mapsto e^x$ is continuous by (5). The quotient of these will be continuous by (6) and (5), except when the denominator $e^x$ is $0$—but it never is. So $x\mapsto\frac x{e^x}$ is continuous everywhere.

The upshot of all this is that $$\lim_{x\to a} \frac x{e^x} = \frac a{e^a}$$ for all $a$, and in particular for $a=0$.

To consider the simplest possible counterexample, take $x\mapsto \frac1x$. This is continuous everywhere except possibly at $x=0$, and indeed we have $\lim_{x\to a}\frac1x = \frac 1a$ for all $a\ne 0$. For $a=0$ there is no limit.

A more interesting counterexample is $x\mapsto \frac{\sin x}{x}$. Again, we have $\lim_{x\to a}\frac{\sin x}{x} = \frac{\sin a}{a}$ for all $a\ne 0$. For $a=0$ we have the interesting and nontrivial fact that $\lim_{x\to 0}\frac{\sin x}{x} = 1$.

-
Attention readers: this is the answer! The one flagged by the PO is a circular definition. –  caya Jun 12 at 4:32
@caya Can you provide me a proof that $e^{x}$ is continuous everywhere(which this answer rests on)? Can you do it without a limit? –  Cruncher Jun 12 at 14:25
If I remember correctly (in Spivak's) $e^x$ is defined through its Taylor series and proved continuous that way. –  caya Jun 13 at 4:55

Well, according to WolframAlpha, the solution $\lim\limits_{x\to0}\frac{x}{e^x} = 0$ is indeed correct.

Also, I think that my substitution is justifiable, as by performing the substitution, we don't have the problem of getting undefined or indeterminate values.

-
This really would be better if incorporated into your question. You seem to be asking another question rather than answering your original question (even though you've mentioned the W|A answer). –  robjohn Jun 11 at 19:43
Thanks. I've moved the questioning part to the original question. –  chiru Jun 11 at 19:47