This is an extension of a previous post I made linked below
Dirac delta-esque integral over vertically shifted and scaled step function
This time, consider again the same step function $$ S(x)=\begin{cases} m_1 & x<a \\ m_2 & x\ge a \end{cases} $$ and the additional new step function $$ H(x)=\begin{cases} C & x<a \\ 0 & x\ge a \end{cases} $$ where $C$ and $a$ are real strictly positive constants.
I am now interested in the integral of the form $$ \int_{x}^{\infty}\frac{S'(t)}{S(t)}H(t)f(t)dt $$ for arbitrary continuous function $f$. Since $H$ is discontinuous at $a$, the method used in the previous post will not work. My attempt at solving this was first to express $H$ in terms of $S$ as $$ H(x)=\frac{C}{m_1-m_2}\Bigg(S(x)-m_2\Bigg) $$ then, substitution into the integral yields $$ \frac{C}{m_1-m_2}\int_x^{\infty}S'(t)\Bigg(1-\frac{m_2}{S(t)}\Bigg)f(t)dt $$ which can be split into two integrals: $$ \frac{C}{m_1-m_2}\Bigg[\int_x^{\infty}S'(t)f(t)dt-m_2\int_x^{\infty}\frac{S'(t)}{S(t)}f(t)dt\Bigg] $$ Since $S'(t)$ is a delta function, the first integral becomes $$ \int_x^{\infty}S'(t)f(t)dt=f(a)(m_2-m_1); \ \ x<a $$ and $0$ otherwise, while the second integral using the methodology from the last post becomes $$ \int_x^{\infty}\frac{S'(t)}{S(t)}f(t)dt=f(a)\int_x^{\infty}\frac{d}{dt}\ln S(t)dt=f(a)\ln\frac{m_2}{m_1}; \ \ x<a $$ Altogether, the answer I get is $$ -Cf(a)\Bigg(1+\frac{m_2}{m_1-m_2}\ln\frac{m_2}{m_1}\Bigg); \ \ x<a $$ I have tested this numerically with functions approximating arbitrarily steep step functions and the answer seems correct, but it is off be enough for me to be suspicious the discrepancy is more than just numerics and there is actually something wrong here. Is there anything glaringly wrong about the above process I used? Any help is greatly appreciated.