I know this proof has something to do with integration by parts, but I'm having trouble figuring it out. Can anyone please help me?
Suppose that $g''(x)$ is continuous everywhere and that
$$\int_{0}^{2\pi}g(x)\sin(x)\,dx + \int_{0}^{2\pi}g''(x)\sin(x)\,dx = 2.$$
Given that $g(2\pi)=1$, prove that $g(0) = 3$.
Using integration by parts twice $$\begin{align}\int_{0}^{2\pi}g(x)\sin x\,dx&=[-g(x)\cos x]_0^{2\pi}+\int_0^{2\pi}g'(x)\cos x\,dx\\&=-1+g(0)+[g'(x)\sin x]_0^{2\pi}-\int_0^{2\pi}g''(x)\sin x\,dx\\&=-1+g(0)-\int_0^{2\pi}g''(x)\sin x\,dx\end{align}$$ Thus $$\int_{0}^{2\pi}g(x)\sin(x)\,dx + \int_{0}^{2\pi}g''(x)\sin(x)\,dx = -1+g(0)=2\implies\boxed{g(0)=3}$$