Evaluate $$\int_0^\infty f(x)\delta(x-1)dx$$where$$f(x)=\begin{cases}x^2,&0\le x<1\\\sin 2,&x=1\\x,&x>1\end{cases}$$
Attempt
Since the function is discontinuous at $1$, I couldn't directly say the answer would be $f(1)$. I considered the $\delta$-sequence$$\delta_k(x-1)=\begin{cases}\frac k2,& |x-1|<1/k\\0,&\text{otherwise}\end{cases}\\\int_0^\infty f(x)\delta_k(x-1)dx=\frac k2\Big[\int_{1-1/k}^1x^2dx+\int^{1+1/k}_1xdx\Big]\\=1+\frac12\Big(\frac1{3k^2}-\frac1{2k}\Big)$$
Then taking the limit as $k\to\infty$, I got the answer as $1$, which seems correct intuitively as it is the limit of the function at $x=1$. But the answer key gives the answer $\sin 2=f(1)$.
Is the key wrong or am I missing something?
Edit
The book defines the Dirac $\delta$ function (also called impulse function) $\delta(t)$ as the limit of a sequence of functions $\{\delta_k(t)\}$, where $$\int_{-\infty}^\infty\delta_k(t)dt=1$$For example,$$\delta_k(t)=\begin{cases}\frac k2,&|t|<1/k\\0,&\text{otherwise}\end{cases}$$is one such sequence. Then it goes on to say that the Dirac $\delta$ function can be understood as the generalized function $$\delta(t)=\begin{cases}0,&t\ne0\\\infty,&t=0\end{cases}$$
For continuous functions in $[0,\infty)$ and $a\ge0$,$$\int_0^\infty f(t)\delta(t-a)dt=f(a)$$