Green's function for a particular operator Lately, I've been trying to solve differential equations of the form $$f''+k^2 f =g~~,$$ and $g$ is a continuous function on $[0,2\pi]$. A friend mentioned that I check out Green's function. Unfortunately, I found it hard understanding most the materials I found online. I'm hoping someone here will find time to make me understand better.  
Let  $$D=\frac{\mathrm{d}^2}{\mathrm{d}x^2}+k^2~~~~k\in \mathbf R,$$ how can I find the Green's  function for $D$? 
 A: $$f''+k^2 f =g$$
Say we call the Green's function $G$ (not to be confused with $g$).  Then the solution $f$ of the differential equation should be the convolution $G*g$ of $G$ and $g$, defined as 
$$
f(x) = (G*g)(x) = \int_{-\infty}^\infty G(x-y)g(y)\,dy = \int_{-\infty}^\infty G(y)g(x-y)\,dy.
$$
The Green's function is sometimes defined as the solution of $f''+k f =\delta$, where $\delta$ is Dirac's "delta function".  The delta function is the identity element for convolution.
A: You may want to look here. Your equation is Helmholtz equation in $1$D for which the Green's function is
$$\dfrac{i e^{ik\vert x \vert}}{2k}$$
A: Adding to Michael Hardy, and other above. 
For example to get to the solution $ \dfrac{i e^{ik\vert x \vert}}{2k} $ presented above . From the equation $f''+k f =\delta$ you can use the Laplace Transform to get to :
$$ s^2 F(s) - s f(0) - f'(0) + k^2 F(s) = 1 $$
$$ s^2 F(s) + k^2 F(s) = 1 + s f(0) + f'(0) $$
$$ F(s) \left( s^2  + k^2 \right) = 1 + s f(0) + f'(0) $$
$$ F(s)  = \frac{1 + s f(0) + f'(0)}{\left( s^2  + k^2 \right)} $$
Then use the initial conditions (green function must also satisfy). The solution above presented uses the Sommerfeld radiation condition (wikipedia also states that). Finally get the inverse to get to the solution of the Green Function. 
Also you can find detailed explanation at Butkov Mathematical Physics chapter 12 Green Functions.
Or Mathematical Methods Physicists George B. Arfken chapter 10. 
Sorry for not getting deep in the derivations but there are multiple ways of finding the green's function as above stated. I really recommend the references. 
