I want to know the calculation of marginal filtering distribution and smoothing distribution from the joint distribution. For example, define the $x_t$ as the hidden variable in $t$-th step and $y_t$ as the observation.
Joint filtering distribution: \begin{equation} p\left(x_{1: t} \mid y_{1: t}\right) \propto \mu\left(x_1\right) \prod_{k=2}^t f\left(x_k \mid x_{k-1}\right) \prod_{k=1}^t g\left(y_k \mid x_k\right) \end{equation} and the marginal distribution that marginalize the $x_{1:t-1}$: \begin{equation}p\left(x_{t} \mid y_{1: t}\right) \propto f\left(x_t \mid x_{t-1}\right)g\left(y_t \mid x_t\right) p\left(x_{t-1} \mid y_{1: t-1}\right).\end{equation}
How to derive the second formula with marginalization from the first one? Although it is obvious that we can directly derive the second formula.
Similarly, the smoothing joint distribution is: \begin{aligned} p\left(x_{1: T} \mid y_{1: T}\right) & =p\left(x_T \mid y_{1: T}\right) \prod_{n=1}^{T-1} p\left(x_n \mid x_{n+1}, y_{1: T}\right)\\ & =p\left(x_T \mid y_{1: T}\right) \prod_{n=1}^{T-1} p\left(x_n \mid x_{n+1}, y_{1: n}\right) \end{aligned}
The marginalization of $x_{1:t-1}$ and $x_{t+1:T}$ gives $$ p\left(x_t \mid y_{1: T}\right)=p\left(x_t \mid y_{1: n}\right) \int \frac{f\left(x_{t+1} \mid x_n\right)}{p\left(x_{t+1} \mid y_{1: t}\right)} p\left(x_{t+1} \mid y_{1: T}\right) d x_{t+1} $$
I am quite confused about the exact derviation. Could anyone give some hints on how to do the marginalization? Thank you!