Where does the guassian function/normal or bell curve come from? I am confused as to where the function for the normal distribtuion comes from.  Where does the e and pi come from?  In my textbook I am presented with the function,but I am unsure about where it came from.  I have spent hours on google and have yet to find a good proof that i can understand.  Come someone provide a source that shows an elementary proof of the normal curve function.  
 A: The Gaussian (normal or bell curve) arises, when you look at a huge collection of random variables and whose distribution you are not aware of.
You might want to look up Central Limit Theorem (CLT). The CLT explains why when you have a huge collections of random variables, they appear to follows the Gaussian.
A version of the CLT goes as follows.
Consider $n$ independently and identically distributed random variables, $\{X_1,X_2,\ldots,X_n\}$, with mean $\mathbb{E}(X_k) = \mu$ and variance $\mathbb{E}((X_k-\mu)^2) = \sigma^2 < \infty$. Now look at the sample mean $$S_n = \dfrac{X_1 + X_2 + \cdots + X_n}{n}$$
The central limit theorem states that $$\sqrt{n}(S_n - \mu) \to_{d} \mathcal{N}(0,\sigma^2)$$ as $n \to \infty$.
A proof for a weak version goes like this. Consider the characteristic function of the random variable $X$, say $\phi_X(t)$. Expanding using Taylor series about $0$, we get that $$\phi_{X-\mu}(t) = \phi_{X-\mu}(0) + \phi_{X-\mu}'(0) t + \dfrac{\phi_{X-\mu}''(0)}2 t^2 + \mathcal{O}(t^4/n^4) = 1 - \dfrac{\sigma^2}2 t^2 + \mathcal{O}(t^4/n^4)$$
The characteristic function for $(S_n - \mu)$ is $$\phi_{S_n - \mu}(t) = \phi_{X - \mu}(t/n)^n = \left( 1 - \dfrac{\sigma^2}2 t^2/n^2 + \mathcal{O}(t^4/n^4)\right)^n$$
Hence, the characteristic function for $Z_n = \sqrt{n}(S_n - \mu)$ is $$\phi_{Z_n}(t) = \phi_{\sqrt{n}(S_n - \mu)}(t) = \phi_{S_n - \mu}(\sqrt{n}t) = \left( 1 - \dfrac{\sigma^2}2 nt^2/n^2 + \mathcal{O}(t^4/n^2)\right)^n = \left( 1 - \dfrac{\sigma^2 t^2/2}n + \mathcal{O}(t^4/n^2)\right)^n$$
Hence, $$\lim_{n \to \infty} \phi_{Z_n}(t) = \lim_{n \to \infty} \left( 1 - \dfrac{\sigma^2 t^2/2}n + \mathcal{O}(t^4/n^2)\right)^n = \exp(-\sigma^2 t^2/2)$$
Note that the proof above is true for independent, identically distributed random variables arising from any nice probability distribution. With a little more effort, you can show that the convergence holds for independent (but not necessarily identically distributed) random variables. This is why the normal distribution is fundamental and appears everywhere in probability and statistics. The number $e$ appears since $$e = \lim_{n \to \infty} \left(1+\dfrac1n \right)^n.$$ The $\pi$ you are reffering to appears as a normalizing constant since $$\int_{-\infty}^{\infty} \exp(-x^2) dx = \sqrt{\pi}$$
A: This article may be of interest.
A: In the early 18th century, Abraham de Moivre, a Frenchman, wrote a book about probability in Latin.  Later he fled to England to escape the persecution of Protestants in France, and wrote an updated version in English, called The Doctrine of Chances.  In one chapter he considered this problem: toss a fair coin 1800 times.  What is the probability that the number of heads is between some particular number not much more than 900 and some number not much less?
An exact answer is the sum of $\dbinom{1800}{x} (1/2)^{1800}$ as $x$ goes through all the value in the specified range.  This is horribly cumbersome to compute.  De Moivre found a way to do it that approaches exactness as the number of coin tosses grows, and very accurate when it's 1800.  He showed that the standard deviation of the probability distribution is $15\sqrt{2}=\sqrt{1800/4\  {}}$ and the expected value is $900$, and the distribution is well approximated by the Gaussian probability distribution with that expected value and that standard deviation.  This has probability density
$$
\text{constant}\cdot e^{-(x-900)^2/(2(1800/4))}.
$$
He found the value of the constant numerically.  Later his friend James Stirling showed that it is
$$
\frac{1}{\sqrt{2\pi} \cdot15\sqrt{2}}.
$$
(Warning to anyone wanting to make practical use of this: If you want to know $\Pr(885\le\text{number of heads}\le910)$, note that this is equal to $\Pr(884<\text{number of heads}<911)$ and, with the bell-shaped curve, find $\Pr(884.5<\text{the random variable}<910.5)$.  This is a "continuity correction".)
Why $e$?  I don't think I'd want to answer this without going through a general explanation of why $e$ arises in calculus.  When I've tried to explain this to a class, they say things like "We don't need to know this to get an "A" in this course from other instructors!" and I think who cares?  Doesn't that mean you get more for you money from me?  To some students, understanding the material is the price they pay to get a grade; to better students, understanding the meterial is what they're there for.  At any rate, an explanation of that would make this answer much longer.  I've already posted on that topic in response to other questions here.
Why $\pi$?  In other words, how do we know that
$$
\int_{-\infty}^\infty e^{-x^2/2} \, dx = \frac{1}{\sqrt{2\pi\ {}}}\ ?
$$
I think  that question's been posted here a few times, and answered.
A: I was actually quite puzzled by this as well.  I mean, people tell us this is how random variables tend to be distributed, but they never explain why.  This post is going to kinda be me going on a journey trying to figure out the answer, starting out just as confused as you.  (And yes, I do come to a conclusion).
I made a simulation, where we take 8 random variables, from 0-8, and take the mean and show how often it tends to be each value.  It ended up displaying a bell curve, with the bump occurring at 4.  It made sense that 4 was the most common mean, but I still couldn’t quite figure out why it had to tend towards a seemingly arbitrary equation, a*e^(-bx²).  And if I fiddle around with the range, or have more and more variables averaging together, it would still approach the bell curve, so it can’t just be a coincidence.
Now, a big problem here is, there are simply way too many situations which turn up a bell curve like this.  Pachinko machines, random variable averages, test score deviations, and to prove that the bell curve relates to all of these, while not impossible, would be very long winded and tedious.  But, luckily, most of these tend to have a common factor.
It seems all of these happen to be the weighted sum of several different choices.  (And if that’s all the explanation you need, feel free to skip ahead 2 paragraphs)
With pachinko, each peg the ball hits, it’ll either go left or right, 50/50 for either possibility, so it’ll probably end up in the center.  With test answers, let’s say students understand about 90% of what their teacher says, for each problem you have a 9:1 chance of getting it right, so you’ll probably get ~90% if you’re the average student.  With random numbers, say integers from 0-10, with each number there’s just as much chance of going above 5 and going below 5, so your mean is likely to be around 5.
The main theme is that the end result is determined by several combined random/semi random possibilities.  It’s worth noting this only works if each possibility has varying numbers of different ways it could happen.  For example, this does not work with lottery numbers or cracking a safe because in that case, the result is based on what order the results come in.  However, if some crazy guy made a safe where, as long as the three numbers you entered average to a certain number, then you can get in, then I suppose every possibility would qualify in this category and each possibility would be distributed about a bell curve.
But, I’m getting ahead of myself.  So, we proved that there is some correlation between all the things that follow a bell curve.  Now we have to figure out WHY it follows a bell curve.  Well, I’m assuming you know of Pascal’s triangle.  1, 1 1, 1 2 1, 1 3 3 1, 1 4 6 4 1.  You probably know of some of it’s applications.  For example, the 4th row of Pascal’s triangle (assuming the row with only a 1 is the 0th) is 1 4 6 4 1.  And, if I were to flip 4 coins, there’s a 1/16 chance they’ll be all heads, 4/16 chance 3 will be heads and 1 will be tails, 6/16 chance of 2 heads 2 tails, 4/16 chance of 1 head 3 tails, and 1/16 chance of 4 tails (16 being because landing on heads/tails is a 1/2 chance, and there are 4 possibilities, so 1/2⁴=1/16).  Now, the coin flipping problem also falls into our “averaging up several random possibilities” qualifier.  Every heads you get brings you closer to the all heads case, and every tails you get brings you closer to the all tails case.  Naturally, the most frequent possibilities verge around the half-heads-half-tails case, and whenever there’s an even number, that’ll be the most probable one.  If you think about it, this is also how the pachinko machine works, except instead of heads and tails, we have lefts and rights.  And if we wanted to model it for the test score situation, we just have to assume all our coins have a 90% of heads and a 10% chance of tails.  Let’s say there are 4 questions.  There’s only 1 possible way we could get them all right.  But, instead of multiplying by the 1 in 2 chance four times, we multiply by the 90% chance 4 times, which yields us 65.61%.  Now, what are the chances we get 3 right and four wrong?  Well, there are 4 ways that could happen (✔️✔️✔️❌, ✔️✔️❌✔️, ✔️❌✔️✔️, ❌✔️✔️✔️), and we multiply it by 90% 3 times for the three rights and 10% one time for the 1 wrong.  We get 29.16%.  Not bad, so there’s a 94.77% chance we’ll at least get a 75%.
So, as you can see, there are a lot of situations like this that fit pascal’s triangle, so this might be a good model to use.  And lucky for us, there’s actually a formula to generate any number in pascal’s triangle.  With n being the row number, and m being how far we are from the left (the very first one with an m=0), the number at that place in the triangle is n!/(m!*(n-m)!).  For example, on row 4, this gives us 1, 4, 6, 4, 1.  Now, with a lot of these, we assume we have a ridiculously high amount of these.  With pachinko, we could have 20 rows of pegs, with test scores, we could have 50 questions.  And in a lot of cases, we can approximate large numbers by just setting the number to ∞.  Unfortunately, if we graph out what this looks like for huge numbers, we get something like this.
So, first off, let’s set it so at zero, we see the middle.  For example, if we have 50...questions, or coins, or whatever, the number at zero will show us the possibility of it being 25 to 25.  Also, it makes sense that the more of these there are, the more possibilities there’ll be, but I’d prefer to actually see what the numbers are, in relation to each other.  For example, if the 25 to 25 answer is twice as big as the 24 to 26 answer, I want to be able to see that.  So, let’s scale this down.  With a little math, I’ve determined that, if our graph is n!/(x!(n-x)!), to move it to the middle would bring us to n!/((n/2+x)!(n/2-x)!).  And, the maximum of that graph should be n!/(n/2)!². So, let’s divide the whole graph by that, we should get (n/2)!²/((n/2+x)!(n/2-x)!).  Now the maximum of the graph will be 1.  Finally, let’s replace n/2 with n, since n is just approaching ∞ anyways.

