Applying Ito To Geometric Brownian Motion I'm trying to understand the example problem on the Wikipedia page for Ito's Lemma and need it dumbed down a little bit.  
$$dS = S(\sigma dB + \mu dt)$$
$$ f(S) = log(S) $$
Given Ito's lemma, below:
$$
df(t, X_t) = (\frac{\partial f}{\partial t} + \mu_t \frac{\partial f}{\partial x} + \frac{1}{2} \frac{\partial ^2 f}{\partial x^2}) dt + \sigma_t \frac{\partial f}{\partial x} dB_t
$$ 
I don't understand where the first line of the result comes from:
$$d\log(S) = f'(S)dS + \frac{1}{2}f''(S)S^2 \sigma^2 dt$$
I can see that $$...\frac{1}{2} f''(S)S^2 \sigma ^2$$
Comes from 
$$...\frac{1}{2} \frac{\partial ^2 f}{\partial x^2}) dt$$
But everything else I can't make sense of.  I imagine there are some simple intermediate steps that I am not quite getting.  Any help with this would be greatly appreciated, I feel like I'm close to having Ito's lemma "click" or me.  
 A: Firsly we cannot apply Ito's lemma since $f(s):= \log s$ is not $C^2(\mathbb{R})$ (Wikipedia is unfortunately wrong on a lot of pages in stochastic analysis). It does turn out to give the correct answer anyway though.
What Wikipidea wants you to do is to apply it to $f(t,x) = \log x$. In this case $\partial_t f = 0$.
You should note that for a continuous local semimartingale $X_t= X_0 + M + B$ where $M$ is a martingale and $B$ is bounded variation, the notation $dX$ is shorthand for $dM + dB$ where the first is an Ito integral and the second is a Lebesgue-Stieljes integral. Using this shorthand, $\langle X\rangle_t = \langle M \rangle_t$ and so Ito's formula can be phrased as
$$
d f(t,X_t) = \partial_t f(t,X_t)dt + \partial_x f(t,X_t)dX_t + \frac{1}{2}\partial_{xx}f(t,X_t)d\langle X \rangle_t.
$$
This form is preferable because of its similarity to Taylor's formula.
In the case where $dM=R_tdW_t$ is is an integral with respect to brownian motion, so $d\langle M\rangle_t = R_t^2dt$, is is convenient to simplify further
$$
= \partial_t f(t,X_t)dt + \partial_x f(t,X_t)(R_tdW_t+dB_t) + \frac{1}{2}\partial_{xx}f(t,X_t)R_t^2dt
$$
$$
= (\partial_t f(t,X_t)+\frac12\partial_{xx}f(t,X_t)R_t^2)dt + \partial_x f(t,X_t)R_tdW_t + \partial_x f(t,X_t)dB_t.
$$
When $f$ does not depend on $t$, and $B$ is absolutely continuous w.r.t. the Lebesgue measure, i.e. $dB_t = b_tdt$ this simplifies even further to
$$
=(b_tf'(X_t)+\frac12f''(X_t)R_t^2)dt+ f'(X_t)R_tdW_t
$$
which is the form you were quoting.
Applying Ito's lemma blindly anyway we have
$$
d(\log S_t) = \frac{1}{S_t}dS_t + \frac12(\frac{-1}{S_t^2})d\langle S \rangle_t = \frac{1}{S_t}dS_t - \frac12 \sigma^2dt
$$
$$
 \sigma dB_t + \mu dt - \frac12 \sigma^2dt.
$$
Thus assuming $S_0=1$, $\log(S_t)-\log(S_0) = \log(S_t) =  \sigma B_t + (\mu-\sigma^2/2)t$
and hence
$$
S_t = \exp( \sigma B_t + (\mu-\sigma^2/2)t).
$$
To make this rigorous. We can start with that guess of $S_t$, and use $g(t,x)=e^{\sigma x+(\mu-\sigma^2/2)t}$ to apply Ito's formula and verify that $g(t,B_t)$ satisfies the original SDE.
