Standing waves on string with different densities I am rather confused with the interference of waves that must occur in a string with different densities.
Say for example we have a string of length 2L. And the first L part has mass per unit length u, while the second part has mass per unit length 9u.
A wave is continuously propagated from the lighter string with the desired frequency.
Now the wave comes to the junction and some of it gets transmitted and some of it is reflected(W1) with phase difference $\pi$.  The transmitted wave hits the other end and comes back with phase difference $\pi$ and again crosses the junction(W2).  


*

*For standing waves to be formed does the W1 need to be in phase with the initial wave or does the W2 need to be in phase with the initial wave.  

*Let's assume that I observe standing waves at a frequency $ f_1, f_2, f_3 ... $  what would be the shape of the string. It can't be simple one loop,two loops, three loops respectively, as the wavelength of the wave changes when we go from one side to the other.  
 A: There is a lot of helpful information (and some great animations) on Daniel Russell's page with Acoustics and Vibration animations.
Of particular note is the fact that the amplitude of the reflected wave can be computed from the wave impedance. The wave impedance is given by
$$Z = \rho c = \sqrt{\rho T}$$
And the reflected wave amplitude is given by
$$A_r = \frac{Z_1 - Z_2}{Z_1+Z_2} A_i$$
When $Z_2 = 3Z_1$, it follows that $A_r = -\frac12 A_i$ for the wave traveling from left to right, and $A_r' = \frac12 A_i'$ for the wave traveling from right to left. The transmitted amplitude is given by
$$A_t = \frac{2Z_1}{Z_1+Z_2}$$
Traveling from low to high density, this is again $A_t = \frac12 A_i$, while from right to left it is $A_t' = \frac32 A_i'$.
Some of the bouncing of the waves is shown in this diagram:

At (a), a single pulse it traveling to the right. It partially reflects at the boundary, and a pulse of half the amplitude (and 1/3 of the wavelength) continues to the right, while the remainder is reflected and inverted at (b). At (c), the wave on the left has returned, while the one on the right is still traveling to the right. Another transmission/reflection happens, and you get an even smaller fraction of the wave on the left and a second pulse on the right at (d). If you continued this diagram, you would see that the motion on left and right is an infinite summation of waves of different amplitudes and timings; a steady state solution can only exist for certain frequencies, which we will compute below.
This diagram is what it would look like if you could give a short "kick" to the left end of the string, and watched the waves propagate. As these pulses travel back and forth, it will usually happen that the higher frequencies are damped and you are left with a standing wave. In principle you can do the same diagram with sine waves, but it would quickly look very mess - so let's go to the mathematical treatment instead:
It is known that the propagation velocity of the wave is proportional to the inverse square root of the mass per unit length; so if you have half the string at density $\rho$ and the other half at density $9\rho$, then the wave travels 3x faster in the thinner part of the string - and there should be more waves in the thick part.
To draw this, you need to find a function that is continuous in both amplitude (so string doesn't break) and the first derivative (otherwise there will be infinite acceleration at the "kink" until it's smooth again). This means that to the left of the center, it's of the form
$$y = A_1 \sin(k x)$$
while to the right it is
$$y = A_2 \sin(3k (2L-x))$$
(Using the $\sin$ basis function like this we enforce the boundary conditions at x=0 and x=2L).
Continuity of amplitude implies that
$$A_1 \sin(kL)=A_2\sin(3 kL)$$
and continuity of first derivative:
$$A_1 k \cos(kL)=-3 A_2 k \cos(3 kL)$$
Now we can solve for the wave number $k$ and the ratio of amplitudes in the two halves of the string. Putting $A_1=1$ for simplicity, we can divide the two equations by each other and find that
$$\tan{ kL} = -3 \tan(3 kL)$$
I am not smart enough to solve that equation - but Wolfram Alpha is. It gives me
$$\begin{align}kL &= n\pi\\
&= 2n\pi - 2\tan^{-1}\left(\sqrt{\frac13\left(13-4\sqrt{10}\right)}\right)\\
&= 2n\pi + 2\tan^{-1}\left(\sqrt{\frac13\left(13-4\sqrt{10}\right)}\right)\\
&= 2n\pi - 2\tan^{-1}\left(\sqrt{\frac13\left(13+4\sqrt{10}\right)}\right)\\
&= 2n\pi + 2\tan^{-1}\left(\sqrt{\frac13\left(13+4\sqrt{10}\right)}\right)\\
&\rm{with ~ n\in \mathbb{Z}}\end{align}$$
Here are plots of 4 different harmonics calculated from the above:

