Let's apply 1.24 to the case where the density of a rod varies linear with position, that is, , where c is a constant that won't make a difference to the final answer.