In sheet music, composers use a slur to put together consecutive notes. There seem to be two kinds of slurs: one with a solid line and the other broken. My question is: when does a composer use a solid line slur, when do they use a broken line slur?
Composers may use a dashed/dotted/broken slur or phrase mark when it's optional (for example, when lyrics are irregular, as user25358 attests). It may also be used to indicate a hemiola, for example where a 3/4 bar should be treated as 6/8. That could be the case in bars 2-3 of your excerpt.
Editors may use a dashed/dotted/broken slur to indicate editorial material which has been added because the composer did not include such a phrase mark.
Beyond that, even a solid slur curve does not always indicate notes should be slurred. The same notation is often used to indicate phrasing, in which case there will be shorter curves over a subset of the notes indicating a true slur. -- Or if all notes are to be articulated, there'll be dots or bars over the notes to specify the articulation.
I have to say that in most cases (cello music) where I see a dotted slur, it means that some editor suggests the original composer might have liked a slur there even tho' the manuscript doesn't have one.
I have seen (and use) them in my music to signify a legato or soft tongued phrase. Although this is only used by some composers/arrangers for big band/jazz orchestrations (a field where dots, dashes, accents and various other ornaments have different applications over the decades.) Gotta luv those crazy jazz guys! NO RULES!!