Worked Example - Classical Mechanics by David Morin 
Problem:   A rope wraps an angle θ around a pole. You grab one end and pull with a tension $T_0$ . The other end is attached to a large object, say, a boat. If the coefficient of static friction between the rope and the pole is $\mu$, what is the largest force the rope can exert on the boat, if the rope is not to slip around the pole?

Solution given:
Consider a small piece of the rope that subtends an angle $dθ$. Let the
tension in this piece be $T$ (which varies slightly over the small length). The pole exerts a small outward normal force, $N_{dθ}$ , on the piece. This normal
force exists to balance the “inward” components of the tensions at the ends. These
inward components have magnitude $T \sin(dθ/2)$. 1 Therefore, $N_{dθ} = 2T \sin(dθ/2)$.
The small-angle approximation, $\sin(x) ≈ x$, allows us to write this as $N_{dθ} = T dθ$.
The friction force on the little piece of rope satisfies $F_{dθ} ≤ μN_{dθ} = μT_{dθ}$. This
friction force is what gives rise to the difference in tension between the two ends of
the piece. In other words, the tension, as a function of θ, satisfies
$$T(\theta+d\theta)\le T(\theta) + \mu Td\theta \ \ \ (*) \\ \implies dT \le \mu Td\theta \\ \implies \int \frac{dT}{T} \le \int \mu d\theta \\ \implies \ln(T) \le \mu \theta + C \\ \implies T \le T_{0}e^{\mu \theta}$$
What I don't understand here is that the author says, the other end of the rope is "attached" to  the boat. Now this does not mean that the boat is "pulling" the rope with some tension....if that is the case (the boat pulling the rope with a large tension, say $T$), then I am clear on what has to be done, we accordingly assign a direction to the frictional force and we see that the force needed to hold the rope from slipping, i.e. $T_{0} \ge Te^{-\mu \theta}$, which is in accordance with the result given in the book.
But since the rope here is only "attached" to the boat, I don't see how the equation marked $(*)$ holds true...since "we" are "pulling" with a tension $T_{0}$, shouldn't the equation be (owing to the direction of friction..)
$$T(\theta + d\theta) + \mu Td \theta \le T(\theta) \\ \implies T \le T_{0}e^{-\mu \theta}$$
EDIT: I want to make my question more clear...A rope is attached to a boat, the rope is then wrapped around a pole. Now I grab the other end of the rope and pull it with a tension $T_{0}$..Then shouldn't friction oppose my action of pulling the rope?..In that case how does the equation $(*)$ hold true?
Basically, I want to know how the author arrived at the equation $(*)$...The statement "This
friction force is what gives rise to the difference in tension between the two ends of
the piece." is not very clear to me..."Difference" in what sense?
$$T(\theta + d\theta) > T(\theta) \ \ \ \ \ \text{OR}\ \ \ \ \  T(\theta) < T(\theta + d\theta)$$
The author hasn't explained this in the text, so I don't understand how the equation $(*)$ is true...as there is no explanation as to which is the chosen direction for the static friction force and why.
 A: By Newton's third law, if the rope is pulling on the boat with some force, then the boat is pulling on the rope with this same force. So either terminology is fine. By attaching the rope to the boat and by there being tension in the rope, the rope and boat are now pulling on each other.
Your proposition that $T\leq T_0e^{-\mu\theta}$ doesn't make sense, as it suggests that the more the rope is wrapped around the pole the smaller the tension can be before slipping.
To see why $T(\theta +\text d\theta)\leq T(\theta)+\mu T\text d\theta$ is correct, let's look at a simpler scenario with static friction. Let's say I have a block on a flat surface with friction, and one force $T_1$ is pulling on the block to the left, and another force $T_2$ is pulling on the block to the right. If $T_2\neq T_1$ but the block is not moving, it must be that $$|T_2-T_1|\leq\mu N$$ However, if we know what the direction of impending motion is, we can get rid of the absolute value sign. For example, if we know friction preventing the block from sliding to the right, then we know that $T_2>T_1$, and so we have $$T_2-T_1\leq \mu N$$
The same thing is happening here. We are assuming $\text dT=T(\theta+\text d\theta)-T(\theta)>0$ so that impending motion is in the direction of $\text d\theta>0$. This is why we have $T(\theta +\text d\theta)\leq T(\theta)+\mu T\text d\theta$.
Note that none of this work determines actual tensions in the system. All this work shows is the limit to $T$ before slipping occurs given values for $T_0$, $\mu$, and $\theta$.
As for why $\text dT>0$, you are right that this isn't always true, just like how in my example it doesn't have to be the case that $T_2>T_1$. To set the sign of $\text dT$ we need to either assume or reason to the direction of impending motion. The problem obviously assumes impending motion in the direction of increasing $\theta$, which I think is reasonable. I suppose it would have been better for the question to explicitly state this assumption in more detail though.
If this is still unsatisfying, then let's get technical: which is larger for $\theta>0$, $T_0e^{\mu\theta}$, or $T_0e^{-\mu\theta}$?
