Sturm Liouville with periodic boundary conditions

I will write $a$ for $\sqrt{2}$ for simplicity. The general solution of the homogenous equation $y''+2y=0$ has the form $$y(x)=C\cos(ax)+D\sin(ax)$$ Using the variation of parameters method to find a particular solution of the non homogenous problem, we have to determine $C$ and $D$ with $$ \eqalign{C'\cos(ax)+D'\sin(ax)&=0\cr -C'\sin(ax)+D'\cos(ax)&=-\frac{1}{a}f(x) } $$ This yields $$ C'=\frac{1}{a}\sin(ax)f(x),\quad D'=-\frac{1}{a}\cos(ax)f(x) $$ Thus, the general solution of $y''+2y+f=0$ is given by $$\eqalign{ y(x)&=c\cos(ax)+d\sin(ax)+\frac{\cos(ax)}{a}\int_0^x\sin(at)f(t)dt-\frac{\sin(ax)}{a}\int_0^x\cos(at)f(t)dt\\ &=c\cos(ax)+d\sin(ax)-\frac{1}{a}\int_0^x\sin(ax-at)f(t)dt} $$ and $$ y'(x)=-ac\sin(ax)+ad\cos(ax)- \int_0^x\cos(ax-at)f(t)dt $$ Now, the conditions $y(0)=y(2\pi)$ and $y'(0)=y'(2\pi)$ give us two equations:

$$\eqalign{c &=c\cos(2a\pi)+d\sin(2a\pi )-\frac{1}{a}\int_0^{2\pi}\sin(2a\pi-at)f(t)dt\cr ad&= -ac\sin(2a\pi)+ad\cos(2a\pi)- \int_0^{2\pi}\cos(2a\pi-at)f(t)dt} $$ This can be arranged as follows $$\eqalign{c\sin(a\pi)-d\cos(a\pi) &=-\frac{1}{2a\sin(a\pi)}\int_0^{2\pi}\sin(2a\pi-at)f(t)dt\cr c\cos(a\pi)+d\sin(a\pi)&= - \frac{1}{2a\sin(a\pi)}\int_0^{2\pi}\cos(2a\pi-at)f(t)dt} $$ Solving for $c$ and $d$ we obtain $$\eqalign{c&=-\frac{1}{2a\sin(a\pi)}\int_0^{2\pi}(\cos(2a\pi-at)\cos(a\pi)+\sin(a\pi)\sin(2a\pi-at))f(t)dt\cr &=-\frac{1}{2a\sin(a\pi)}\int_0^{2\pi} \cos(a\pi-at)f(t)dt\cr d&=-\frac{1}{2a\sin(a\pi)}\int_0^{2\pi}(\cos(2a\pi-at)\sin(a\pi)-\cos(a\pi)\sin(2a\pi-at))f(t)dt\cr &=\frac{1}{2a\sin(a\pi)}\int_0^{2\pi} \sin(a\pi-at)f(t)dt\cr } $$ Finally $$\eqalign{ y(x)& =\frac{-1}{2a\sin(a\pi)}\int_0^{2\pi} \big(\cos(ax)\cos(a\pi-at)-\sin(ax)\sin(a\pi-at)\big)f(t)dt\\ &\phantom{=}-\frac{1}{a}\int_0^x\sin(ax-at)f(t)dt\\ &=\frac{-1}{2a\sin(a\pi)}\int_0^{2\pi}\cos(a\pi+ax-at)f(t)dt-\frac{1}{a}\int_0^x\sin(ax-at)f(t)dt } $$ This expression of $y$ can be simplified as follows: $$\eqalign{ y(x)& =\frac{-\cot(a\pi)}{2a }\int_0^{2\pi} \cos(ax-at)f(t)dt\cr &\phantom{=}+\frac{1}{2a }\int_0^{2\pi} \sin(ax-at)f(t)dt -\frac{1}{a}\int_0^x\sin(ax-at)f(t)dt\cr &=\frac{-\cot(a\pi)}{2a }\int_0^{2\pi} \cos(ax-at)f(t)dt+\frac{1}{2a }\int_x^{2\pi} \sin(ax-at)f(t)dt\cr &\phantom{=} -\frac{1}{2a }\int_0^{x} \sin(ax-at)f(t)dt \cr &=\frac{-\cot(a\pi)}{2a }\int_0^{2\pi} \cos(ax-at)f(t)dt-\frac{1}{2a }\int_0^{2\pi} \sin(a|x-t|)f(t)dt\cr &=\frac{-1}{2a\sin(a\pi)}\int_0^{2\pi} \cos(a\pi-a|x-t|)f(t)dt } $$ Therefore, $$ y(x)=\int_0^{2\pi}G(x,t)f(t)dt $$ with $$ G(x,t)=\frac{-\cos(\sqrt{2}(\pi-|x-t|))}{2\sqrt{2}\sin(\sqrt{2}\pi)}. $$ which is the desired conclusion.$\qquad\square$.


