I want to differentiate the following equation by taking $\log$ with respect to $\theta$.
$\log (\theta^{ a_H+\alpha-1}(1-\theta)^{a_T+\beta-1})$
and have the result of the differentiation as below:
$\theta=\dfrac{a_H+\alpha-1}{a_H+\alpha+a_T+\beta-2}$
I am trying to learn it but not really good at doing the steps of algebra. Step by step calculations would be appreciated.