<s>[INST] Show that the value is, indeed, the MLE Let $ X_1, ... X_n$ i.i.d with pdf
$$f(x;\theta)=\frac{x+1}{\theta(\theta+1)}\exp(-x/\theta), x>0, \theta >0$$
It is asked to find the MLE estimator for $\theta.$
The likelihood function is given by
$$L(\theta;x)=[\theta(1-\theta)]^{-n}\exp\left(\frac{\sum_i x_i}{\theta}\right)\prod_i (x_i+1)I_{(0,\infty)}(x_i)$$
Then, the derivative of log-likelihood will be
$$\frac{dlogL(\theta;x)}{d\theta}=\frac{-(2\theta+1)n}{\theta(1+\theta)} + \frac{\sum X_i}{\theta^2}$$
I've obtained my candidate to MLE. But, doing the second derivative of the log-likelihood, I could not conclude that it is negative so that the candidate is, indeed, the point of maximum. What should I do, in this case?
 [/INST] Removing the multiplicative constants that do not depend on $\theta$, the likelihood function in this case is:
$$\begin{equation} \begin{aligned}
L_\mathbf{x}(\theta) 
&= \prod_{i=1}^n \frac{1}{\theta (\theta+1)} \cdot \exp \Big( - \frac{x_i}{\theta} \Big) \\[6pt]
&= \frac{1}{\theta^n (\theta+1)^n} \cdot \exp \Big( - \frac{n \bar{x}}{\theta} \Big). \\[6pt]
\end{aligned} \end{equation}$$
Thus, the log-likelihood function is:
$$\ell_\mathbf{x}(\theta) \equiv \ln L_\mathbf{x}(\theta) = -n \Bigg[ \ln(\theta) + \ln(\theta+1) + \frac{\bar{x}}{\theta} \Bigg] \quad \quad \quad \text{for all } \theta >0.$$
I will write the derivatives of this function out in a form that is useful for finding the critical points and then finding the second derivative at those critical points:
$$\begin{equation} \begin{aligned}
\frac{d \ell_\mathbf{x}}{d \theta}(\theta)
&= -n \Bigg[ \frac{1}{\theta} + \frac{1}{\theta+1} - \frac{\bar{x}}{\theta^2} \Bigg] \\[6pt]
&= -n \Bigg[  \frac{2\theta + 1}{\theta(\theta+1)} - \frac{\bar{x}}{\theta^2} \Bigg] \\[6pt]
&= - \frac{n}{\theta^2} \Bigg[ \frac{(2\theta + 1)\theta}{\theta+1} - \bar{x} \Bigg], \\[6pt]
\frac{d^2 \ell_\mathbf{x}}{d \theta^2}(\theta)
&= -n \Bigg[ - \frac{1}{\theta^2} - \frac{1}{(\theta+1)^2} + \frac{2\bar{x}}{\theta^3} \Bigg] \\[6pt]
&= -n \Bigg[ - \frac{(\theta+1)^2 + \theta^2}{\theta^2 (\theta+1)^2} + \frac{2\bar{x}}{\theta^3} \Bigg] \\[6pt]
&= -n \Bigg[ - \frac{2 \theta^2 + 2 \theta + 1}{\theta^2 (\theta+1)^2} + \frac{2\bar{x}}{\theta^3} \Bigg] \\[6pt]
&= -n \Bigg[ \frac{(2\theta+1)(\theta+1) - \theta}{\theta^2 (\theta+1)^2} - \frac{2\bar{x}}{\theta^3} \Bigg] \\[6pt]
&= \frac{n}{\theta^3} \Bigg[ \frac{[(2\theta+1) - \theta]\theta}{\theta+1} - 2\bar{x} \Bigg] \\[6pt]
&= \frac{n}{\theta^3} \Bigg[ \frac{(2\theta+1) \theta}{\theta+1} - \bar{x} - \frac{\theta^2}{\theta+1} - \bar{x} \Bigg] \\[6pt]
&= - \frac{1}{\theta} \frac{d \ell_\mathbf{x}}{d \theta}(\theta) - \frac{n}{\theta^3} \Bigg( \frac{\theta^2}{\theta+1} + \bar{x} \Bigg). \\[6pt]
\end{aligned} \end{equation}$$
From this form, we see that at any critical point we must have:
$$\begin{equation} \begin{aligned}
\frac{d^2 \ell_\mathbf{x}}{d \theta^2}(\theta)
&= - \frac{n}{\theta^3} \Bigg( \frac{\theta^2}{\theta+1} + \bar{x} \Bigg) < 0. \\[6pt]
\end{aligned} \end{equation}$$
Since every critical point is a local maximum, this means that there is a unique critical point that is the MLE of the function.  Thus, the MLE is obtained by solving the equation:
$$\bar{x} = \frac{(2 \hat{\theta} + 1) \hat{\theta}}{\hat{\theta} + 1}
\quad \quad \quad \implies \quad \quad \quad 
2 \hat{\theta}^2 + \hat{\theta} (1-\bar{x}) - \bar{x} = 0.$$
This is a quadratic equation with explicit solution:
$$\hat{\theta} = \frac{1}{4} \Bigg[ \bar{x} - 1 + \sqrt{\bar{x}^2 + 6 \bar{x} + 1} \Bigg].$$
</s>