Let $X = (X_1, X_2,...,X_k) \sim \text{Multinomial}(n, \theta)$ on $k$ elements (i.e. each $X_i$ is the count of the element $i$ on $n$ trials). Let $\theta \sim \text{Dirichlet}(\alpha)$, where $\alpha = (\alpha_1, \alpha_2, ..., \alpha_k)$. I'm trying to derive the MAP estimate $\hat \theta_{MAP}$ for $\theta$.
My attempt:
By Bayes' theorem, $P(\theta | x) = \frac{\mathcal{L}(\theta) \pi(\theta)}{P(x)}$, where $\mathcal{L}(\theta)$ is the likelihood, $\pi(\theta)$ is the prior and $P(x)$ is the evidence. The MAP is the argmax of this expression (we can drop this since it doesn't depend on $\theta$). Replacing the definitions of the model's likelihood and prior, we get
$$ \hat \theta_{MAP} = \arg\max\big( \frac{\Gamma(\sum_i x_i + 1)}{\prod_i \Gamma(x_i+1)} \prod_{i=1}^k \theta_i^{x_i} \frac{\prod_{i=1}^K \Gamma(\alpha_i)}{\Gamma\bigl(\sum_{i=1}^K \alpha_i\bigr)} \prod_{i=1}^k \theta_i^{\alpha_i - 1} \big) $$
Dropping the terms that don't depend on $\theta$, we get
$$ \hat\theta_{MAP} = \arg\max\big( \prod_{i=1}^k \theta_i^{x_i} \prod_{i=1}^k \theta_i^{\alpha_i - 1} \big) \\ = \arg\max\big( \prod_{i=1}^k \theta_i^{x_i + \alpha_i - 1}\big) $$
Applying the logarithm:
$$ \hat\theta_{MAP} = \arg\max\big(\log\big( \prod_{i=1}^k \theta_i^{x_i + \alpha_i - 1}\big)\big)\\ =\arg\max\big(\sum_{i=1}^k \log \big(\theta_i^{x_i + \alpha_i - 1}\big)\big) \\ =\arg\max\big(\sum_{i=1}^k (x_i + \alpha_i - 1)\log \big(\theta_i\big)\big) $$
Deriving with respect to $\theta_i$ and equating to $0$: $$ 0 = \frac{\partial}{\partial \theta_i} \big(\sum_{i=1}^k (x_i + \alpha_i - 1)\log \big(\theta_i\big)\big) \\ = \sum_{i=1}^k \frac{(x_i + \alpha_i - 1)}{\theta_i} $$
And here I'm stuck since $\theta_i$ cancels. Where is my error?