Standing waves: why do 2 standing waves don't cancel each other? I have learned that when two waves are combined, the peaks and troughs could be in the same direction (so that means the amplitude is increased) or the peaks and troughs could be in the opposite direction (so that means they are cancelling out each other; meaning nothing is produced)
According to definitions online, "standing waves can be produced by any two identical waves traveling in opposite directions that have the right wavelength"
Why is it that these "two waves in opposite direction" not cancel out each other and instead they create a "standing wave"? 
 A: They do cancel each other when the peaks of one coincide with the troughs of the other, but since they move in opposite directions, this only happens at specific moments in time (every half period). At other moments (one fourth period later), the peaks of both waves will coincide (and so will their troughs). 

In the figure above, the red and green wave move in opposite directions, the blue wave is the sum of both. If the red and green wave moved in the same direction and the phase difference was 180° (meaning peaks of one coincide with troughs of the other), they would indeed cancel each other out at all times.
(image by Yuta Aoki, wikipedia commons)
A: Interactive demonstration here!
(Drag the lower right corner of the window to enlarge or click on the upper left corner to enter fullscreen mode)
You can see how the blue wave moving towards the right side and the red wave moving towards the left side with the same velocity create the green standing wave. Turn frequency up to better observe this effect.
A: You use "in the same direction" two different ways here.
The first use, "peaks and troughs in the same direction," is talking about the amplitude of the wave, which is the measured in a non-spatial dimension. For example, the pressure in a sound wave can be said to be "higher" or "lower" than the average, even though pressure has no spatial direction in general.
The second use is spatial. If you have two emitters on opposite sides of a box, one emits waves "left to right" and the other emits waves "right to left" and those can generate a standing wave.
A: If we avoid all complex numbers and consider the simplest scalar wave, the two waves that are combined have the following dependence on space and time:
$$ y_\pm(x,t) = \sin(\omega t \pm kx) $$
These are two equations for $y_+$ and $y_-$, respectively. They're sine waves but the argument only depends on the sum and difference of $\omega t$ and $kx$ so the wave moves to the left or to the right. The sum of these two different cosines isn't zero in general. You may see that for $t=0$, the two waves indeed do cancel, and they do for $t=\pi N / \omega$, too. However, for $t=\pi/2\omega+\pi N / \omega$, they constructively add.
If you know the formulae for adding cosines etc., you may see that
$$y_+(x,t)+y_-(x,t) = 2\sin\omega t \cdot \cos kx $$
So that's a standing wave. The dependence on $x$ is purely $\cos kx$, up to an overall normalization. The shape doesn't change. Only the total amplitude changes as a function of time, as $2\sin\omega t$. Note that when $y(x,t)=0$ for all $x$ and a certain moment $t$, it doesn't mean that the energy has disappeared. The potential/tension energy in $y$ disappears but at that moment, the speed of $y$ and therefore the kinetic energy is maximized.
P.S.: I have replaced sines by cosines and vice versa several times. There are many ways to convey the same ideas, the sines and cosines only differ by a phase shift.
A: Mathematically this can easily be seen:
Let the waves be given by $A \cos(kx-\omega t)$ and $A \cos(kx+\omega t)$. If we superpose both of them, then according to the sum formula for the cosine (source) the sum of them (i.e. the resulting wave) is $2A\cos(\omega t)\cos(kx)$. This wave has a spatial dependence that is nonvarying in time and is thus standing. I do not know why the definition says that they need to have the right wavelength, maybe I'm not seeing something here. But to cancel out, the waves would need to be exactly of opposite sign and magnitude at each point and time. For this to happen, we would need e.g. $A \cos(kx-\omega t)$ and $-A \cos(kx-\omega t)=A \cos(\pi-kx+\omega t)$. Adding them, we obtain a term $\cos(\frac{\pi}{2})=0$ and the resulting amplitude is really zero. So this is the type of wave that cancels our initial wave.
Explaining this without math, we need to realise that two waves cancel out exactly when at the same time and location they have same amplitude but opposite sign. Two waves travelling in opposite direction (but being the same at e.g. x=t=0) do not have this property.
A: The reason the waves do not cancel each other out at every position is that to do that the waves from the two sources must be exactly out of phase at every position and that is impossible.
Suppose that you have two sources $A$ and $B$ emitting waves of exactly the same frequency and wavelength at each other.
Further suppose that the waves are emitted from the sources are exactly in phase with one another and the sources are exactly one wavelength, $\lambda$, apart and ignore any loss of amplitude as the waves get further from the sources.

Position $C$ represents a path difference of $BC - AC = \frac \lambda 2$ between the two sources.
This means that the waves from source $B$ are $\pi, 180^\circ$ out of phase with the waves from source $A$.
So whatever the displacement of the medium due to the wave from $B$ the wave from $A$ produces a displacement of the same magnitude but opposite direction at position $C$.
So the net displacement is zero all the time.
There is certainly a cancellation of the two waves at this position and the same is true at position $E$.
These positions are called nodes.
However there are no other positions between the two sources where the waves from each source arrive $\pi$ out of phase and so there cannot be complete cancellation at any other point.
For example at position $D$ the waves from the two sources arrive exactly in phase with each other and you get twice the displacement of the medium than that due to the wave from one source.
Obviously you can increase the separation between the sources and get more nodes but in between the nodes complete cancellation is impossible.

So the standing wave pattern is so called because of the presents of positions where there is no movement of the medium (nodes) there being no net transfer of momentum or energy but there is energy associated with the standing wave itself.

I do not know if you have yet studied two source interference but in some ways the interference pattern has a resemblance to a standing wave pattern and is a standing wave pattern on a line joining the two sources.
