Let $H$ be the operator $ -\frac{d^{2}}{dx^{2}} $ and let its domain be $\{f\in L^{2}(\mathbb{R},d\lambda)\text{ }:\int_{-\infty}^{\infty}|xF[f(x)]|^{2}dx<\infty\} $ where $F$ is the Fourier Transform.
Let $h(x)$ be the state vector $h(x)=\begin{cases} \frac{1}{\sqrt{2}} & x\in[0,2]\\ 0 & \text{else }\end{cases}$.
Find the probability that a measurement will return values in $[\frac{1}{2},1]$.
================
Here is my own response, which I am very skeptical of.
The General Idea
Find the eigenspace of of the opeartor $H$ spanned by its eigenvectors (eigfunctions) $\psi_{k}(x)$.
Express $h(x)$ as a linear combination of the eigenfunctions: $h(x)=\sum C_{k}\psi_{k}(x)$.
Based on this document, I believe that the if $\{C_{k}\}$ is the set of all possible eigenvalues, then the probability a measurement of the observable on $H$ on the state returns value in the set $\Omega\subseteq\{C_{k}\}$ is
$\frac{\sum_{k\in\Omega}|C_{k}|^{2}}{\sum_{k\in\{C_{k}\}}|C_{k}|^{2}}$
The Calculation
1.Eigenspace of $H$
Let $\lambda$ be the eigenvalue of $H$, then H[f]=\lambda f(x)\implies f''(x)=-\lambda f(x)
$f(x)=c_{1}e^{i\sqrt{\lambda}x}+c_{2}e^{-i\sqrt{\lambda}x}$
Thus the eigenvalues of $H$ are $\lambda\in(-\infty,+\infty)$
while correspoinding eigenfunctions for each eigenvalue $\lambda$ are $e^{i\sqrt{\lambda}x}$ and $e^{-i\sqrt{\lambda}x}$.
2.Decomposition of the state function
For our state $h(x)=\begin{cases} \frac{1}{\sqrt{2}} & x\in[0,2]\\ 0 & \text{else}\end{cases}$
we can decompose into the the space spanned by eigenfunctions of $H$ using Fourier Transform, which states that in general:
$f(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\hat{f(x)}e^{ikx}dx$and $\hat{f(x)}=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}f(x)e^{-ikx}dx$
For our state, Fourier Transformation produces
$h(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\hat{h(x)}e^{ikx}dk$ where $\hat{h(x)}=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}h(x)e^{-ikx}dx=\frac{1}{\sqrt{2\pi}}\int_{0}^{2}\frac{1}{\sqrt{2}}e^{-ikx}dx=\frac{1}{2\sqrt{\pi}}\frac{1}{-ik}e^{-ikx}|_{0}^{2}$ $=\frac{i}{2k\sqrt{\pi}}(e^{-2ik}-1)$
Thus
$h(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\frac{i}{2k\sqrt{\pi}}(e^{-2ik}-1)e^{ikx}dk$
Expressing $h(x)$ as a linear combination of the basis of the eigenspace of $H$, which is $\{e^{ikx}\}$, we have $h(x)=\sum_{k\in\mathbb{R}}C_{k}e^{ikx}$
where $C_{k}=\frac{i(e^{-2ik}-1)}{2\sqrt{2}\pi k}$
3.The probability
To have a measure result in $[\frac{1}{2},1]$, $\lambda=[\frac{1}{2},1]$ means that the eigenfuctions are $e^{\pm i\sqrt{\lambda}x}=e^{\pm ikx}$ where $k\in[-1,-\frac{1}{\sqrt{2}}]\cup[\frac{1}{\sqrt{2}},1]=\Omega$.
The probability that this event occurs is
$\sum_{k\in\Omega}|C_{k}|^{2}/\sum_{k\in\mathbb{R}}|C_{k}|^{2}$
Since the summation is over a continuous range of k, (this is where the the descrete idea from this document is extended in an continuous case, which I am not sure if it is correct), we can compute it using an integral:
$\sum_{k\in\text{all}k}|C_{k}|^{2}=\int_{-\infty}^{\infty}\left|\frac{i(e^{-2ik}-1)}{2\sqrt{2}\pi k}\right|^{2}dk$
$=\int_{-\infty}^{\infty}\frac{e^{-2ik}-1}{2\sqrt{2}\pi k}\cdot\frac{e^{2ik}-1}{2\sqrt{2}\pi k}dk$ $=\int_{-\infty}^{\infty}\frac{1-e^{-2ik}-e^{2ik}+1}{8\pi^{2}k^{2}}dk$ $=\frac{1}{8\pi^{2}}\int_{-\infty}^{\infty}\frac{2-2\cos2k}{k^{2}}dk=$ $\frac{1}{4\pi^{2}}\int_{-\infty}^{\infty}\frac{1-\cos2k}{k^{2}}dk=0.159154 $
and similarly $\sum_{k\in\Omega}|C_{k}|^{2}=\int_{-1}^{-1/\sqrt{2}}\left|\frac{e^{-2ik}-1}{2\sqrt{2}\pi k}\right|^{2}dk+\int_{\frac{1}{\sqrt{2}}}^{1}\left|\frac{e^{-2ik}-1}{2\sqrt{2}\pi k}\right|^{2}dk$ $\frac{1}{2\pi^{2}}\int_{1/\sqrt{2}}^{1}\frac{1-\cos2k}{k^{2}}dk=0.00230997$
Thus the probability is $=0.00230996/0.159154=0.145$ or 14.5%