Solution (source code)

= Solution

Assume a positive barrier $B\le K<S_0$. Under the zero-rate risk-neutral <Black-Scholes model>, $X_t=\log(S_t/B)$ starts at $x=\log(S_0/B)>0$ and is <Brownian motion> with variance rate $\sigma^2$ and drift $\mu=-\sigma^2/2$. The drifted transition density killed at zero is
$$
p^{\rm kill}(t,x,y)=p_\mu(t,y-x)
-e^{-2\mu x/\sigma^2}p_\mu(t,y+x),\qquad y>0.
$$
To see the factor, multiply the zero-drift reflected Gaussian difference by $\exp[\mu(y-x)/\sigma^2-\mu^2t/(2\sigma^2)]$; its second term is the ordinary drifted Gaussian from starting point $-x$ times $e^{-2\mu x/\sigma^2}$.

Integrate the payoff $(Be^y-K)_+$ against this density. The first term is $C(S_0,K)$. Since $K\ge B$, the payoff is zero for $y\le0$, so the second integral may be extended to all real $y$ and equals the ordinary call price from reflected spot $Be^{-x}=B^2/S_0$. The reflection weight is $e^x=S_0/B$. Thus the <down-and-out European call> value is
$$
\boxed{C(S_0,K)-\frac{S_0}{B}C(B^2/S_0,K)}.
$$
This assumes <continuous> monitoring and knock-out on first hitting, with no rebate.