I would like to obtain $g$ by solving the following integral equation

$$ \int_s^T R(u) dg(u) + f(s,T)\int_s^T g(u)du =0$$

where $f,R:\mathbb R _+ ^*\rightarrow \mathbb R _+ $and $g: \mathbb R _+ \rightarrow[0,1]$ is

- non-decreasing continuous function,
- $g(0)=1$,
- $g(T)<1$
- $\lim _{s\to \infty}g(s)=0$.

One can think about g as being such that $g= 1- F$ where $F$ is the law of an absolute continuous random variable.

If we assume that $g$ is differentiable then we have

$$ \int_s^T \left(f(s,T)g(u)+R(u) g'(u)\right) ~du =0, \quad \forall s \in [0,T] $$

So I am tempted to conclude that

$$ f(s,T)g(u)+R(u) g'(u)=0, \quad \forall u \in [s,T]$$ therefore $$g(s) = \exp\left(-\int _0^s \frac{f(\tau,T)}{R(\tau)}~d\tau\right), \quad \forall u \in [0,T]$$

Is my approach correct or have I made a mistake when I assumed that the integrand is zero as the integral is zero for each $s$ ?

I have no restrictions on $f$ and $R$ for the moment so we can assume any necessary condition about $f$ as necessary to solve it.

Could anybody give me an opinion please? Please leave a comment. All advices are appreciated.

**Edit**

A friend wisely advised me to take a look at Volterra integral equation which is exactly what we have here after integrating by parts the first integral and inverting the time as follows ( after that point I use the notation abuse $R(u): =R(-u), g(u):=g(-u) \text{ and } f(t,T) = f(-t,T) $):

$$g(t) = \alpha + \int_{-T }^t K_T(t,u))g(u) du $$

where $\alpha := (Rg)(-T)$ and $$K_T(t,u):=\frac{R'(u) + f(t,T)}{R(t)}$$

**Second part**

Actually all the previous part of this question was a preliminary to my true problem. I was strugling in that previous case and would like to know iff there was a way to have a closed form solution to that.

My ambition was to understand better the previous case in order to adapt it to the case where $\left(f(t,T)\right)_{t \in [0,T]}$ with known dynamic .

Then I started to think about a numeric approach to solve this Voltera integral equation if a stochastic Kernel but a first problem that comes to my mind is that it anticipate the value of $f$.

Many thanks

I posted this question some days ago at mathexchange