Show that the given green's function below,
$$g(x,s)=\begin{cases} -\dfrac{\cos{ks}}{k}\sin{kx},\quad x\lt s\\ -\dfrac{\sin{ks}}{k}\cos{kx},\quad s\lt x\\ \end{cases}$$
satisfies the ODE :
$$u''+k^2u=f(x)$$
Here is my work :
We know, if we have a green's function
$$G(x,s)$$
Then,
$$u(x)=\int G(x,s)f(s)\,\mathbb ds$$
So, i was thinking about substituting this $u(x)$ when $x \lt s$ (btw, i doubt it) to the original equation, and i have:
$$\dfrac{\partial^2}{\partial x^2}\left[\int -\dfrac{\cos{ks}}{k}\sin{kx}f(s)\,\mathbb ds\right]+k^2\left[\int -\dfrac{\cos{ks}}{k}\sin{kx}f(s)\,\mathbb ds\right]=f(x) $$
What's next to do?
I don't think it will gives me true cz it has $f(s)$ instead of $f(x)$ there?
Or it could be, cz i have to substitute $s=x$ and ignore the negative sign?
You need to use the full solution formula $\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}\newcommand{\dd}{\,\mathbb d}$ $$ u(x)=-\cos(kx) \int_{-\infty}^x \dfrac{\sin(ks)}{k}f(s) \dd s - \dfrac{\sin(kx)}{k} \int_x^\infty \cos(ks)f(s) \dd s $$ This assumes that $f$ has either finite support or is falling fast enough. Then you can compute derivatives \begin{align} u'(x)&=\sin(kx)\int_{-\infty}^x \sin(ks)f(s) \dd s -\cos(kx)\dfrac{\sin(kx)}{k}f(x)\\&\qquad - \cos(kx) \int_x^\infty \cos(ks)f(s) \dd s + \dfrac{\sin(kx)}{k}\cos(kx)f(x) \\ &=\sin(kx)\int_{-\infty}^x \sin(ks)f(s) \dd s - \cos kx \int_x^\infty \cos(ks)f(s) \dd s\\[1em] u''(x)&=k\cos(kx)\int_{-\infty}^x \sin(ks)f(s) \dd s + \sin(kx) \sin(kx)f(x)\\&\qquad + k\sin(kx)\int_x^\infty \cos(ks)f(s) \dd s +\cos(kx) \cos(kx)f(x)\\ &=-k^2u(x)+f(x) \end{align}