Well, this does look like a bell curve.  But, it’s way too wide.  And, according to my calculations, as n goes to ∞, it should just look like a horizontal line y=1.  So, let’s try scaling x.  At this point I kinda had to fudge it, but in the end my calculations worked out.  It turned out I had to scale x by a factor of √(n).  Here’s what happened:

Now that’s a bell curve.  Okay, so it appears that as the equation y=n!²/((n+√(n)x)!(n-√(n)x)!) approaches n=∞, we get a bell curve.  But, we’re still missing something.  We still need to prove that this is what it approaches.  For all we know, it could approach y=sech(x) or 1/√(x²+1).  There’s no concrete proof yet it approaches e^(-x²).
Well, let’s try this out.  This goes into derivative territory, so I don’t know if you’ll be comfortable with it, BUT, something way too many people on forums overlook is when you answer a question, you’re not just answering to one person, you’re answering to every google search that brings people here.  Every curious math fanatic that wants to know why the bell curve is so special may or may not come here I don’t know don’t quote me.  Anyways, let’s define a function f(x)=n!²/((n+√(n)x)!(n-√(n)x)!).  Now, I’m about to do something that’s kinda inspired by proof of induction.
Let’s assume h=1/√(n).  If we plug x into f(x), we get n!²/((n+√(n)x)!(n-√(n)x)!).  If we plug in f(x+h), though, we get n!²/((n+√(n)x+1)!(n-√(n)x-1)!), since h√(n)=1.  Let’s not forget our factorial rules, though:
(n+√(n)x+1)!=(n+√(n)x)!*(n+√(n)x+1)
(n-√(n)x-1)!=(n-√(n)x)!/(n-√(n)x)
f(x+h)=n!²/((n+√(n)x+1)!*(n-√(n)x-1)!)
f(x+h)=(n-√(n)x)/(n+√(n)x+1) * n!²/((n+√(n)x)!*(n-√(n)x)!)
f(x+h)=(n-√(n)x)/(n+√(n)x+1) * f(x)
Now, remember, we’re trying to find what happens as n->∞
n+√(n)x will approach an infinite value, and as we reach that point, n+√(n)x+1 will be basically the same as n+√(n)x.  (You should always be careful in cases like these, though, as many big mistakes can result from misusing your infinitesimals).
Now, as n->∞, 1/√(n)->0, so h->0
As h->0,
f(x+h)=(n-√(n)x)/(n+√(n)x)*f(x)
f(x+h)=(√(n)-x)/(√(n)+x)*f(x)
(√(n)+x)f(x+h)=(√(n)-x)f(x)
Divide both sides by √(n)
(1+xh)f(x+h)=(1-xh)f(x)
isolate the h
f(x+h)-f(x)=-hx(f(x)+f(x+h)
Divide both sides by h
(f(x+h)-f(x))/h=-x(f(x)+f(x+h))
Remember, this is a limit, so
lim h->0  (f(x+h)-f(x))/h  = -x(f(x)+f(x+h))
d/dx f(x) = -x(f(x)+f(x))
d/dx f(x) = -2xf(x)
df/f(x) = -2x dx
ln(f(x)) = -x²+C
f(x)=C*e^(-x²)
At x=0, f(x)=1
Ce^(0)=1
C=1
f(x)=e^(-x²)
Conclusion:
So, as we can see, pascal’s triangle approaches a bell curve as we go further and further down.  Remember, though, this only shows the amount of possibilities in a binary operation.  We still have to multiply by the exponents (like 90% to the power of however many you get right, 10% to the power of however many you get wrong).  And, if you play around with it, you’ll see doing that only moves the bump, it’s still a bell curve afterward.  Hopefully using your exponent addition and quadratic properties should give a good explanation why.  I won’t because I’ve spent two hours on this and I don’t really care that much anymore.  In addition, at the limiting case, this graph only shows how much more likely one possibility is than another (the odds of flipping 100 coins and getting 50 heads and 50 tails, while exponentially greater than the odds of 25 heads and 75 tails, is still minuscule).  But, by convention, we usually set it so that the area under the curve of the graph is 1.  And the area of the curve e^(-x²) is √(π).  I’m not gonna explain why unless I start caring again later.  Also, this only covers the case where there are 2 possibilities with each test problem/random number/coin toss.  Luckily, if there are 3, or 4, or 5 possibilities each time (like rolling dice with 6 possibilities each time), the concept is still pretty similar and while I actually don’t have an explanation for those ones, hopefully this should provide a little intuition for it.  Peace.
A: I'm not aware of an elementary derivation of the functional form itself, but I can give you my favorite bit of intuition on where it comes from.
Suppose I told you I had a function $f : \mathbb{R} \to \mathbb{R}$, and that $f(0) = 0$.  Based on this extremely limited information, I then ask you to find me $g(a \, | \, x)$, a probability density function for the value of $f(x)$.
There is one crucial observation you can make that allows you to find a partial solution.  That observation is: for any $a, \Delta \in \mathbb{R}$, intuitively speaking, it must be true that $P(f(x) = a \, | \, f(0) = 0) = P(f(x + \Delta) = b + a \, | \, f(\Delta) = b)$.  In other words, you have no reason to believe that the point $(0, 0)$ is special: you might as well rephrase the problem as what are the odds that $f$ increases by $a$ when its parameter is changed by $\Delta$? and assume that these odds are the same at any point of $f$.
We can use this to set up an integral equation.  When $f$ travels from $(0, 0)$ to $(x, ?)$, imagine it first travelling to some intermediate point $x'$ and then on to $x$ from there.  Then for any $x'$ between $0$ and $x$, it must be true that:
$$g(a \, | \, x) = \int_{-\infty}^{\infty} \, g(a' \, | \, x') g(a - a' | x - x') \, da'$$
The solution to this integral equation is:
$$\frac{1}{\sqrt{2\pi c_1x}} \, e^{-\frac{1}{2}\frac{(a - c_2 x)^2}{c_1 x}}$$
This equation is commonly referred to as the Gaussian with drift.  $c_1 x$ is the variance and $c_2 x$ is the mean.
