Consider a derivative of digital type which pays this kind of payoff at time $T$: \begin{align*} g(S_T,k) &= \begin{cases} P_0,~S_T>k \\ S_T, ~S_T\leq k \end{cases} \end{align*}
with $S_T$ being the current price of the underlying at maturity time $T$, $P_0$ the price of the underlying at the issue time 0 and $k$ - kind of the strike price with barrier feature.
Apparently, function $g$ is discontinuous at $S_T=k$ and has a jump there. The idea is to approximate it with a set options, call $c(S_T,k_1)$ and put $p(S_T,k_2)$ that have strikes: $k_1 < k < k_2$. Then, to construct a linear piece-wise function that will look as following: $$ \hat g(S_T,k_1,k_2)=a_0+a_1 S_T+a_2 c(S_T,k_1) + a_3 p(S_T,k_2). $$
The question is how to get the coefficients. Which complementary equations may be used?