The Green's function is the solution when $f(x)=\delta(x-x_s)$, where $x_s$ is some kind of point source position that forces the system. Let's suppose that $x_s\in(0,2\pi)$. For $x\neq x_s$, the delta function is zero, and so we solve the homogeneous equation $$ \left| \begin{array}{cc} y'' + 2y = 0, & x<x_s\\ y'' + 2y = 0, & x>x_s \end{array} \right. $$ And we'll worry about what happens right at $x=x_s$ in a bit. The homogeneous equations presented are solved by sines and cosines $$ y(x) = \left\{ \begin{array}{cc} A\cos(\sqrt{2}x)+B\sin(\sqrt{2}x), & x<x_s\\ C\cos(\sqrt{2}x)+D\sin(\sqrt{2}x), & x>x_s\\ \end{array} \right. $$ Now the first boundary condition is that $y(0)=y(2\pi)$. For the left boundary, we use the left part of the piecewise $y$ above, and for the right boundary, we use the right part, so this reads $$ A = C\cos(2\sqrt{2}\pi)+D\sin(2\sqrt{2}\pi) $$ Doing the same with the derivative conditions gives $$ B = D \cos \left(2 \sqrt{2} \pi \right)-C \sin \left(2 \sqrt{2} \pi \right) $$ Now we need conditions to match the delta function. We expect the solution to be continuous at $x=x_s$, so $$ A\cos(\sqrt{2}x_s)+B\sin(\sqrt{2}x_s) = C\cos(\sqrt{2}x_s)+D\sin(\sqrt{2}x_s) $$ And then there is the appropriate "jump" condition on the derivative at $x=x_s$. We need $y$ to be discontinuous enough so that taking two derivatives will result in a negative delta function. This means that there must be a negative unit step discontinuity in the derivative: $$ -\sqrt{2} A \sin \left(\sqrt{2} x_s\right)+\sqrt{2} B \cos\left(\sqrt{2} x_s\right)-1=\sqrt{2}D\cos\left(\sqrt{2} x_s\right)-\sqrt{2} C \sin \left(\sqrt{2} x_s\right) $$ The above are four linear equation in the four unknowns $(A,B,C,D)$, which we can formulate as $$ \left[ \begin{array}{cccc} 1 & 0 & -\cos(2\sqrt{2}\pi) & -\sin(2\sqrt{2}\pi) \\ 0 & 1 & \sin \left(2 \sqrt{2} \pi \right) & -\cos \left(2 \sqrt{2} \pi \right)\\ \cos(\sqrt{2}x_s)&\sin(\sqrt{2}x_s)&-\cos(\sqrt{2}x_s)&-\sin(\sqrt{2}x_s) \\ -\sqrt{2} \sin \left(\sqrt{2} x_s\right)&\sqrt{2} \cos\left(\sqrt{2} x_s\right)&\sqrt{2}\sin \left(\sqrt{2} x_s\right)&-\sqrt{2}\cos\left(\sqrt{2} x_s\right) \end{array} \right] \left[ \begin{array}{c} A\\B\\C\\D \end{array} \right] = \left[ \begin{array}{c} 0\\0\\0\\1 \end{array} \right] $$ Solving that system after a good bit of trigonometric simplifications gives $$ A=-\frac{ \cos \left(\sqrt{2} (x_s-\pi )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)} $$ $$ B=\frac{ \sin \left(\sqrt{2} (\pi -x_s)\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)} $$ $$ C=-\frac{ \cos \left(\sqrt{2} (x_s+\pi )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)} $$ $$ D=-\frac{ \sin \left(\sqrt{2} (x_s+\pi )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)} $$ Plugging into the piecewise form proposed for $y$ and doing more trigonometric simplifying, $$ y(x) = \left\{ \begin{array}{cc} -\frac{ \cos \left(\sqrt{2} (x-x_s+\pi )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)}, & x<x_s\\ -\frac{ \cos \left(\sqrt{2} (x_s-x+\pi )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)}, & x>x_s\\ \end{array} \right. $$ Notice these are the same except the role of $x$ and $x_s$ are switched between the two expressions. This allows us to write a more compact expression $$ y(x)=-\frac{ \cos \left(\sqrt{2} (\pi-|x-x_s| )\right)}{2 \sqrt{2}\sin(\sqrt{2}\pi)} $$ which is the Green's function for this problem.