Is tension along the length of a massive rope resting on a table always the same? Mathematically it can be easily proved using Newton’s 2nd law that tension along the length of a massive rope just lying on a table and not accelerating, is the same. But is it always the same? It should be the same if the rope is straight, and resting horizontally on the table. What if we bend the rope sharply? Something like this 
In this case, if we consider the two sections of the rope, one that has a sharp bend and the one that is fairly straight (shown in the picture), is tension in those two sections the same? The rope is still not accelerating, so according to Newton’s 2nd law, tension in those two sections should be the same. But isn’t the part of rope that is bent feeling more stress compared to the part where the rope is fairly straight?  How can I prove it mathematically that tension in those two sections is not the same (if it's not)?
 A: On a thick object as the rope, the notion of "tension" is far from simple. There is tension per unit section area, the integral of which over the section could be considered as an "average" tension, but does not cover all the details; there is shear.... If the rope is not flat on the surface, a differential of average tension is needed to counterbalance gravity. Even if the rope is completely flat, but with stronger curves here than there (which mostly affect shear, but also tension) one should not ignore the friction of the rope on its support. The total force acting on each elementary element of volume of the rope is zero, since there is no acceleration, but is a very complicated sum of a lot of different sources.
A: 
What if we bend the rope sharply? Something like this

Thing is, I don't see anything/anyone actively bending the rope- i.e. applying an external bending force on the rope.
Generally speaking the outer fibers of the bend would be subject to tensile stress and the inner fibers compressive stress. But if there were any significant tensile or compressive stresses you would expect one of two things. Either there would be stress recovery happening, i.e., the rope would unbend itself. Or any significant stresses that did exist have cause permanent deformation of the fibers. 
The only apparent external forces that could be maintaining the curvature of the rope would be friction between the rope and the table (for the circled curved section), or friction between adjacent sections of the rope in the center area. 

In this case, if we consider the two sections of the rope, one that
  has a sharp bend and the one that is fairly straight (shown in the
  picture), is tension in those two sections the same?

Since there aren't any apparent external forces maintaining the bends, other than friction, if there are tensions in the rope they would likely be very slight, and the tension in the outer fibers of the circled curved section perhaps slightly more than the almost straight section.

The rope is still not accelerating, so according to Newton’s 2nd law,
  tension in those two sections should be the same. But isn’t the part
  of rope that is bent feeling more stress compared to the part where
  the rope is fairly straight?

Rather than thinking in terms of the rope "accelerating", think in terms of whether or not the curvature of the bends would change were it not for the friction between the rope and the table. Where the curvature spontaneously changes, stresses existed.

How can I prove it mathematically that tension in those two sections
  is not the same (if it's not)?

If we were dealing with a something made of materials that are homogeneous (uniform composition and uniform properties throughout) and isotropic (having physical properties that are the same when measured in different directions) it might be possible. But we are dealing here with natural or synthetic materials with a complex woven structure. I think rope manufacturers rely more on standardized testing to determine strength and fatigue rather than mathematical formulae. 
Hope this  helps.
A: According to me the rope will face tension the material will try to get straight but the friction between the role matter will not allow  it to do so. 
More over we can also understand it while knowing the shear modulus and that the force of friction is what which is keeping the tension up.  
Well is guess that it. 
