Interesting integral involving delta function. How would one go about solving the following,
$$\int_0^{\pi}\sin(x)\cdot\delta(\cos(x))\,\text{d}x.$$
I'm unsure where to begin. I am aware of the standard definition of the delta function in terms of the integral,
$$\int_{-\infty}^{\infty}f(x)\delta(x-a)\,\text{d}x=f(a),$$
but I am unsure how I can use this result, if at all.
 A: Another method: $u = \cos(x)$ transforms the integral into 
$$\int_0^\pi \sin(x)\cdot \delta(\cos(x))\,\text{d}x = -\int_1^{-1} \delta(u)\,\text{d}u = \int_{-1}^1 1\cdot \delta(u)\,\text{d}u = 1$$
A: You can do this by realizing that the only value of $\sin$ that is retained is when the delta function is $0$. This occurs at $x=\pi/2$. Thus the integral will be 
$$\sin\frac{\pi}{2}=1.$$
A: $\newcommand{\angles}[1]{\left\langle\,{#1}\,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Leftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\color{#f00}{\int_{0}^{\pi}\sin\pars{x}\,\delta\pars{\cos\pars{x}}\,\dd x} = \int_{0}^{\pi}\sin\pars{x}\,
\sum_{n = -\infty \atop {\vphantom{\large A}n\ \mathrm{odd}}}^{\infty}\,\,\,{\delta\pars{x - n\pi/2} \over \verts{-\sin\pars{n\pi/2}}} \,\dd x
\\[3mm] = &\
\sum_{n = -\infty \atop {\vphantom{\large A}n\ \mathrm{odd}}}^{\infty}\,\,\,\
\int_{0}^{\pi}\sin\pars{x}\delta\pars{x - n\pi/2}\,\dd x
\end{align}
However,
\begin{align}
\int_{0}^{\pi}\sin\pars{x}\delta\pars{x - n\pi/2}\,\dd x & =
\left\lbrace\begin{array}{lcl}
\ds{\sin\pars{\pi \over 2} = 1} & \mbox{if} & \ds{0 < {n\pi \over 2} < \pi}
\\
\ds{0} && \mbox{otherwise}
\end{array}\right.
\\[3mm]
\imp\quad
\color{#f00}{\int_{0}^{\pi}\sin\pars{x}\,\delta\pars{\cos\pars{x}}\,\dd x}
=
\color{#f00}{1}
\end{align}
