ClearAll["Global`*"] (*second example problem from class 31 *)

R2=((w L ((L/2)-L1))/(L2-L1));R1=w L - R2; 
Ma[x_]=((-w (x^2))/2);Mb[x_]=((-w (x^2))/2)+R1*(x-L1);
Mc[x_]=((-w (x^2))/2)+R1*(L2-L1)+w L(x-L2);  (* we did all this stuff in class alrady *)
(* and we also computed (Subscript[V, A])(x), (Subscript[V, B])(x), and (Subscript[V, C])(x)by hand. *)

yprimeA[x_]=((Integrate[Ma[x],x])/(Elast I0))+c1a; (* Basic EQN for region A... *)
yprimeB[x_]=((Integrate[Mb[x],x])/(Elast I0))+c1b;
yprimeC[x_]=((Integrate[Mc[x],x])/(Elast I0))+c1c;
(* You can see that I added the constants of integration by hand! *)

yA[x_]=Integrate[yprimeA[x],x]+c2a;
yB[x_]=Integrate[yprimeB[x],x]+c2b;
yC[x_]=Integrate[yprimeC[x],x]+c2c;

(* We have 6 new constants, so we need 6 BC's! ... *)

(Subscript[y, A])((Subscript[L, 1])) = 0   -> In region “A”, support #1 doesn’t move.
(Subscript[y, B])((Subscript[L, 1])) = 0   -> In region “B”, support #1 also doesn’t move.
(Subscript[y, B])((Subscript[L, 2])) = 0   -> In region “B”, support #2 doesn’t move.
(Subscript[y, C])((Subscript[L, 2])) = 0   -> In region “C”, support #2 also doesn’t move.
(Subscript[y', A])((Subscript[L, 1])) = (Subscript[y', B])((Subscript[L, 1]))   -> The slope at support 1 is the slope at support 1.
(Subscript[y', B])((Subscript[L, 2])) = (Subscript[y', C])((Subscript[L, 2]))   -> The slope at support 2 is the slope at support 2.

constants=Solve[{yA[L1]==0, yB[L1]==0, yB[L2]==0, yC[L2]==0, yprimeA[L1]==yprimeB[L1],yprimeB[L2]==yprimeC[L2]},{c1a,c2a, c1b,c2b,c1c,c2c}]//Flatten;

c1a=c1a/.constants;c1b=c1b/.constants;
c1c=c1c/.constants;c2a=c2a/.constants;
c2b=c2b/.constants;c2c=c2c/.constants;

Let’s put in some numbers so we can make a plot... I’m using pounds & inches for all units.

I0 = 21.0;Elast = 10*(10^6); w = 500;
L=40;L1=10;L2=25;  
(* i.e., the supports are a little on the left side *)
dymax =Min[yA[0],yC[L],yB[L/2]]; (* estimate the vertical plot scaling "dy"*)
Print["(Subscript[y, A])(x) = ",yA[x]]
Print["(Subscript[y, B])(x) = ",yB[x]]
Print["(Subscript[y, C])(x) = ",yC[x]]
plotA=Plot[yA[x],{x,0,L1},PlotRange->{{0,L},{-dymax,dymax}}];
plotB=Plot[yB[x],{x,L1,L2},PlotRange->{{0,L},{-dymax,dymax}}];
plotC=Plot[yC[x],{x,L2,L},PlotRange->{{0,L},{-dymax,dymax}}];
Show[plotA,plotB,plotC,Frame->True,FrameLabel->{"Position (inch)","Displacement (inch)"}]