Consider the SDE $$ dS(t) = rS(t)dt + \sigma dW(t). $$ To solve this, I let $f(t,x) = xe^{-rt}$, so $\frac{\partial f}{\partial t} = -rxe^{-rt}$, $\frac{\partial f}{\partial x} = e^{-rt}$ and $\frac{\partial^2 f}{\partial x^2} = 0$. Using Ito's lemma I get \begin{align*} df(t,S(t)) & = -rS(t)e^{-rt}dt + e^{-rt}dS(t) \\ & = -rS(t)e^{-rt}dt + e^{-rt}[rS(t)dt + \sigma dW(t)] \\ & = e^{-rt}\sigma dW(t). \end{align*} Then \begin{align*} f(t,S(t)) & = f(0,S(0)) + \sigma \int_0^t e^{-rs} dW(s) \\ & = S(0) + \sigma \int_0^t e^{-rs} dW(s) \\ & = S(t)e^{-rt} \\ & \implies S(t) = S(0)e^{rt} + \sigma e^{rt} \int_0^t e^{-rs} dW(s). \end{align*}
I now want to check my solution by differentiating $S(t)$ and verifying I obtain the original SDE, but I'm unsure how to treat the stochastic integral term when using Ito's lemma. Specifically, I'd like to write a "dummy" function $f$ as I did for the SDE (I find this makes applying Ito's lemma more clear), but my best guess is $f(t,x) = S(0)e^{rt} + \sigma e^{rt} \int_0^t e^{-rs} dx$. It is not clear to me what $\frac{\partial f}{\partial t}$, $\frac{\partial f}{\partial x}$ or $\frac{\partial^2 f}{\partial x^2}$ should be. Thanks!