Dirichlet problem, uniqueness & counterexample

Help me please with this example:

Let's $q(x)$ be a continuous and constant sign function in $[0,1]$; uniqueness of solution of Dirichlet problem to equation: $u''+qu=0$ depends on sign of $q$. Prove the theorem of uniqueness in cases then it's true and give counterexample in case then it's not true.

Thanks a lot!

-

For the uniqueness part, other than using maximum principle as Thomas said, you can also prove in this way: For $u$ satisfying $$\tag{1}u''+qu=0$$ with $q\leq 0$ and $u(0)=u(1)=0$, we must have $u\equiv 0$. To see this, multiply $(1)$ by $u$ and integrate it over $[0,1]$, we get $$\int_0^1uu''+\int_0^1qu^2=0.$$ Integration by parts, we have $$\big[uu'\big]_0^1-\int_0^1(u')^2+\int_0^1qu^2=0.$$ Since $u(0)=u(1)=0$ by assumption, we have $$-\int_0^1(u')^2+\int_0^1qu^2=0.$$Left hand side is nonpositive since $q\leq 0$, which implies that $u'\equiv 0$, i.e. $u\equiv c$ for some constant $c$. Since $u(0)=u(1)=0$, $c=0$, i.e. $u\equiv 0$ as required.

-
Without boundary conditions like $u(0)=a$, $u(1)=b$ you will have no chance proving uniqueness. So from now on I'll assume you have boundary conditions given.
If $q\geq 0$ you want have a unique solution in general. A counterexample would be the follwing: I'm looking for solutions to $u''+u=0$, $u(0)=0$, $u(\pi)=0$. It's clear that $u(x)=0$ und $u(x)=sin(x)$ satisfy these conditions.
Assumung $q\leq 0$ the key step in proving uniqueness is the so called maximum principle. It states that the maximum (under certain conditions, i.e. $q\leq 0$, http://aw.twi.tudelft.nl/~sweers/maxpr/maxprinc.pdf) can only be attained on the boundary. Assuming that $\phi$ and $\psi$ are solutions then $\phi-\psi$ is also a solution which can attain it's maximum only on the boundary. But since $\phi=\psi$ on the boundary this implies $\phi=\psi$ everywhere.