Simple beam theory:
Let
W(x) = force loading per unit length
V(x) = shear
M(x) = moment
Y’(x) = slope
Y(x) = deflection
V(x) = int(W(x))dx
M(x) = int(V(x))dx
Y’(x) = int(M(x))dx / [E*I]
Y(x) = int(Y'(x))dx
You may need a minus sign here or there depending on your convention. Draw a picture and make sure it makes sense.
Solve the constants of integration using your boundary conditions. For example let boundary occur at x=a (typically either 0 or L)
Simply supported: M(a)=0, Y(a)=0
Fixed: Y’(a)=0, Y(a)=0
Free: V(a)=0, M(a)=0