Finding the maximum likelihood estimator (Theoretical statistics)

Let $X_1, X_2, ..X_n$ represent a random sample from this pdf: $$f(x|\theta)= \frac{3x^2}{\theta^3}, 0\leq x\leq \theta$$ (with 0 elsewhere)

Could someone explain how I would find the maximum likelihood estimator (MLE) of this pdf? I know I have to get the likelihood function L, then the log likelihood function, then differentiate, but I am getting lost in the calculations. Thanks!


$$ \mathcal{L}(\theta; X_1,\dots, X_n) = f(X_1)\cdot\ldots\cdot f(X_n) $$ $$= \begin{cases}\frac{3X_1^2}{\theta^3}, & 0\leq X_1\leq \theta \cr 0, & \text{elsewhere}\end{cases}\;\times\;\ldots\;\times\; \begin{cases}\frac{3X_n^2}{\theta^3}, & 0\leq X_n\leq \theta \cr 0, & \text{elsewhere}\end{cases} $$ $$ =\begin{cases}\frac{3^n X_1^2\cdot\ldots\cdot X_n^2}{\theta^{3n}}, & 0\leq X_1,\ldots,X_n\leq \theta \cr 0, & \text{elsewhere}\end{cases} $$ $$ =\begin{cases}\frac{3^n X_1^2\cdot\ldots\cdot X_n^2}{\theta^{3n}}, & \max(X_1,\ldots,X_n)\leq \theta \cr 0, & \text{elsewhere}\end{cases} $$ $$ =\begin{cases}\frac{3^n X_1^2\cdot\ldots\cdot X_n^2}{\theta^{3n}}, & \theta\geq \max(X_1,\ldots,X_n) \cr 0, & \theta< \max(X_1,\ldots,X_n) \end{cases} $$

Since $\frac{3^nX_1^2\cdot\ldots\cdot X_n^2}{\theta^{3n}}$ decrease as $\theta$ increase, the highest value of $\mathcal{L}(\theta; X_1,\dots, X_n)$ is attained at the smallest value of $\theta$ satisfying the inequality $\theta\geq \max(X_1,\ldots,X_n)$. So, MLE is $\hat\theta = \max(X_1,\ldots,X_n)$.