Consider please the two following cases:
I took a graduate course, and I naturally did the final project on something related to my research subject. I got a nice conclusion from it. It wasn't nearly enough for publication, but I later on wrote a paper that had included material I got doing my course project. The 'size' of contribution (if that has any relevance) was about half a column from the entire paper. The course lecturer hadn't helped me especially, i.e. we didn't remotely discuss publishing anything.
I did another graduate course, in which the lecturer talked about his own research. Later on, unrelated to the course, I used the methods he taught and wrote a paper based on it.
These are two unrelated cases.
I was wondering if the lecturers should be included as authors in a paper in either case.