Stirling's approximation for factorials is commonly written as [math]n!=n\log(n)-n+O(n)[/math].[br][br]This applet provides a visual argument towards the proof of the theorem:[br][br][math]n\log(n)-n+1\le\log(n!)\le n\log(n)-n-2\log(2)+2+\log(n+1)[/math].[br][br]Note that [math]n\log(n)-n+1=\int_1^n\log(x)dx[/math] and [math]n\log(n)-n-2\log(2)+2=\int_2^n\log(x)dx[/math].