In mathematics, Stirling formula has its own importance. It is also known as Stirling's approximation which is based upon the most important theory of approximation, called interpolation of functions. Interpolation is defined as finding the value of a function within a certain limit with the help of other given values. Interpolation formulas are those which give an approximate value for y = f(x) by using the techniques of interpolation. Stirling formula is one of them. The interpolation polynomial Pn(x) of degree n can be uniquely determined by Stirling formula. At given points x$_{0}$, x$_{1}$, ..., x$_{n}$, the values of this polynomial coincide with y$_{0}$,  y$_{1}$, …, y$_{n}$ of given function f at respective points.

The Stirling formula has theoretical importance as well as practical applications in construction of numerical methods in order to solve a number of problems, such as numerical integration and numerical differentiation and many engineering problems. Let us go ahead and understand about the Stirling formula and problems based on it.

Stirling formula is a central difference interpolation formula, which is used for interpolation near the middle value of the table. It is given by:

$y_{p} = y_{0} + p$ ($\frac{(\Delta y_{0}+ \Delta y_{-1} )}{2}$) + $\frac{p^{2}}{2!}$ $\Delta ^{2} y_{-1}$ + $\frac{p(p^{2} -1)}{3!}$ ($\frac{\Delta^{3}y_{-1}+\Delta^{3}y_{-2}}{2}$) + $\frac{p^{2}(p^{2}-1)}{4!}$ $\Delta^{4}y_{-2}$ + ......

which is called Stirling's formula.

Since, $\frac{(\Delta y_{0}+ \Delta y_{-1})}{2}$ =  $\frac{\delta y_{\frac{1}{2}}+ \delta y_{\frac{-1}{2}}}{2}$ = $\mu \delta y_{0}$

$\Delta^{2}y_{-1}$ = $\delta^{2} y_{0}$

$\delta^{4} y_{-2}$ =  $\delta^{4} y_{0}$

and $\frac{\Delta^{3}y_{-1} + \Delta^{3}y_{-2} }{2}$

= $\frac{\delta ^{3}y_{\frac{1}{2}} + \delta^{3} y_{-\frac{1}{2}}}{2}$ = $\mu \delta^{3} y_{0}$ and so on

Stirling's formula can also be written as:

$y_{p}$ = $y_{0}$ + $p(\mu \delta y_{0})$ + $\frac{p^{2}}{2!}$ $(\delta^{2}y_{0}$) + $\frac{p(p^{2}-1)}{3!}$ $(\mu \delta^{3}y_{0})$ + $\frac{p^{2}(p^{2}-1)}{4!}$  $\delta^{4}y_{0}$ + .........
While doing differentiation using Stirling's formula, below are some points to be taken most care of:

1) $\frac{dy}{dx}$$\frac{1}{h}$ [$(\frac{\Delta y_{0}+ \Delta y_{-1}}{2})$] + $p(\Delta ^{2}y_{-1})$ +$\frac{3p^{2}-1}{6}$ [$\frac{\Delta ^{3}y_{-1} + \Delta y_{-2}}{2}$]+ ..........

2) $\frac{d^{2}y}{dx^{2}}$ = $\frac{1}{h^{2}}$ [$\Delta ^{2}y_{-1}$ + p[$\frac{\Delta ^{3}y_{-1}+\Delta ^{3}y_{-2}}{2}$ ]+ .........]
Particular cases are obtained, when p = 0i.e., for x = x$_{0}$
Given below are some examples on Stirling's formula:
Example 1: By using Stirling's formula, find f(35) from the following values.

 x  20 30
40 
50
 f(x)  512  439  346  243

Solution: Here x$_{0}$ + ph = 35
30 + p(10)
= 35
$\Rightarrow$ p = 0.5

x
f(x)
 $\Delta$ $\Delta^{2}$
$\Delta^{3}$
 20  512      
   -73  
30  439    -20  
   -93  10
 40  346    -10  
   -103  
 50  243      

By stirling's formula:

y$_{p}$ = y$_{0}$ + p($\mu$ $\delta$ y$_{0}$)  + $\frac{p^{2}}{2!}$ ($\delta$ $^{2} y_{0}$) + $\frac{p (p^{2} - 1) }{3!}$($\mu \delta^{3} y_{0}$) + ...........

y(35) = 439 + 0.5 ($\frac{-73-93}{2})$ + $\frac{0.5^{2}}{2}$ (-20)

f(35) = 395

Example 2: A slider in a machine moves along a fixed straight rod. Its distance x cm along the rod  is given below for various values of the time t seconds. Find the velocity of the slider and its acceleration when t = 0.3s

 t   
0 0.1
 0.2  0.3  0.4  0.5  0.6
 x 
 30.13  31.62 32.87  33.64  33.95  33.81  33.24

Solution:

The difference table is:

t
 x $\delta$ $\delta$$^{2}$  $\delta$$^{3}$ $\delta$$^{4}$
 $\delta$$^{5}$ $\delta$$^{6}$
0
 30.13            
   1.49     
 0.1  31.62    -0.24        
   1.25  -0.24   
 0.2  32.87    -0.48    0.26    
   0.77  0.02  -0.27 
 0.3  33.64    -0.46    -0.01    0.29
   0.31  0.01  0.02 
 0.4  33.95   -0.45    0.01    
   -0.14  0.02   
 0.5  33.81    -0.43        
   -0.57     
 0.6  33.24            

As the derivatives are required near the middle of the table, we use Stirling's formulae

f'(a) = $\frac{1}{h}$ [$\mu \delta f(a)$ - $\frac{1}{6}$ $\mu \delta^{3}$ f(a) + $\frac{1}{30}$ $\mu \delta^{5}$ f(a) - ..................]

f"(a) = $\frac{1}{h_{2}}$ [$\delta^{2}$f(a) - $\frac{1}{12}$ $\delta^{4}$ f(a) + $\frac{1}{90}$ $\delta^{6}$ f(a) - .................]

Here h = 0.1, a = 0.3, $\mu$ f(0.3) = $\frac{1}{2}$  (0.77 + 0.31) = 0.54

$\mu \delta^{3}$ f(0.3) = $\frac{1}{2}$ (0.02 + 0.01) = 0.015

$\mu \delta^{5}$ f(0.3) = $\frac{1}{2}$ (-0.27 + 0.02) = - 0.125

f'(0.3) = $\frac{1}{0.1}$ [0.54 - $\frac{1}{6}$ ( 0.015) + $\frac{1}{30}$ (-0.125)] = 5.34

Also, f"(0.3) = $\frac{1}{0.1^{2}}$ [ -0.46 -$\frac{1}{12}$(-0.01) + $\frac{1}{90}$(0.29)]

= - 45.6

Hence the required velocity is 5.34cm/s and acceleration is -45.6 cm/s$^{2}$.