M = 5.0;
m = 1;
g = 9.81;
tmax = 10;
s=NDSolve[{(m + M) r''[t] == m r[t] ((θ'[t])^2) + m g Sin[θ[t]] - M g,m(((r [t])^2) θ''[t] + 2 r[t] r'[t] θ'[t]) == m g r[t] Cos[θ[t]], θ[0] == 0, r[0] ==2, θ'[0]==0, r'[0]==0}, {r, θ}, {t, 0, tmax}]

L=4
Plotrange={{-L,L},{-L,2}};
X[t_]:=-r[t] Cos[θ[t]]/.s; 
Y[t_] :=-r[t]Sin[θ[t]]/.s;

Animate[GraphicsRow[{Show[Graphics[{Black,Line[{{0,0},Flatten[{X[t],Y[t]}]}],Disk[Flatten[{X[t],Y[t]}],0.1], Black,Line[{{0,0},Flatten[{0,-L+(r[t]/.s)}]}],Disk[Flatten[{0,-L+(r[t]/.s)}],0.1]},PlotRange->Plotrange
],Graphics[ListLinePlot[Table[Flatten[{X[q],Y[q]}],{q,0,t,0.01}],PlotRange->Plotrange]]]}], {t,0,tmax,0.005},AnimationRate->1,RefreshRate->75]