Weak solution Boundary Value problem I have to prove that the following problem
$$(P) \begin{cases} -u''-u=1\,\,\,\,\,\,\,\,\text{if}\,\,\, x\in(0,\pi)\\
u(0)=u(\pi)=0 \end{cases} $$
doesn't admit weak solutions.
I'm proceeding by contradiction. Indeed, if $u$ is a weak solution of $(P)$ then, by the Regularity of the weak solution's theorem, $u$ will be also a classical solution of $(P)$, i.e. $u$ is of class $C^2([0,\pi])$ and $u$ satisfies point wise $(P)$.
I can't find a contradiction.
 A: Now that you have proved that every weak solution is a strong solution, you can proceed as follows. Assume that there exists a weak solution, $u$, of your problem. It is simultaneously a strong solution, i.e., in particular, satisfies the equation on $[0,\pi]$. The general solution of this equation is $u=A\sin x+B\cos x-1$. The boundary condition at $x=0$ says that $B=1$, while the boundary condition at $x=\pi$ says that $B=-1$. Thus, you obtain $1=-1$. A contradiction. :) 
A: Suppose you do have a classical solution. Then multiply both sides by $\sin(t)$ and integrate:
$$
     \int_{0}^{\pi}\sin(t)(u''(t)+u(t))\,dt = -\int_{0}^{\pi}\sin(t)\,dt.
$$
This leads to a contradiction. The right is non-zero. However, the left side evaluates to $0$ because integration by parts gives
$$
\begin{align}
    \int_{0}^{\pi}\sin(t)u''(t)\,dt & = \left.\sin(t)u'(t)\right|_{t=0}^{\pi}-\int_{0}^{\pi}\cos(t)u'(t)\,dt \\
   & = \left.\sin(t)u'(t)\right|_{t=0}^{\pi}-\left.\cos(t)u(t)\right|_{t=0}^{\pi}
      -\int_{0}^{\pi}\sin(t)u(t)\,dt \\
   & = -\int_{0}^{\pi}\sin(t)u(t)\,dt.
\end{align}
$$
NOTE: This is not just a strange guess. The reason for this is that, for a selfadjoint $A$, one has $\mathcal{N}(A)=\mathcal{R}(A)^{\perp}$. And $Au = -u''-u$ on the Sobolev domain with $u(0)=u(\pi)=0$ has a non-trivial homogenous solution $\sin(t)$. So the constant function $1$ cannot be in the range of $A$ becuase it is not orthogonal to $\sin(t)$.
