I've been studying stochastic calculus on my own for a while and stumped on some things that I don't fully understand:
Let's start with the geometric brownian motion:
\begin{align} dS_t = \mu S_t dt + \sigma S_t dW_t \end{align}
To solve it for $S_t$ I need to find an equation $f(t,S_t)$ that works with the Itô's Lemma:
\begin{align} df(t,S_t) = \frac{\partial}{\partial t}f(t,S_t)\,dt +\frac{\partial}{\partial S}f(t,S_t)\,dS_t + \frac{1}{2}\frac{\partial^2}{\partial S^2}f(t,S)\,(dS_t)^2 \end{align}
At every place that I look I see that $f(t,S_t) = log(S_t)$, but I don't understand why. Is this just an ansatz?
If I change my SDE to a more generalized short rate model:
\begin{align} dS_t = (\alpha + \beta S_t) dt + \sigma S_t^\gamma dW_t \end{align}
I'll need to find another ansatz? And if I find a function $f(t,S_t)$ that works, I can simply do some algebra and get an expression for $S_t$?