# Option pricing with definite integral

I would like to consider a slight generalisation of this question, which I recall here:

At date of maturity $$T_2$$ the holder of a financial contract will obtain the amount: $$\frac{1}{T_2−T_1}\int^{T_2}_{T_1}S(u)du$$ where $$T_1$$ is some time point before $$T_2$$. Determine the arbitrage free price of the contract at time $$t$$. Assume you live in a Black-Scholes world and that $$t.

Let's call $$Z(t)$$ the following quantity: $$Z(t)=\int_{T_1}^t S(u)du,$$ defined only for $$t>T_1$$, otherwise $$Z(t)=0$$.

The price of the derivative should be a function of the form $$F(t,S(t),Z(t))$$.

I would like to dfind the Black-Scholes equation for this derivative.

### Attempt

In the Black-Scholes world, we can use a bond and a stock of shares to replicate our derivative. The prices of the bond $$B$$ and the stock $$S$$ follow respectively these stochastic processes: \begin{align} dB &= rBdt \\ dS &= \alpha Sdt + \sigma SdW. \end{align} The payoff follows the process: $$dZ = Sdt$$ only for $$t>T_1$$, otherwise $$Z$$ is zero.

To replicate the derivative, we set up a portfolio $$V$$ whose relative weights are $$u_B$$ for the bond and $$u_S$$ for the stock.

The stochastic process for the price of the portfolio is: $$dV = V\left(u_B r + u_S \alpha\right)dt + u_S \sigma V dW.$$ The stochastic process for the option price is, from Ito's lemma: $$dF = \left(F_t + \alpha S F_S + S F_Z + \frac12 \sigma^2S^2 F_{SS}\right)dt + \sigma S F_S dW.$$ Since $$V$$ is a replicating portfolio, it must follow the same stochastic process as $$F$$, so we can solve for the relative weights of bond and stock: \begin{align} u_S &= \frac{S F_S}{F} \\ u_B &= \frac{F_t + SF_Z + \frac12 \sigma^2 S^2 F_{SS}}{rF}. \end{align} Imposing the obvious constraint $$u_B + u_S = 1$$, we get the Black-Scholes equation for this derivative: $$F_t + rs F_s + H(t-T_1) sF_z + \frac12 \sigma^2s^2F_{ss} - rF = 0,$$ where $$H(t-T_1)$$ is the unit step which is zero for $$t and one for $$t>T_1$$.

### Question

1. Is the equation above correct?
2. If so, how does one solve it? The step function does not seem a big deal, as one can solve the equation with the term $$sF_Z$$ in the interval $$[T_1,T_2]$$, and without it in the interval $$[t,T_1]$$. I am more concerned by the derivative $$F_Z$$ itself, as this would be solved trivially by separation of variables: $$F(t,s,z)=A(t,s)\cdot(mz+q)$$, $$m$$ and $$q$$ deterministic constants, but maybe the equation for $$F$$ should be recast as an integro-differential equation in the variables $$(t,s)$$ only?