Differentiation Fundamentals for Finite Difference Methods
Before we can tackle FDM and crack open the Black-Scholes PDE numerically, we need to get our differentiation fundamentals straight — so let's run through it.
Quick recap of where we’ve been so far. We learned option pricing via Black-Scholes in a totally half-assed way, and one of the 6 assumptions baked into that model was constant volatility.
So — what number do we plug in for that “constant”? Reasonable question. That got us into historical volatility, which is simple, and honestly… not unreasonable? “The present is just history on repeat” and all that. But it also feels like it can’t really capture the options that are actually trading out there in the wild.
So people went, “OK fine — let’s just back out the volatility that real-world option prices are implying.” And boom, implied volatility.
But the BS formula isn’t exactly the kind of expression you can flip inside out and pull a clean inverse from. So instead of grinding through it by hand, we hand it to a computer. And then — OK, how do we make the computer do it? — and that’s where Bisection, Weighted Bisection, and Newton-Raphson came in.
(After implied vol, the proper next step would be volatility models — EWMA, ARCH, GARCH(1,1), the whole crew. But this is a financial engineering programming class, so we’re skipping them.)
(I’ll do a separate post on those guys later.)
OK. Stepping away from volatility for now. Let’s go back to where we started — back to the Black-Scholes PDE used in the derivative-valuation work associated with the 1997 economics prize to Robert Merton and Myron Scholes. The prize was for their work, not an award handed to a PDE itself!

Here $f$ is the value of a portfolio, but for our purposes we’re treating it as the value of an option.
And notice — that “value” function is being partial-differentiated with respect to valuation time $t$ (the expiry is $T$), and with respect to the underlying $S$, and so on. So yeah, we can comfortably think of $f$ as a function of two variables: $t$ and $S$.
Right. So the goal, starting from this chapter, is:
Find $f(t, S)$!!!!!!
But wait… didn’t we just use an analytic Black-Scholes formula? Yep — for the standard European payoff and the model assumptions, we did!
A PDE is not automatically unsolvable. Different payoffs, exercise conditions or coefficients can make a convenient closed-form answer unavailable. A numerical method lets us work on such a problem with its terminal payoff and boundary conditions.
The physics detour I had in mind was the Schrödinger equation. Hydrogen gives us an analytically solvable model, but helium is already a much nastier business… not merely because it has two protons: the interaction between its two electrons is the key extra difficulty. That’s why methods such as WKB and perturbation theory join the toolbox — all sorts of clever tricks, lol.
The heat equation is another familiar PDE, involving time and position. Depending on the boundaries, coefficients and geometry, it too can send us looking for approximations or numerical methods. That’s the cross-disciplinary connection I was reaching for, rather than proof that every Schrödinger, heat or Black–Scholes equation has no analytic solution.
So we cheat. With a numerical trick called FDM (Finite Difference Method).
Now — before we touch FDM, we need to sharpen our concept of differentiation just a tiny bit. I’m not a math tutor so this might be a little rough, but let’s run through it once.

When you’re staring at some function, there’s a bunch of stuff you want to get a handle on, and one of the most important — maybe the most important — is the slope.
If $f(t)$ is, say, your “grades” as a function of time $t$, then sure — the actual grade value $f(t)$ matters. But $df(t)/dt$ — the rate of change of your grade per unit time — that’s also pretty critical info if you’re trying to actually grasp what’s going on.
So the slope ends up being a big deal in lots of situations… yeah, yeah, yeah.
Now — slope between two points is fine, but what’s really meaningful is the derivative — the instantaneous slope at a point.
The instantaneous slope at some point $x = a$ — once you’ve learned $\lim$ in high school and you wield that limit concept —


— gets defined like this, right??? The reason I’m dragging us through this baby definition again is because there’s a question worth raising: “does the derivative at $x = a$ have to be that one?????”
OK so we want the derivative at the point $(a, f(a))$. In the standard story, you grab a point $h$ to the right —

— and look at the slope between $(a+h, f(a+h))$ and $(a, f(a))$, which gives you

— and that’s the slope of the red line, and then you take $h \to 0$ —


— and there’s your derivative. Classic high-school flow.
But — like I said — does it have to be that?
What if instead I do this:

Define the blue point as $(a-h, f(a-h))$, take the slope of the blue line —

— this one — and then send $h \to 0$ —

— and call it a day. Honestly? Nothing wrong with that either.
(If the derivative exists, the right- and left-hand limits of these difference quotients agree. If they disagree, there is no ordinary derivative at that point.)
The point I’m hammering: differentiating at $x = a$ — you can do it this way, or you can do it that way. Heh.
Aaaand… it doesn’t even stop there.
“Hey~~~ you two, I’m just gonna combine both of your methods and define it like this~~~ ^^^^”
And then if someone draws this picture and writes the expression below like this:

At a differentiable point, this symmetric quotient also tends to the same derivative… (cry)(cry)(cry) But the symmetric limit alone does not prove differentiability: for $f(x)=|x|$ at zero it is 0, while the one-sided derivatives are -1 and +1.
For a smooth function, all three approach the same derivative… (cry)(cry)(cry)
These are three common finite-difference stencils, among many possible choices.
(High school teaches this same way too, by the way.)

But — unfortunately — in numerical analysis, there is no way to actually… do that $h \to 0$ thing from math class.
So instead, we approximate the derivative.

Approximation looks like this…
Ah, but that’s approximating the derivative at a point. If we shift to talking about the derivative function:

Writing it like this is fine for a sufficiently smooth function. A smaller $\Delta x$ reduces truncation error, but making it too tiny can amplify floating-point cancellation and roundoff; smaller is not always better.
Ah but — the whole reason we pulled out the differentiation concept up there —

— was to approximate the partial derivative of $f(x,t)$ in this Black-Scholes PDE with respect to $t$ at each position, the partial with respect to $S$, the second partial with respect to $S$, all that stuff, right???
So:
Writing it in this scrappy way will do the trick.

The variable $t$ shows up, but since it’s a partial derivative, $t$ is being held fixed in the formula.
But — as you can see in the BS PDE — there’s also a second partial with respect to $S$. We need to express that too.
For the second derivative, forward and backward stencils are valid too. For example, $[f(a+2h)-2f(a+h)+f(a)]/h^2$ approximates $f''(a)$ with first-order error for a smooth function. Here we’ll use the symmetric central stencil, which has second-order truncation error; it is a convenient choice, not the only possible one.
So, the second derivative is — the measure of ~~how much does the slope change at $x = a$~~ —


— the instantaneous slope at $x = a$ goes from the slope of the blue line (backward) to the slope of the red line (forward).
That feels like the natural way to phrase it.
Therefore,

OK — this approximation-of-derivatives detour ran way longer than I planned. I was going to push into Explicit FDM in this post, but……
Ahhh……… pushing it to the next post.
Starting from the next post, we’ll get into Explicit FDM properly.
Questions or corrections?
Did a step lose you, or does a number look off? Email me or use the contact page. Include the note title and the step or figure you mean.
Feedback goes to me privately by email; it is not posted as a public comment.