Green's function for $y''+y=f(x)$ This example is taken from the Wikipedia's article. Namely, find the Green's function for
$$y'' + y = f(x)$$
with boundary conditions:
$$y(0) = y(\frac {\pi} {2}) = 0.$$
The defining equation for the Green's function is:
$$G''_{xx}(x, s) + G(x, s) = \delta (x-s).$$
There are some subtle aspects related to integration of discontinuous functions which I can't understand clearly. Everything is ok till finding the general solution and applying boundary conditions which yields:
$$
\left\{\begin{matrix}
G(x, s) = a \cos x, x > s,\\ 
G(x, s) = b \sin x, x < s,
\end{matrix}\right.
$$
where $a,b$ are unknown coefficients. Now I need to integrate the defining equation from $s-\varepsilon$ to $s+\varepsilon$ and take the limit as $\varepsilon \rightarrow 0$. I should arrive at:
$$
\underset{\varepsilon \rightarrow 0}{\lim} \left( G'_{x}(x, s)\bigg|_{s+\varepsilon} - G'_{x}(x, s)\bigg|_{s-\varepsilon} \right) = 1
$$
as shown, for example, here on page 6, formula 41:
http://young.physics.ucsc.edu/116C/gf.pdf
The second term vanished since $G(x, s)$ is continuous by definition. Indeed, it is easy to show using splitting the interval of integration into $[s-\varepsilon, s]$ and $[s, s+\varepsilon]$ and taking the limit.
But what to do with $G''_{xx}(x, s)$? The formula above seems like a "direct" application of Newton-Leubnitz formula. Although, $G''_{xx}(x, s)$ is discontinuous and there is no such a function which could be an unambiguous antiderivative for it on the entire interval $[s - \varepsilon, s + \varepsilon]$.
UPDATE:
According to the theorem 3.8 by Nott (1978) ( http://www.jstor.org/stable/2100979 ), the definite integral of $G''_{xx}(x, s)$ can be computed as follows using the fact that  $G'_{x}(x, s)$ is piecewise continuous:
$$
\int_a^b G''_{xx}(x, s) dx = G'_{x}(x, s)(b,s) - G'_{x}(x, s)(a,s).
$$
 A: I'm not sure I understand what you're asking. What you've written says the following. For each $s$, $x \mapsto G(x,s)$ is a continuous function which satisfies $\frac{\partial^2 G}{\partial x^2}+G=0$ at each $x \neq s$. For each $s$, $x \mapsto \frac{\partial G}{\partial x}(x,s)$ is a continuous function at each $x \neq s$. At $s$, $\frac{\partial G}{\partial x}$ has a jump of size $1$. It is equivalent to say that the right derivative at $s$ is $1$ larger than the left derivative at $s$.
So on $[0,s)$ you have $G(x,s)=a \sin(x)$ and on $(s,\pi/2]$ you have $G(x,s)=b \cos(x)$. So the left derivative at $s$ is $a \cos(s)$ while the right derivative is $-b \sin(s)$. So $-b\sin(s)-a\cos(s)=1$. Continuity of $G$ gives us $a\sin(s)-b\cos(s)=0$. In other words:
$$\begin{bmatrix} -\cos(s) & -\sin(s) \\ \sin(s) & -\cos(s) \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$$
This comes about because
$$\int_{s-\varepsilon}^{s+\varepsilon} \frac{\partial^2 G}{\partial x^2}(x,s) dx = \int_{s-\varepsilon}^{s+\varepsilon} -G(x,s) + \delta(x-s) dx = 1 - \int_{s-\varepsilon}^{s+\varepsilon} G(x,s) dx$$
and
$$\int_{s-\varepsilon}^{s+\varepsilon} \frac{\partial^2 G}{\partial x^2}(x,s) dx = \frac{\partial G}{\partial x}(s+\varepsilon) - \frac{\partial G}{\partial x}(s-\varepsilon).$$
Since $\frac{\partial^2 G}{\partial x^2}$ is in this case a distribution rather than a function, this last equation is really a definition of $\frac{\partial^2 G}{\partial x^2}$.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
With your proposed solution you'll have
\begin{align}
\left.\begin{array}{rcrcl}
\cos\pars{s}a & - & \sin\pars{s}b & = & 0
\\
-\sin\pars{s}a & -& \cos\pars{s}b & = & 1 
\end{array}\right\}\quad\imp\quad
\left\{\begin{array}{rcl}
a & = & -\sin\pars{s}
\\
b & = & -\cos\pars{s}
\end{array}\right.
\end{align}

$$
{\rm y}\pars{x}=-\cos\pars{x}\int_{0}^{x}\sin\pars{s}\fermi\pars{s}\,\dd s
-\sin\pars{x}\int_{x}^{\pi/2}\cos\pars{s}\fermi\pars{s}\,\dd s
$$

