y(t) = [ 1/u(t) ][ int(u(t)g(t)ds) + y_o ]

I'm currently learning IVP's right now. I noticed for some of the more simpler IVPs I just plugged in y=1 and t=0 for say y(0)=1 to find C and the particular solution.

But I came across this "formula" in my notes and I noticed that my professor used it for two different examples.

I'm curious as to whether this works for any differential equation or did it happen to only be those two examples?

(and sorry, my ability to use latex is poor)