# SDE linear combination of stock price

Assume that $$X_t$$ is a process with dynamics $$dX_t = \sigma X_t dW_t$$ is where $$W_t$$ is a standard Brownian motion. Given two deterministic functions $$p(t)$$ and $$q(t)$$, compute $$\mathbb{E}[p(t)X(t)+q(t)]$$.

Solution

Since $$p$$ and $$q$$ are deterministic we have $$\mathbb{E}[p(t)X(t)+q(t)] = p(t) \mathbb{E}[X(t)]+q(t)=p(t)X_0+q(t)$$ where the last equation from the fact that $$X_t$$ is a martingale. To be more precise, $$\mathbb{E}[X(t)|X_0]=X_0$$.

SDE dynamics

I want to derive the SDE for $$p(t)X(t)+q(t)$$ using Ito's lemma. First, I am considering the case $$V(t)=p(t)X(t)$$, then according to Ito's lemma: \begin{align} dV_t&=\frac{\partial p}{\partial t}X_tdt+p(t)\sigma X_tdW_t \\ &=\frac{1}{p(t)}\frac{\partial p}{\partial t}V_tdt+\sigma V_tdW_t \end{align} The SDE that remains is quite straightforward to solve then with solution: $$V(t) = V(0)\exp \left \{ \left(\frac{1}{p(t)}\frac{\partial p}{\partial t} - \frac{\sigma^2}{2}\right)T + \sigma W_t\right \}$$ This will give a different answer for $$\mathbb{E}[p(t)X(t)]$$, so I am wondering where my mistake is.

Let's just write $$p'(t)$$ for $$\frac{\partial p}{\partial t}$$. Then your last expression for $$V$$ should rather be $$V(t)=V(0)\exp\Bigg\{\int_0^t\frac{p'(s)}{p(s)}\,ds-\frac{\sigma^2}{2}\color{red}{t}+\sigma W_t\Bigg\}.$$ This gives \begin{align} E[V(t)]&=V(0)\exp\Bigg\{\int_0^t\frac{p'(s)}{p(s)}\,ds\Bigg\}\\[3mm] &=V(0)\exp\Bigg\{\int_0^t\frac{d}{ds}\log p(s)\,ds\Bigg\}\\[3mm] &=V(0)\exp\{\log p(t)-\log p(0)\}\\[3mm] &=\frac{V(0)p(t)}{p(0)}=X(0)p(t) \end{align} as it should.