Suppose we're given two action integrals:
$$ S_1 = \int_{t_0}^{t_1} L_1(t,y,\dot{y}) dt \\ S_2 = \int_{t_1}^{t_2} L_2(t,y,\dot{y}) dt$$
The minimization of action integral $S = S_1 + S_2$ with respect to $y(t)\in C^2$ entails
$$ \dfrac{d}{d t}\dfrac{\partial L_1}{\partial \dot{y}} - \dfrac{\partial L_1}{\partial y} = 0 \; \forall \;t_0\leq t\leq t_1\\ \dfrac{d}{d t}\dfrac{\partial L_2}{\partial \dot{y}} - \dfrac{\partial L_2}{\partial y} = 0 \; \forall \;t_1\leq t\leq t_2$$
Now suppose I want to find $y(t)$ given boundary conditions $y(t_0) = y_0$ and $y(t_2) = y_2$. Here $y(t_1)$ is unconstrained. This can be done by solving each Euler Lagrange equation. However, I am stuck at enforcing continuity of $y(t)$ and $\dot{y}(t)$ at $t=t_1$. How should one incorporate them?