What's the MLE of lambda for $f(x)= \frac{1}{λ}\exp{\frac{−x}{λ}}$? What's the MLE of $\lambda$ for $$f(x)= \frac{1}{λ}\exp\left({\frac{−x}{λ}}\right)$$  Values of x are 5,7,9,3,6,8
Is it just the mean of $x$? 
Thanks.
 A: Answer: yes, it is the mean of the sample data.
(I leave the single data case below as it is illustrative of the technique.)
Let $x$ be a single observed sample, $f$ the likelihood function for an exponentially distributed random variable with parameter $1/\lambda$. Maximising the log-likelihood:
 \begin{align}
   \ell(\lambda) := \log(\ f(x)) &= - \log \lambda - x/\lambda  \\
   \ell\,'(\lambda) = 0 ⇔ 0 &= -\frac{1}{\lambda} + \frac{x}{\lambda^2} \implies \lambda = x 
\end{align}
Noting that $\ell(\lambda)→ -∞$ as $\lambda → 0,∞ $ and it is $C^1[0,∞)$ in $\lambda$, $x$ is the value of $\lambda$ which maximises $\ell$; by the monotonicity of $\log$, this also maximises $f(x)$; thus this is the MLE of $\lambda$ (by definition of MLE).

Suppose instead that you now have sampled $n$ times with data $x_1,\dots,x_n$ from the same distribution as above. Assuming that you sample independently, your likelihood function is now
\begin{align}
 f(\mathbf{x},\lambda) = f(x_1,\dots,x_n,\lambda) = \prod_{i=1}^n f(x_i) = \frac{1}{\lambda^n}\exp\left(-\frac{\sum x_i}{\lambda}\right)
\end{align}
Where to keep things neat we write $\sum x_i := \sum_{i=1}^n x_i$.
As before, we maximise our log-likelihood:
\begin{align}
\ell(\lambda) := \log f(\mathbf{x},\lambda) &= -n \log \lambda - \frac{1}{\lambda}\sum x_i \\
\implies \ell'(\lambda)=0 \iff 0 &= \frac{-n}{\lambda} + \frac{\sum x_i}{\lambda^2} \implies \lambda = \frac{\sum x_i}{n}
\end{align}
Again $\ell(\lambda)$ cannot be maximised anywhere else as it is $C^1$ and tends to $-\infty$ at $0$ and $\infty$; by monotonicity of $\log$ this is the maximum point of $f(\mathbf{x},\lambda)$ as well. Hence, the MLE is in fact the mean of the data, $\frac{\sum x_i}{n}$.
