Thursday, April 19, 2007

Transforming the Black-Scholes equation into the Heat equation

(∂V/∂t) + ½ σ2 S2 (∂2V/∂S2) + r S (∂V/∂S) - rV = 0

First substitution: u = V e-rt

V = u ert

(∂u/∂t) = (∂V/∂t) e-rt - V r e-rt

(∂u/∂t) + V r e-rt = (∂V/∂t) e-rt

(∂V/∂t) = ert (∂u/∂t) + V r = ert (∂u/∂t) + r u ert

(∂u/∂S) = e-rt (∂V/∂S)

(∂V/∂S) = ert (∂u/∂S)

(∂2V/∂S2) = ert (∂2u/∂S2)

And the equation changes to...

ert (∂u/∂t) + r u ert + ½ σ2 S2 ert (∂2u/∂S2) + r S ert (∂u/∂S) - r ert u = 0

(∂u/∂t) + ½ σ2 S2 (∂2u/∂S2) + r S (∂u/∂S) = 0

Second substitution: S = ex

x = ln S

(∂S/∂x) = ex
(∂x/∂S) = 1 / S

(∂u/∂x) = (∂u/∂S) (∂S/∂x) = (∂u/∂S) ex = S (∂u/∂S)

S2 (∂2u/∂S2) = S2 ∂/∂S (∂u/∂S)

= S2 (∂x/∂S) ∂/∂x (∂u/∂S)

= S2 (1/S) ∂/∂x (1/S ∂u/∂x)

= S [ 1/S ∂2u/∂x2 + ∂u/∂x ∂/∂x (1/S) ]

= ∂2u/∂x2 + S (∂u/∂x) (-1/S2 ∂S/∂x)

= ∂2u/∂x2 - (1/S) ex (∂u/∂x)

= ∂2u/∂x2 - ∂u/∂x

And the equation changes to...

(∂u/∂t) + ½ σ2 (∂2u/∂x2 - ∂u/∂x) + r (∂u/∂x) = 0

(∂u/∂t) + ½ σ22u/∂x2 + (r - ½σ2) ∂u/∂x = 0

Third substitution: z = x - (r - ½σ2)t to cancel the first derivative term, and t' = - t to conform to the usual sign convention.

(∂u/∂t) = (∂u/∂z)(∂z/∂t) + (∂u/∂t')(∂t'/∂t) = (∂u/∂z)[-(r - ½σ2)] + (∂u/∂t')(-1)

∂u/∂x = ∂u/∂z

2u/∂x2 = ∂2u/∂z2
And the equation changes to (dropping the ' on the t variable) ...

- (∂u/∂t) - (r - ½σ2) (∂u/∂z) + ½σ2 (∂2u/∂z2) + (r - ½σ2) (∂u/∂z) = 0

- (∂u/∂t) + ½σ2 (∂2u/∂z2) = 0

And finally, voila, we have the heat equation...

∂u/∂t = ½σ2 (∂2u/∂z2)

6 comments:

Anonymous said...

Hi Alberto,
coming from Science and being new in finance, I studied with great interest your BS-to-heat derivation on your blog:
http://financeinvestments.blogspot.com/search?q=black-scholes+heat

May I ask you two questions?
For the second substitution S = exp(x), I don't understand the following step yielding line 7 after 'Second substitution':S^2(1/S)d/dx(1/S du/dS): shouldn't the last dS be a dx? Didn't you just substitute in the formula before du/dS with 1/S du/dx?

Second question: How do you get from this line 7 to line 8: using the product formula (fg)' = f'g + fg'?

Thanks for your kind help.
Best regards,
Chris

ALD said...

Chris,

1. You are correct of course.

From an earlier step du/dx = S du/dS; therefore du/dS = 1/S du/dx is the correct substitution in step 7 (those should all be partial derivatives).

I have corrected the post; thanks for pointing out the error.

2. Yes, the next step is the product formula

d/dx(1/S du/dx) = 1/S d/dx(du/dx) + d/dx(1/S) du/dx where again all derivatives should be partial.

3. Thank you for reading and commenting on this post; it was one of the more interesting things (to me) that I have posted here. I was very surprised that this derivation was not available anywhere on the web (that I could find anyway).

Regards,
Alberto

Dimin said...

Hi Alberto,

I have a quick question about the last step. Should it be du/dt=du/dz*dz/dt+du/dt'*dt'/dt? You wrote du/dt' in the left hand side which confuses me a little bit.

Also, in the last equation, why can you just drop the ' from the t'? Do you have to put a negative sign to transform from t' to t?

Thank you! The derivation is very helpful.

Best regards,
Dimin

ALD said...

Thank you for your interest in my post and for taking the time to comment.

In your first question, you are of course correct. The t' rather than t was a typo, which has been corrected in the post.

Regarding your second question, the change from t' to t is not a transformation. Rather, it is simply a change in variable name. There are no more occurrences of t. Therefore, renaming t' to t removes some clutter. I could have used w or anything else, but t puts the heat equation in its conventional format.

Coolman said...

Hi, thank you for a very consise derivation. There is one thing I dont get. It is the third substitution.

What confuses me is this point (∂u/∂t) = (∂u/∂z)(∂z/∂t) + (∂u/∂t')(∂t'/∂t).
How do we get to (∂u/∂t')(∂t'/∂t)?
I know that it is a kind of multivariate chain rule but I still can't put it together with the trick t'=-t.

Please explain as for dummies. I'm sure more people dont understand that point.
Thanks!

Unknown said...

very useful derivation..quite helpful it is! I am also new in finance.Can any one tell me the matlab coding of black schole to heat equation for finding the option price.Please tell me