# Second order nonhomogenous ODE with Dirichlet boundary condition

I would like to know a hint for this problem. Brezis describes it as it can be "solved explicitly by a very simple calculation". The problem is:

Given $f\in C^1([a,b])$, find a function $u$ satisfying:

$$\tag{1} -u''+u=f, \text{ on }[a,b],$$ and $$u(a)=u(b)=0.\tag{2}$$

Thanks Umberto P. I found the solution for (1) is:

$$u(t)=c_1(t)e^t+c_2(t)e^{-t}, \text{ where}$$ $$c_1'(t)=-\frac{f(t)}{2e^{t}}, \text { and }$$ $$c_2'(t)=\frac{f(t)}{2e^{-t}} .$$

So functions $c_1$ and $c_2$ are determined modulo one constant. However, taking $a=0$ and $b=1$ and writing the boundary condition (2) results in a system that I can't solve.