Most derivations of the Black-Scholes formula end up with the following dynamics of some (hedged) portfolio:
$$ \int_{t=0}^{T} \left(\frac{\partial f}{\partial \tau}(S(t),t)+\frac{1}{2}\cdot\frac{\partial^2 f}{\partial x^2}(S(t),t)\cdot\sigma^2\cdot S(t)^2\right) \,dt $$
From then, they argue that this process is locally riskless.
First Question: Since this integral can be defined as a pathwise Riemann integral, what stops me from definying it using right Riemann sums? In this case, I cannot see how it would be riskless at all.
Then, the authors declare this portfolio should earn the risk-free rate, so they get the following identity:
$$ \int_{t=0}^{T} \left(\frac{\partial f}{\partial \tau}(S(t),t)+\frac{1}{2}\cdot\frac{\partial^2 f}{\partial x^2}(S(t),t)\cdot\sigma^2\cdot S(t)^2\right) \,dt = \int_{t=0}^{T} \left(r\cdot\left(V(S(t),t)-\frac{\partial f}{\partial x}(S(t),t)\cdot S(t)\right)\right) \,dt $$
Fair enough. However, based on this, them they assume the expression within the integrals are equal at al times t.
Second Question: Why is this true?
Thank you.
EDIT: Attempt to answer Second Question: The identity actually is:
$$ \int_{t=0}^{\lambda} \left(\frac{\partial f}{\partial \tau}(S(t),t)+\frac{1}{2}\cdot\frac{\partial^2 f}{\partial x^2}(S(t),t)\cdot\sigma^2\cdot S(t)^2\right) \,dt = \int_{t=0}^{\lambda} \left(r\cdot\left(V(S(t),t)-\frac{\partial f}{\partial x}(S(t),t)\cdot S(t)\right)\right) \,dt $$
For all $0\leq \lambda \leq T$
So equality of functions within the parenthesis holds for all $0\leq t \leq T$.