# Solve Textbook Exercises

#### Compute the expected value of the product of two integrals and , where is the standard WienerProcess[].

 In[1]:= Xpr = ItoProcess[{\[DifferentialD]x[t] == w[t] \[DifferentialD]t, \[DifferentialD]y[t] == t w[t] \[DifferentialD]t}, {x[t], y[t]}, {{x, y}, {0, 0}}, t, w \[Distributed] WienerProcess[]];
 In[2]:= XExpectation[ Subscript[\[ScriptCapitalI], 1][1] Subscript[\[ScriptCapitalI], 2][ 1], {Subscript[\[ScriptCapitalI], 1], Subscript[\[ScriptCapitalI], 2]} \[Distributed] pr]
 Out[2]=

#### Compare with an alternative computation.

 In[3]:= XIntegrate[ Expectation[t w[t] w[s], w \[Distributed] WienerProcess[]], {t, 0, 1}, {s, 0, 1}]
 Out[3]=

#### Using the Ito formula, verify that the process is a martingale with respect to the filtration generated by the Wiener process .

 In[4]:= Xx\[ScriptCapitalP] = ItoProcess[{0, 1, (w[t] + t) Exp[-t/2 - w[t]]}, {w, 0}, t]
 Out[4]=

#### Apply the Ito formula by converting the process to its standard form. The diffusion coefficient of the standard Ito process must be zero for to be a martingale.

 In[5]:= XItoProcess[x\[ScriptCapitalP]]
 Out[5]=

#### Prove the martingale property directly.

 In[6]:= XExpectation[(w[t] + t) Exp[-w[t] - t/2] \[Conditioned] w[s] == ws, w \[Distributed] WienerProcess[], Assumptions -> 0 < s < t]
 Out[6]=