Question about the weak solution of $u''-u=f$ I have a question about the ODE (weak formulation) given by $$u''-u=f$$ where $u\in H^1(\mathbb{R})$ and $f\in L^2(\mathbb{R})$. 
I want to see if there is an explicit formula for the weak solution. If $f\in C^{\infty}_0(\mathbb{R})$, then clearly we can find the strong solution, which have the form $$u(x)=c_1e^{x}+c_2e^{-x} + \frac{1}{2}\int_{x_0}^x e^{x-t}f(t)dt - \frac{1}{2} \int_{x_0}^x e^{t-x}f(t)dt$$
But this formula does not seem to work in the general case $f\in L^2(\mathbb{R})$ since the above formula need not be in $L^2$. Then how can I get a formula for the (weak) solution? 

The corrected version is
$$
      u(x)=-\frac{e^{-x}}{2}\int_{-\infty}^{x}f(t)e^{t}dt-\frac{e^{x}}{2}\int_{x}^{\infty}f(t)e^{-t}dt.
$$
If $f$ is compactly supported in $\mathbb{R}$, then $u(x) = Ce^{x}$ for large negative $x$, where $C=-\int_{-\infty}^{\infty}f(t)e^{-t}dt$; and $u(x)=De^{-x}$ for large positive $x$, where $D=-\int_{-\infty}^{\infty}f(t)e^{t}dt$. So $u\in L^2(\mathbb{R})$ for compactly supported $f\in L^2(\mathbb{R})$. And,
\begin{align}
            u'(x) & = \frac{e^{-x}}{2}\int_{-\infty}^{x}f(t)e^{t}dt-\frac{e^x}{2}\int_{x}^{\infty}f(t)e^{-t}dt \\
       u''(x) & = -\frac{e^{-x}}{2}\int_{-\infty}^{x}f(t)e^tdt-\frac{e^x}{2}\int_{x}^{\infty}f(t)^{-t}dt \\
     & +\frac{e^{-x}}{2}f(x)e^{x}+\frac{e^{x}}{2}f(x)e^{-x} \\
     & = u(x)+f(x).
\end{align}
Therefore the operator
$$
          Lf = -\frac{e^{-x}}{2}\int_{-\infty}^{x}f(t)e^t dt-\frac{e^x}{2}\int_{x}^{\infty}f(t)e^{-t}dt \;\;\; (*)
$$
maps compactly supported $f\in L^2(\mathbb{R})$ into $L^2(\mathbb{R})$, and
$(\frac{d^2}{dx^2}-I)Lf=f$. Consequently,
\begin{align}
    \|Lf\|^2 & \le \|Lf\|^2+\|(Lf)'\|^2 \\
             & = (Lf,Lf)+((Lf)',(Lf)') \\
             & = (Lf,Lf)-((Lf)'',Lf) \\
             & = -((\frac{d^2}{dx^2}-I)Lf,Lf) \\
             & = -(f,Lf)
\end{align}
Finally,
$$
       \|Lf\|^2 \le |(f,Lf)| \le \|f\|\|Lf\| \\
             \|Lf\| \le \|f\|.
$$
This holds for all compactly supported $f$. Because the subspace of such functions is dense in $L^2$, then $L$ extends by continuity to a continuous operator $\tilde{L} : L^2(\mathbb{R})\rightarrow L^2(\mathbb{R})$ whose operator norm is bounded by $1$. This extension is the natural one obtained by allowing a general $f\in L^2$ to be substituted into $(*)$.
