necessity of patch size in edge detection algorithms
Let's start to given some information.

We now that the sobel operator perform a aproximmation of the image gradient using convolution ( $ * $ ).

Then,

Being $\mathbf{A}$ an image of $n \times m$ size.

The operator $\mathbf{K}$, commonly, uses two $3 \times 3$ kernels which are convolved with the original image. Thus we have

$\mathbf{G_x} = \mathbf{K_x} * \mathbf{A} $

$\mathbf{G_y} = \mathbf{K_y} * \mathbf{A} $

Being 
$$
  \mathbf{K_x} =  
  \left[ {\begin{array}{cc}
                -1 &amp; 0 &amp; +1\\  
                -2 &amp; 0 &amp; +2\\  
                -1 &amp; 0 &amp; +1\\  
              \end{array} } \right]
$$

And,

$$
  \mathbf{K_y} =  
  \left[ {\begin{array}{cc}
                -1 &amp; -2 &amp; -1\\  
                 0 &amp; 0 &amp; 0\\  
                +1 &amp; +2 &amp; +1\\  
              \end{array} } \right]
$$

So, an extension of this kernel is a $5 \times 5$ matrix 

$$
  \mathbf{K_y} =  
  \left[ {\begin{array}{cc}
                -1 &amp; -4 &amp; -6  &amp; -4 &amp; -1\\  
                -2 &amp; -8 &amp; -12 &amp; -8 &amp; -2\\  
                 0 &amp;  0 &amp;  0  &amp;  0 &amp;  0\\
                +2 &amp; +8 &amp; +12 &amp;  8 &amp;  2\\ 
                +1 &amp; +4 &amp; +6  &amp; +4 &amp; +1\\ 
              \end{array} } \right]
$$

$$
  \mathbf{K_x} =  
  \left[ {\begin{array}{cc}
                 +1 &amp;  +2  &amp; 0 &amp; -2  &amp; -1\\  
                 +4 &amp;  +8  &amp; 0 &amp; -8  &amp; -4\\  
                 +6 &amp;  +12 &amp; 0 &amp; -12 &amp; -6\\
                 +4 &amp;  +8  &amp; 0 &amp; -8  &amp; -4\\ 
                 +1 &amp;  +2  &amp; 0 &amp; -2  &amp; -1\\ 
              \end{array} } \right]
$$

This article demonstrates how to get Sobel gradient operators analytically. For that was using linear approximation of brightness in window 3x3.  Every pixel in window has its own weight. Special weight matrix selection gives Sobel gradient operator.