When only part of the surface an object is in contact with has friction, what is the normal force I should use? I have the following exercise:

A uniform rod of mass $M$ is given a horizontal velocity $v$ on a rough track as shown in the figure. The surface is rough on the right side of the origin $O$ and the surface is smooth and frictionless on the left side of the origin as shown in the figure. Express the velocity of the rod as a function of distance from the origin. Also find the distance before it comes to instantaneous rest.
  

I am not able to deduce what the force of friction on a small length $\mathrm{d}x$ of the rod should be. To get the friction on that part should I consider the normal reaction of that part only or of the whole rod ? 
 A: You are correct : to calculate the friction force, you only need to consider the weight of that part of the rod resting on the rough surface, not the whole of it. 
When the block overlaps the rough area by distance $x$, the normal reaction on that portion of the block is $\frac{Wx}L$ and the friction is $F={\frac{\mu Wx}L}$.  The work done against friction in moving a short distance $dx$ is $Fdx$. The work done in moving distance $x \le L$ from the start position is ${\frac{\mu Wx^2}{2L}}$. When $x \gt L$ the friction force is $\mu W$ so the work done then is $\mu W(x-L)$.
Work done against friction gradually reduces kinetic energy to zero.  The critical point is where $x = L$.  If the block stops when $x \le L$ then
\begin{aligned}
\frac12Mv^2 &= \frac{\mu Wx^2}{2L} = \frac{\mu Mgx^2}{2L}\\
v^2 &= \frac{\mu gx^2}{L}\\
x &= v\sqrt{\frac L{\mu g}}
\end{aligned}
If the block stops at $x = L$ then $v_0^2 = \mu gL$.  If the block starts with speed $v \gt v_0$ then it will stop where
\begin{aligned}
\frac 12M(v^2-v_0^2) &= \mu Mg(x-L)\\
v^2 &= v_0^2 + 2\mu g(x-L) = \mu gL + 2\mu g(x-L) = \mu g(2x-L)\\
x &= \frac L2 + \frac{v^2}{2\mu g}
\end{aligned}
Summary : If the block starts with speed $v_0 \lt \sqrt{\mu gL}$ then it will stop at after travelling a distance $x ={ v\sqrt{\frac L{\mu g}}= \frac{Lv}{v_0}}$.  If it starts with speed $v_0 \gt \sqrt{\mu gL}$ then it will stop at after travelling a distance $x ={ \frac L2+\frac{v^2}{2\mu g} = (1+(\frac v{v_0})^2)\frac L2}$.  
A: Imagine there are two objects instead of one. One object has a certain mass, and experiences friction. The other object has another mass, and no friction. If those two objects were joined together, you would have no difficulty figuring out the equation of motion.
But actually the problem is harder than it looks: the way you have drawn it, the object has finite height; this means that there will be a torque as the object decelerates, and this torque will increase the normal force on the leading edge of the object. But unless the height of the object is given, you cannot solve for that.
A: Actually there is a normal reaction equal to $\frac{W}{2}$ on the two edges. One causes sliding friction of $\mu \frac{W}{2}$ and the other doesn't.
The amount of material under friction does not matter. You can just lump the mass on the two ends and treat them accordingly.
Edit 1
@Floris is correct, the normal reaction is not even because friction causes an applied torque and the contact forces need to react upon it.
Looking at a free body diagram (below) we have the following balance of forces

$$ \begin{align}
  F - \mu N_1 & = m \ddot{x} \\
  N_1 + N_2 - W & = 0 \\
  \frac{\ell}{2} N_1 - \frac{\ell}{2} N_2 - \frac{h}{2} \mu\,N_1 & = 0 \\
\end{align} $$
This is solved for the reaction normal forces 
$$ \begin{align}
  N_1 & = \frac{\tfrac{\ell}{2}}{\ell - \mu \tfrac{h}{2} } W\\
  N_2 & = \frac{\tfrac{\ell - \mu h}{2} } {\ell - \mu \tfrac{h}{2}} W
\end{align}$$
So the frictional force $\mu N_1$ does not depend on the position of the block over the rough surface.
