The following is a summary of the derivation of the Black-Scholes equation as given on wikipedia (http://en.wikipedia.org/wiki/Black-Scholes_equation#Derivation) - I have a question regarding the assumption that the specified portfolio is self-financing.
We have a two asset market:
$dB_t = B_t r dt $
$dS_t = S_t (\mu dt + \sigma dW_t)$
We introduce a European option with price $v(t,S_t)$ at time $t$. We now consider a portfolio consisting of one option and -$\frac{\partial v}{ \partial S}$ stocks. Therefore if $X_t$ is our wealth at time $t$, we must have $X_t = v(t,S_t) - \frac{\partial v}{ \partial S} S_t$.
It is then claimed that we have $dX_t = dv(t,S_t) - \frac{\partial v}{ \partial S} dS_t$, as the portfolio is self-financing.
However, it seems to me that if we have a constant holding of 1 option in our portfolio, then the only way to make the overall portfolio self-financing is to have a constant holding of stock too (otherwise, if we increase/decrease our holding in stock, where do the extra funds for this come from?).
Typically, the way I have seen self-financing portfolios constructed is that the holding in 1 asset (for example, the risk-free asset) is not explicitly specified, and is determined by the self-financing condition (i.e. the condition that $X_t = \pi_t \cdot P_t$ and $dX_t = \pi_t \cdot dP_t$, where $\pi$ is the portfolio and $P_t$ is the price process - this gives a linear equation for the unspecified holding).
Based on the above, it seems that in order to have a self-financing portfolio where we hold a constant 1 option and $- \frac{\partial v}{ \partial S}$ shares, we must also have a dynamic holding in the risk-free asset which allows us to ensure that we can always have $- \frac{\partial v}{ \partial S}$ shares in our portfolio without injecting external funds (and thus breaking the self-financing condition). However, if we do have this holding of the risk-free asset in our portfolio as well, then our equation for the wealth process ($X_t = v(t,S_t) - \frac{\partial v}{ \partial S} S_t$) becomes incorrect, as we are not taking into account our holding in the risk-free asset.
In summary, I don't believe that the portfolio of 1 option and $-\frac{\partial v}{ \partial S}$ shares specified in the wikipedia derivation of the Black-Scholes equation is self-financing, but the derivation makes use of the fact that it [i]is[/i] self-financing. Am I missing something?
EDIT:
If the portfolio consisting of 1 option and $-\frac{\partial V}{\partial S}$ shares is self-financing, then we have the following:
$X_t = V(t,S_t) - \frac{\partial V}{\partial S}S_t$ (definition of wealth process)
$dX_t = dV(t,S_t) - \frac{\partial V}{\partial S}dS_t$ (as portfolio is assumed to be self-financing)
$dX_t = dV(t,S_t) - d(\frac{\partial V}{\partial S}S_t)$ (simply by definition of differentials)
Equating the RHS of the second and third equations above gives:
$dV(t,S_t) - \frac{\partial V}{\partial S}dS_t = dV(t,S_t) - d(\frac{\partial V}{\partial S}S_t)$
So $\frac{\partial V}{\partial S}dS_t = d(\frac{\partial V}{\partial S}S_t)$.
Using Ito's lemma on the RHS gives: $\frac{\partial V}{\partial S}dS_t = d(\frac{\partial V}{\partial S})S_t + \frac{\partial V}{\partial S}dS_t + d<\frac{\partial V}{\partial S},S>_t$.
And so $d(\frac{\partial V}{\partial S})S_t + d<\frac{\partial V}{\partial S},S>_t = 0$. (*)
Now, $d(\frac{\partial V}{\partial S}) = \frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}d<S>_t$.
Therefore $d<\frac{\partial V}{\partial S},S>_t = \frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt$.
Plugging these into (*) gives:
$\frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}d<S>_t + \frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt = 0$.
Therefore $\frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}\sigma^2 S_t^2 dt + \frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt = 0$.
The cofficient of $dS_t$ must be zero, so $\frac{\partial^2 V}{\partial S^2} = 0$, so $V(t, S) = f(t) + Sg(t)$. We could stop at this point, because we know that we can't satisfy the boundary condition $v(T,S) = \max(0,S-K)$, and therefore our assumption that we could hedge an option with a self-financing portfolio consisting of 1 option and $-\frac{\partial V}{\partial S}$ shares is wrong.
However, note that the coefficient of $dt$ must also be zero, and since we already have $\frac{\partial^2 V}{\partial S^2} = 0$, this gives $\frac{\partial^2 V}{\partial S \partial t} = 0$. Since $V(t, S) = f(t) + Sg(t)$, this implies that $g$ is constant. Therefore $\frac{\partial V}{\partial S}$ is constant, as I claimed in the comments below - i.e. in order for this to be a self-financing portfolio at all, the holding in the stock must be constant.