= Solution
Put
$$
z(x)=-\int_0^x\sin(x-s)f(s)\,ds.
$$
Leibniz differentiation gives $z'=-\int_0^x\cos(x-s)f(s)\,ds$ and $z''=-f(x)+\int_0^x\sin(x-s)f(s)\,ds=-f-z$. Thus $z$ satisfies both <zero> <initial conditions> and the inhomogeneous equation. Every solution with $y(0)=0$ is $y=A\sin x+z(x)$.
On $[0,1]$, the second endpoint determines $A=-z(1)/\sin1$ uniquely, since $\sin1\ne0$. Collecting the integrals, and using the <sine addition formula> for $s<x$, gives
$$
\boxed{G(x,s)=\frac{\sin(\min\{x,s\})\sin(1-\max\{x,s\})}{\sin1}.}
$$
This continuous kernel vanishes at the endpoints, satisfies $G_{xx}+G=0$ off $x=s$, and has derivative jump $-1$, as required for $-y''-y=f$. The preceding construction proves existence, and a homogeneous solution with both endpoints <zero> must vanish, proving uniqueness.
On $[0,\pi]$, instead, the second boundary value becomes
$$
y(\pi)=z(\pi)=-\int_0^\pi f(s)\sin s\,ds.
$$
Thus \b[solvability is equivalent to $\int_0^\pi f(s)\sin s\,ds=0$]. When it holds, all solutions are
$$
\boxed{y(x)=A\sin x-\int_0^x\sin(x-s)f(s)\,ds,\qquad A\in\mathbb R.}
$$
There is one free homogeneous mode because the endpoint length is resonant.
Back to article page