motivation of surgery an $n$-surgery on m dim manifold M is to cut out $S^n\times D^{m-n}$and replace it by $D^{n+1}\times S^{m-n-1}$.
I want to know how this is invented?
I do know that the effect of passing a critical point of index $n$ in $m$-manifold is equivalent to attach an $n+1$-handle $D^{n+1}\times D^{m-n-1}$.Now the boundary of $D^n\times D^{m-n}$ is $S^n\times D^{m-n}\cup D^{n+1}\times S^{m-n-1}$,i think there must be some close relation between the special form of $n$-surgery and handle.can someone help make this clear? 
 A: The best answer is to cite Tim Perutz answer to my question Surgery and homology: a reference request:
"To say that a smooth, closed manifold N is obtained by surgery along a (framed) sphere in M is to say that there is a cobordism P from M  to N and a Morse function $f\colon P\to [0,1]$, with $f^{−1}(0)=M$, $f^{−1}(1)=N$, and exactly one critical point c."
Critical point corresponds to a handle, $S^n\times D^{m-n}$ lies in $M$, $D^{n+1}\times S^{m-n-1}$ lies in $N$ and spheres $S^n$ and $S^{m-n-1}$ are intersections of stable and unstable manifolds for $c$ with corresponding level sets.
In other words: to obtain $N$ from $M$ by a surgery one can consider $M\times [0,1]$, glue a handle using $S^n\times D^{m-n} \subset M=M\times 1$, smooth the resulted cobordism and take a component of a boundary.  
A: This question has already been answered, but there's a tiny piece of intuition which I'd like to make explicit:
If you're thinking about a manifold in the PL world, surgery might look a bit arbitrary- why cut out and glue in those pieces and not others? Surgery's natural setting is the smooth world, where you're equipping a manifold with a Morse function $f\colon\, M\to \mathbb{R}$, and using information about critical points of $f$ to encode $M$.
It's actually a bit more involved than you might think it might be, but when you pass a critical point of $f$ you add a handle to $M$, and the boundary changes by surgery. For details, see answers to this question.
So really, surgery isn't an a-priori construction which somebody pulled from a hat- it is rather an operation which stems naturally and inevitably from Morse theory.
A: The Wikipedia article on surgery theory explains this! In addition, the Edinburgh Surgery Theory Study Group provides all kinds of surgery-related materials, including YouTube videos (not for the squeamish). There is all kinds of surgery bric-a-brac on
Surgery Bits and Pieces and also here.
