I was going over some homework, and stumbled across a true or false question that presented as the following:
$e^{\ln(-7)}$ = -7, True or False
Seeing as the definition of a logarithm presents the following:
$\log_{b}a$ = x is equal to $b^x$ = a
I presumed that the initial statement was true based on the fact that by taking the natural log of both sides you arrive at:
$\log_{e}$($e^{\log_{e}(-7)}$) = $\log_{e}(-7)$
which simplifies to
$\log_{e}(-7)$$\log_{e}(e)$ = $\log_{e}(-7)$
$\log_{e}(-7)$ = $\log_{e}(-7)$
yet the answer was marked incorrect. Logically the equation makes sense to me both forward and backward in the simplification. Am I missing something? I understand that the logarithm of a negative number is undefined, however, can't you use the logarithmic rule as a way to supersede the impossibility of solving this by calculating the values by hand?
There are two good answers I can see, I will explain both.
If we define the functions $\ln x$ and $e^x$ for real inputs and outputs, there is a problem with $\ln x$ when $x$ is negative. This can be seen as follows: graphing the exponential function $y=e^x$, one can see that it does not pass beneath the $x$-axis. This means that $e^x> 0$ for all $x\in \mathbb{R}$. It follows that there is no real number $x$ such that $e^x=-7$ and thus while we would like for $e^{\ln(-7)}=-7$ for the reason you gave, there is no real number that would play the right role for $\ln(-7)$. More generally, we fail to find a good candidate (in the real numbers, see below) for what $\ln x$ should be if $x$ is negative. For this reason, one sometimes declares that $\ln x$ is defined only for $x>0$. This is the reason you see people here saying that the statement is false. You could use this reasoning to conclude that rather than true or false the statement is ill-defined (which I think would be a little more accurate).
Now there is another context in which there is a number $x$ such that $e^x=-7$, namely if we allow complex numbers. If you are not familiar with them, you can revisit this part after you learn them. If you are familiar, the answer goes like this. The exponential function $e^z$ can be defined for complex numbers $z=x+iy$:
$$e^z=e^x(\cos y+i\sin y)$$
to understand this, look up Euler's formula (but ignore stuff about his other formula $V-E+F=2$). This definition allows $e^z$ to equal any non-zero complex number, therefore we can solve $e^z=-7$ if $z$ can be complex. This leads to the definition that Metehan Turan gives in their answer. In this case, $$\ln(-7)=\ln 7+i\pi$$
Plugging this in, we see that
\begin{align*} e^{\ln 7+i\pi}&=e^{\ln 7}(\cos \pi+i\sin \pi)\\ &=-7 \end{align*}
so, you can say that the statement is true on this reading.
*It should be noted that there is more than one complex number that is a reasonable value for the natural logarithm of a given non-zero complex number. We say that it is multivalued or that it is not uniquely defined.
Addendum You may ask why people would bother with the real-number-only version of the logarithm and the answer lies largely with the fact that the complex logarithm is not uniquely defined, and, perhaps worse, whichever definition is given it is not continuous! This is pretty bad, but it is a foundational element of the beautiful subject of complex analysis. A deep study of that subject will clarify all of these questions.