Beam deflections by integration method

We must derive an equation for the bending moment M(x) that acts internally at every point in the interval between x = 0 and x = L.