A BVP question using green's function When doing exercise, I found this question with boundary conditions I couldn't solve.  
$y′′ + y = f(x)$, $ \ $ $0 < x < 2\pi$, $ \ $ $y(0) − y(2\pi) = 0$, $ \ $ $y′(0) − y′(2\pi) = 0$    
The question is asking what goes wrong in this problem?
I know solving auxilary equation gives $y=Asin(x)+Bcos(x)$.
It seems that at values of $sin(0)=sin(2\pi),cos(0)=cos(2\pi)$.   
So I couldn't find out $A$ and $B$ when I split the solution to linearly independent $y=Asin(x)$ $(x<x')$ and $y=Bcos(x)$ $(x>x')$.
I wonder if this is the case, or there is something else going wrong?
 A: Although all solutions of $y''+y=0$ are $2\pi-$periodic, this is not necessarily true of the inhomogeneous problem $y''+y=f(x)$. For that problem, you'll need to apply the variation of constants/parameters formula:
$$
y(x) = \left[C_+ - y_+(x) \int_0^x \frac{f(s) y_-(s)}{W(s)} ds \right] + \left[C_- + y_-(x) \int_0^x \frac{f(s) y_+(s)}{W(s)} ds \right] .
$$
Here, $y_\pm$ are two fundamental solutions (e.g., the cosine/sine you already use) and $W$ is the Wronskian:
$$
W(x) = \det\left[\begin{array}{cc}y_+(x) & y_-(x) \\ y'_+(x) & y'_-(x)\end{array}\right] .
$$
(In your case, it should turn out constant because there's no 1st order term.)
Now apply the BCs to find $C_\pm$ & good luck.
EDIT Since you're asking 'what goes wrong,' you should first recognize that periodic BCs yield periodic solutions - because of the ODE (relating the second derivative to the first and zeroth ones, and thus also the third, fourth & so on), you get periodicity for all derivatives. Nevertheless, whether there are any periodic solutions depends, here, on whether the forcing $f$ adds to or subtracts energy from the system. Since $C_\pm$ do not control $f$, they cannot be selected in a way ensuring a periodic solution. That's the intuitive picture; filling in the details is up to you.