Interestingly, for the trivial mode where there is a node at the junction, the ratio of amplitudes of the waves needed for continuity is different (3:1 vs 1.5 : 1). Not sure why that is.
Disclaimer: it's possible there was a mistake in my math above... but I'm pretty sure that the principles are sound.
A: Thinking about standing waves in terms of reflections from the discontinuity in the middle is a recipe for confusion.  Here’s an easier solution.  
Since the string tension will be uniform, but the mass/length ratio changes by a factor of 9 at the midpoint, you will have to match displacement and slope at the discontinuity.
$$\begin{align}
  D(x)&=A\sin (kx) & \text{for }x&<L \\ 
  D(x)&=B\sin (3k(2L-x))&\text{for }x&>L \\ 
\\
   A\sin (kL)&=B\sin (3kL) \\ 
  A\cos (kL)&=-3B\cos (3kL) \\ 
\end{align}$$ 
Divide the first equation by the second to eliminate A & B:  $\tan (kL)=-\tfrac{1}{3}\tan (3kL)$.  You could solve this nasty little transcendental equation graphically for allowable values of k, then plug in to get A/B.  
A: I basically conclude that a standing wave comparable to that in a homogeneous string is not possible. Here is the explanation:
For a wave on a string, the fundamental vibration frequency (the lowest frequency which will result in a standing wave) is:
$$f_1 = {\sqrt{T\over{m/L}}\over2L}\quad \tag1$$ from Ref, where $T$, $m$, and $L$ are the rope section tension, mass, and length.
Higher vibration frequencies $f_2$, $f_3$... (called harmonics), which are integer multiples of the basic frequency, are achieved here by increasing tension in multiples of $T$. At these frequencies where standing waves are visible, the visible wave is the sum of waves travelling to the left and to the right along the string (see animation, where yellow is a sum of blue (moving left) and green (moving right)).
If your string has two or more sections with different mass per unit lengths, then in order to achieve a standing wave at a particular frequency:


*

*The vibration frequency must match the fundamental vibration frequency of each section of string multiplied by some integer (different integers per section are admissible, in other words, the fundamental frequency of one section can match the $2^{nd}$ or $3^{rd}$ harmonic of another section).

*The waves reflected at the interface of two string sections, moving in the opposite direction must not interfere destructively with the waves moving in the forward direction.

*Since the sections of rope are connected, they will have the same tension, so this is a constraint.
We can fulfill conditions 1 and 2 it seems, provided the string sections are vibrating at different harmonics. In your question, where one section has 9 times the linear density of another, so:
(9 x the fundamental frequency of the section with linear density $u$) = (the fundamental frequency of the section with linear density $9u$).
The insurmountable condition is that simultaneously, frequency in one section must equal frequency in the other section, and tension in one section must be equal to tension in the other section, which, as we can see in equation $1$ is impossible for sections with different linear densities.
If you choose to visualise the motion of the waves using the wave amplitude equation:
$y = A\sin({\omega t + \phi})\tag2$ from Ref, where $y$ is the vertical position where two rope sections meet, $\omega$ is the angular frequency of the vibration and $\phi$ is the phase/shift angle of the wave (constant), you reach the same constraint since:


*

*The equation merely describes motion whereby tension is already
constrained to be equal between rope sections of different linear
density.

*$\omega$ is a multiple of the fundamental vibration
frequency $f_1$.

*Therefore $\omega$ is not the same for the two
rope sections, of different linear density, meeting at a particular point.

A: To keep things simple, let's start with:

Let's assume that I observe standing waves at a frequency $f1,f2,f3$... what would be the shape of the string. It can't be simple one loop,two loops, three loops respectively, as the wavelength of the wave changes when we go from one side to the other.

The velocity of wave in a string is given by $ v = \sqrt{\frac T\mu} $ where $T$ is tension in string and $\mu $ is mass per unit length of string.
Since second part is nine times as dense than the first part, and tension in both strings is same, clearly,$$ v_1 = 3v_2$$
So wavelengths in the parts will be related as $\lambda_1 = 3\lambda_2$ as frequency of the wave will remain the same throughout the string. So the string, in its fundamental frequency, will look something like: 
For higher frequencies, just multiply the number of half-wavelengths between $AB$ and $BC$ at fundamental frequency by the level of harmonic to get the number of half-wavelengths at the $n^{th}$ harmonic.
Now let's look at this:

For standing waves to be formed does the $W_1$ need to be in phase with the initial wave or does the $W_2$ need to be in phase with the initial wave.

For fundamental standing wave, $W_2$ will be in phase with initial wave when it first meets the junction. $W_1$ won't be in phase with initial wave after the first reflection. But that will change after subsequent reflections/transmissions.
(By being in phase I mean they will oscillate on the same side of the string, and I assume you meant the same)
This is because $W_1$ will undergo a $\pi$ shift in phase when reflected at junction $B$. Also, by the time $W_2$ will travel from B to C and back to B, $W_1$ will have traveled from B to A and back three times. The $W_2$ reflected at C will undergo $\pi$ shift, and hence when it enters the first part at B, it will be in phase with the initial wave.
Hope that made sense. Otherwise, let me know in the comments..
