$X_1,\dots,X_n$ are a random sample of X. I want to estimate $\theta$ and check bias for the following density function:
$f(x|\theta) = \frac{2x}{\theta^2}, 0 \leq x \leq \theta$ and $\theta > 0$
At first, I did it with the Moments method:
$\hat{\alpha} = \frac{1}{n} \sum_{i=1}^{n} X_i$
$E[X] = \int_{0}^{\theta} \frac{2{x}^2}{\theta^2}dx = \theta$
Then: $\hat{\theta} = \frac{1}{n} \sum_{i=1}^{n} X_i$
And $E[\hat{\theta}] = E[\frac{1}{n} \sum_{i=1}^{n} X_i] = \frac{1}{n}\sum_{i=1}^{n}E[X_i] = \frac{n}{n}\theta$
So we can conclude that the estimator found by the moments method was unbiased.
Now, I tried to do the same using maximum likelihood, but I found the following:
$L(\theta|x) = \frac{2}{\theta^{2n}}\prod_{i=1}^{n}X_i$
Taking log on both sides:
$l(\theta|x) = 2log(\sum_{i=1}^{n} x_i) - 2nlog(\theta)$
The estimate using maximum likelihood,
$\frac{dl(\theta|x)}{d\theta} = 0$
But then I find:
$\frac{n}{\theta} = 0$
(the first term is 0 when derived, as it is not a function of $\theta$)
Which makes no sense. What did I do wrong here? Or is there an algebraic trick I am missing to calculate this estimator through maximum likelihood?