Compute the partial derivatives in time and space separately, then use
df(t,Wt)=(ft(t,Wt)+21fxx(t,Wt))dt+fx(t,Wt)dWt.
The explicit time derivative and the second spatial derivative both affect drift. The first spatial derivative determines the instantaneous exposure to the Brownian shock.
Find the two drift terms and check the cancellation
There are three derivatives to put on the page. The time derivative accounts for the growth of the exponential prefactor at a fixed spatial point. The first spatial derivative is the coefficient of the Brownian move. The second spatial derivative is multiplied by one half because the Taylor term is quadratic, and by dt because [W]t=t. Here differentiating sine twice gives minus sine. The last observation is what makes the time and curvature terms cancel, even though the function explicitly depends on time.
For an original practice exercise, let
Yt=et/2sin(Wt) and compute its SDE. Then determine whether it is a
martingale over a finite horizon. Here
f(t,x)=et/2sinx, so
ft=21et/2sinx,fx=et/2cosx,fxx=−et/2sinx.
In the time derivative, hold x fixed. In both spatial derivatives, hold t fixed. Substitution gives
dYt=et/2cos(Wt)dWt.
The drift terms cancel exactly. Since the integrand is adapted and
E∫0Tescos2(Ws)ds≤eT−1<∞,
the stochastic integral is a true martingale on [0,T]. The bound matters because the zero-drift calculation alone supplies a local martingale when the stochastic integral is only locally square integrable.
Verify the result by conditioning on a Brownian increment
Suppose at time
s=1 the observed Brownian value is
Ws=π/6. Then
Ys=e1/2/2≈0.824. At time
t=2 the sine is applied to
π/6+Z, where
Z is independent
standard normal. The sine addition identity and symmetry give
E[sinZ]=0, while the Gaussian characteristic function gives
E[cosZ]=e−1/2. Hence the
conditional mean of
Y2 is
e⋅21e−1/2=e1/2/2, confirming the SDE argument.
As a check on the time derivative, replace
et/2 by
et. The new drift becomes
21etsin(Wt)dt and the cancellation disappears. Its unconditional
expectation is still zero by symmetry. The drift or conditional mean is needed to distinguish the two cases.
More generally, take Yt=eatsin(kWt) for constants a and k=0. The second spatial derivative multiplies the original function by −k2. The time derivative multiplies it by a. You can therefore choose a=k2/2 to build a family of martingales and confirm the cancellation without computing any conditional density.
References and next steps