Here's a question from the calculus section of AEEE 1997:
$${\lim_{x\to2}}\;(x-4)^x$$
I saw this question in a very old paper of the AEEE exam ($90's$ edition of the JEE exam). So when I saw this question, I obviously, wrote $4$ as the answer.
Now the answerkey said Limit does not exist.
I believed that maybe it has something to do with left hand and right hand limit and I tried referring some books on limits and understood how RHL and LHL should exist to say limit should exist but all those books have demonstrated this concept with problems involving greatest integer function or cases where limit tends to 0 which is pretty simple and understandable.
But I cant seem to apply that concept here as x approaches 2 from Right hand and Left hand side which is all positive.
So could anybody explain me the concept behind this. (And I would appreciate graphical representations!!! although not necessary) Also not I'm a high school student and starting calculus so please try to make the answer in simple language.
EDIT 1:
After reading some links from mathematics SE, I understood a possible reason for this could be 'If exponentiation $x^y$ of real numbers $x$ and $y$ is defined as $e^{y \log x}$, then one cannot define things like $(-2)^4$' So that creates whole new level of confusion now for me. In a cubic equation say $x^3+....$, if one of the roots of the solution is -2, then...how can $x=-2$ if $(-2)^3$ isn't possible using the above logic?
EDIT 2 (Very important)
For anyone answering, please also illustrate if or why $(x+4)^x$ should exist.
Short answer.
In general we define $a^b = e^{b\ln a}$, so $(x-4)^x = e^{x\ln(x-4)}$ is not a well defined real function for $x \leq 4$, and the given limit can't exist if we are considering only real numbers.
To answer the second question:
$$\lim_{x\to 2} (x+4)^x = \lim_{x\to 2} e^{x\ln(x+4)} = e^{\lim_{x\to 2}(x\ln(x+4))} = e^{2\ln 6} = 6^2 = 36$$
and there are no problems since $x+4$ is positive for $x > -4$ and $2> -4$.
(Really?) long answer.
Let me first explain how $a^b$ is defined when $a$ and $b$ are real numbers. I will assume for now that $a>0$ and will later explain the issues that arise if we don't make this assumption.
Fix some $a>0$. At first let $b = n$ be a positive integer. We are well aware that $$a^n = \underbrace{a\cdot a\cdot a\cdot \ldots \cdot a}_n.\tag{1}$$ We can easily extend this definition to all integers $n$ by defining $a^0 = 1$ and defining $$a^{-n} = \frac 1{a^n}\tag{2}.$$
Definitions $(1)$ and $(2)$ are very satisfying since we have the familiar rules for powers like $a^{m+n} = a^m\cdot a^n$ and $(a^m)^n = a^{mn}$, which work for any integers $m,n$.
Next, we would like to define $a^b$ when $b$ is a rational number. First, let $b = \frac 1n$ for a positive integer $n$. Now we can define $$a^{1/n} = \sqrt[n] a\tag{3}.$$ At this point we need to pause and think about what $n$-th root means. It should be a solution to the equation $x^n = a$ because we want $n$-th root to be opposite of taking $n$-th power, i.e. $(\sqrt[n]a)^n = a$. However, if you know about complex numbers, you know that there are exactly $n$ complex solutions to the equation $x^n = a$. So, if we want $n$-th root to be well defined as a function, we are forced to make a choice which solution we want. Luckily, when $a > 0$ there is always a unique positive real solution to the equation $x^n = a$. This should be familiar when you ask the question what is $\sqrt 1$. Although $1^2 = (-1)^2 = 1$, $1>0$, while $-1 < 0$, so $\sqrt 1 = 1$. This is more complicated if we ask what is $\sqrt[4] 1$, since we now have $1^4 = (-1)^4 = i^4 = (-i)^4 = 1$ (where $i$ is the imaginary unit), but only $1$ is positive real number. This is maybe a long story to justify that when $a > 0$, there is no issue in making sense of the definition $(3)$.
Now we are ready to extend our definition to rational numbers. Let $b = m/n$ where $m$ is an integer and $n$ is a positive integer. We can define $$a^{m/n} = (\sqrt[n] a)^m\tag 4$$ and you can see our rules $a^{b+c} = a^b\cdot a^c$ and $(a^b)^c = a^{bc}$ are readily satisfied, so we are happy with this.
The next step is to extend our definition to arbitrary real number $b$. The way how real numbers work is that rational numbers are dense in real numbers, which means we can obtain any real number $b$ as a limit of a sequence of rational numbers $(q_n)$. We would like that our definition of $a^b$ is continuous, i.e. $\lim_n a^{q_n} = a^{\lim_n q_n} = a^b$. However, since there are many different sequences $(q_n)$ of rational numbers that converge to the same real number $b$, to avoid discussion that our definition doesn't depend on the choice of sequence $(q_n)$, we can use the well known continuous function: $x\mapsto e^x$. How this is defined goes beyond the scope of high school but let us just assume that this function is given to us and that it satisfies the properties $e^{x+y} = e^x\cdot e^y$ and $e^0 = 1$ and $(e^b)^c = e^{bc}$. We can now define $$a^b = e^{b\ln a}\tag 5.$$ Note that this definition is reasonable, since $e^{b\ln a} = (e^{\ln a})^b = a^b$ for any rational number $b$, and since exponential function is continuous, we immediately get that $\lim_n a^{q_n} = \lim_n e^{q_n\ln a} = e^{\lim_n q_n\ln a} = e^{b\ln a}$, so our definition $(5)$ works beautifully for any real $b$ and $a>0$. It also generalizes all the previous definitions we gave.
So, for any positive real number $a$, we can define a real function $x\mapsto a^x$ by the formula $a^x = e^{x\ln a}.$
At this point, it might have become clear where the problem is when $a$ is not a positive real: $\ln a$ is not a real number! To extend definition of $a^x$ for negative real numbers $a$, we need to deal with complex numbers and go to the field of complex analysis which is way beyond the scope of high school. I will not go there, but let me add something more about the problem
The problem with $a < 0$ first arises in considering definition $(3)$. You can see that there is absolutely no issue in definitions $(1)$ and $(2)$ since we are only dealing with multiplication and division, so something like $(-2)^{-3} = -1/8$ is not problematic at all.
Let's extend discussion of $(3)$ (and $(4)$). When $n$ is an odd positive integer, there is no problem with $\sqrt[n]a$ since for $a<0$ and odd positive integer $n$, there is always unique negative real solution to the equation $x^n = a$. For example, $\sqrt[3]{-1} = -1$. But, when $n$ is even, we have a problem, what is, for example $\sqrt{-1}$? The answers could be $i$ or $-i$ and usually we make a convention that $\sqrt{-1} = i$ because that convention is very useful when you consider quadratic formula. But it is not without any issues, you might have seen the famous wrong proof $$1 = \sqrt 1 = \sqrt{(-1)\cdot(-1)} = \sqrt{-1}\cdot \sqrt{-1} = i\cdot i = -1,$$ which tells us that a rule like $\sqrt ab = \sqrt a\cdot\sqrt b$ falls apart when we are not dealing with positive $a$ and $b$.
Furthermore, what is $\sqrt[4]{-4}$? You can check that $(1+i)^4 = (1-i)^4 = (-1+i)^4 = (-1-i)^4 = -4$. What do we choose now?
Whatever we would choose, we break the rule $(a^b)^c = a^{bc}$, for example
$$4 = ((-4)^4)^{1/4} \neq ((-4)^{\frac 14})^4 = -4.$$
To systematically deal with problems like these one needs to take definition $(5)$ and extend definition of logarithm to (almost) all complex numbers. But we are now leaving the realm of real numbers and real analysis.