Stock-inversion reflection for the Black-Scholes equation (source code)

= Stock-inversion reflection for the Black-Scholes equation
{title2=$W(t,S)=(S/B)^{1-2r/\sigma^2}V(t,B^2/S)$}

Differentiating the displayed transformation shows that it preserves the <Black-Scholes equation>. The first derivative coefficient fixes the exponent $1-2r/\sigma^2$, which also makes the zero-order coefficient correct. Subtracting this reflected image of a <European call option> from the call itself enforces a zero boundary at $S=B$. For <strike price> $K\geq B$, the reflected maturity <contingent claim payoff> vanishes on $S>B$, giving the no-rebate <down-and-out option> formula. Prices using this reflection are conditional on the barrier not having been hit already.