What exactly is linear mass density? Consider a thin rod of length $l$ and linear mass density $\lambda = 2x$ where $x$ is position from origin (let this be the left most edge of the rod).
Now my question is, if let's say I consider a small portion of the rod with length $\Delta x$. Now what is the relation between $\Delta x$, mass of $\Delta x$ and $\lambda$? I know that the fact that $\lambda$ has an $x$ in it means that the mass of any portion of the rod depends on it's distance $x$ from the start of the rod, and that the mass of portions of the rod increase from left to right. We know that $\lambda = \frac{m}{l}$ (mass per unit length), so mass of any portion of the rod with length $l$ is just $l \times \lambda $. I can comfortably understand this for a constant $\lambda$, but this definition does not make much sense to me when $\lambda$ is not just a number that stays the same regardless of where in the rod you choose $l$ from. If we put $\lambda = 2x$ into this formula, and consider a part of rod of length $\Delta x$, the mass of that part being $2x \Delta x$, how is this equation considering how far along the rod we are? How do we even evaluate this expression to find mass of any chosen segment? Also, by using this formula, won't we get some mass that depends only on how long our chosen segment is and not on how far along the rod we are? Am I confused about what linear mass density is? Or am I confused about the meaning of $\Delta x$ in $m = \lambda \Delta x$ ?
 A: We are, or should be, comfortable with the fact that density can vary from point to point. For example the density of the atmosphere varies with position (both with height and with position on the surface) and we would define the density at any position $\mathbf x$ as the derivative:
$$\rho(\mathbf x) = \frac{dm}{dV} $$
at that position.
Linear density is just the one dimensional equivalent of this. For a one dimensional object the linear density is just:
$$ \lambda(\ell) = \frac{dm}{d\ell} $$
where $\lambda(\ell)$ may be a function of position just as in the atmosphere $\rho(\mathbf x)$ will be a function of position. You would not define the linear density to be the total mass divided by the total length any more than you would define the density of the atmosphere to be its total mass divided by its total volume.
In your particular case you have:
$$ \lambda(\ell) = 2\ell $$
so if you have a rod starting at position $\ell_1$ and ending at $\ell_2$ the total mass of the rod is simply:
$$ m = \int_{\ell_1}^{\ell_2} 2\ell~d\ell $$
