bc2 =
It's strange how the corrected form of bc4 is displayed. Why is L the differentiation variable and not x as in bc2 ?
syms I E L f x u0(x)
% initial equation
eq1 = diff(E*I*diff(u0,x,2),x,2) + f == 0;
% gen. sol.
eq2 = dsolve(eq1);
% part. sol.
Du0 = diff(u0,x,1); DDu0 = diff(u0,x,2);
bc1 = u0(0) == 0 ; % Displacement at x = 0 is 0
bc2 = Du0(0) == 0 % Slope at x = 0 is 0
bc3 = u0(L) == 0 ; % Displacement at x = L is 0
bc4 = DDu0(L) == 0 % Moment at x = L is 0
eq3 = dsolve( eq1 , [ bc1, bc2 , bc3 , bc4 ] );