In this problem your unknown parameter $\theta$ only has two possible values, so you have a discrete optimisation where you just have to compare the likelihood at those two parameter values. (If you are taking derivatives of something in a discrete optimisation then you are going down the wrong track.) For an observed data vector $\mathbf{x}$ you have:
$$L_\mathbf{x}(\theta) = \begin{cases}
(2 \pi)^{-n/2} \exp(-\tfrac{1}{2} \sum x_i^2) & & \text{for } \theta = 1, \\[6pt]
\pi^{-n} / \prod (1+x_i^2) & & \text{for } \theta = 2. \\
\end{cases}$$
Since there are only two possible parameter values, you can find the maximising parameter value by looking at the sign of the difference in likelihood at these values. You have:
$$\begin{equation} \begin{aligned}
\Delta(\mathbf{x}) \equiv \text{sgn}(L_\mathbf{x}(1)-L_\mathbf{x}(2))
&= \text{sgn}\Bigg( (2 \pi)^{-n/2} \exp(-\tfrac{1}{2} \sum x_i^2) - \frac{1}{\pi^{n} \prod (1+x_i^2)} \Bigg) \\[6pt]
&= \text{sgn}\Bigg( \exp(-\tfrac{1}{2} \sum x_i^2)\prod (1+x_i^2) - \Bigg( \frac{2}{\pi} \Bigg)^{n/2} \Bigg). \\[6pt]
\end{aligned} \end{equation}$$
The maximum-likelihood-estimator (MLE) is:
$$\hat{\theta} = \begin{cases}
2 & & \text{if } \Delta(\mathbf{x}) = -1, \\[6pt]
\{ 1,2 \} & & \text{if } \Delta(\mathbf{x}) = 0, \\[6pt]
1 & & \text{if } \Delta(\mathbf{x}) = 1. \\[6pt]
\end{cases}$$
(In the case where $\Delta(\mathbf{x}) = 0$ the MLE is non-unique since the likelihood is the same at both parameter values.)
self-study
tag and read it's wiki. $\endgroup$self-study
tag. I also noticed that you typed out the question, which I originally posted as a screenshot. Is that what I should always do? $\endgroup$