Wave packet expression and Fourier transforms I read in the Wikipedia article on wave packets that a wave packet is defined as: 
$$ \psi(x,t)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{+\infty}g(k)e^{i(kx-\omega t)}\mathrm dk\tag a $$ 
where 
$$ g(k)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{+\infty}\psi(x,0) e^{-ikx}\mathrm dx\tag b$$
Now I'd like to understand mathematically where these formulas come from. 
As an initial example, if you put $t=0$ in $\rm (a)$, you obtain
$$\psi(x,0)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{+\infty}g(k)e^{ikx}\mathrm dk\tag c$$ 
and 
$$ g(k)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{+\infty}\psi(x,0) e^{-ikx}\mathrm dx,\tag d$$
and these last two formulas are clear $-$ it is the Fourier reverse transform theorem. 
However, I don't understand where $\rm (a)$ comes from. I thought that maybe $(a)$ was expressed as the Fourier reverse transform of the function of the two variable $\psi(x,t)$, but in this case I obtain
$$ \psi(x,t)=\frac{1}{{2\pi}}\iint_{R^{2}}{\mathcal{F}[\psi(x,t)](w,k)} e^{i(kx+\omega t)}\:\mathrm dk\:\mathrm d\omega, \tag e$$ 
which is different from $\rm (a)$. So, finally, my question is: where does $\rm (a)$ comes from?
 A: When we write down a wavepacket, we're trying to solve the following problem: Given an initial profile for our wavepacket, $\psi(x,0)$, what will it look like in the future? In other words, we want to find $\psi(x,t)$ given $\psi(x,0)$. To solve this problem, we need to have some wave equation that tells us how the wavepacket evolves in time. For different waves in different contexts, we'll have different wave equations. But we'll assume two things about the wave equation:


*

*It is linear. This means that if $\psi_1(x,t)$ is a solution and $\psi_2(x,t)$ is a solution, then $a_1\psi_1(x,t)+a_2\psi_2(x,t)$ is a solution. Generalizing, it means that if $\psi_k(x,t)$ is a solution, so is $\int dk\ a_k\psi_k(x,t)$.

*If we start with an initial profile $\psi(x,0)=e^{ikx}$, then the solution to our wave equation is $\psi(x,t)=e^{i(kx-\omega_k t)}$, where $\omega_k$ is a constant that may depend on $k$.
You can check for yourself that generic wave equations, such as the equation for a wave on a string, or the Schrodinger equation, satisfy these properties. Now, once we know the wave equation has these properties, we can solve our problem!
First, we realize that by property (2), all functions of the form $e^{i(kx-\omega_k t)}$ are solutions to our wave equation. That means that, by property (1), any linear combination of these functions is also a solution to our wave equation. So we can write down a guess for the solution:
$$
\psi(x,t)=\frac{1}{\sqrt{2\pi}}\int dk\ g(k)e^{i(kx-\omega_kt)}
$$
So far, $g(k)$ is just some unknown function. Any choice of $g(k)$ will give a solution to the wave equation, by properties (1) and (2). But we also need our solution to match with our initial profile, $\psi(x,0)$. Plugging in $t=0$ thus gives a condition on $g(k)$:
$$
\psi(x,0)=\frac{1}{\sqrt{2\pi}}\int dk\ g(k)e^{ikx}
$$
By Fourier's theorem, we can then immediately find the $g(k)$.
$$
g(k)=\frac{1}{\sqrt{2\pi}}\int dx\ \psi(x,0)e^{-ikx}
$$
A: Well, as to where they come from...how about I give you an explanation of what each means in the context of quantum mechanics/physics?
In 1-D, any analytic function  $\psi(x)$  on  $(-\infty, +\infty)$  can be written as the infinite sum of sinusoidal functions.
Now suppose our function $\psi(x)$ is a $t=0$ "snapshot" of a time dependent function $\psi(x,t)$.
Using this snapshot, your 2nd integral, known as the Fourier transform of $\psi(x,0)$, gives you the relative strengths $g(k)$ of each wave in the infinite sum making up $\psi$. The actual amplitude of each contributing wave is $g(k)dk$, which means it's an infinitesimal amount, but some waves contribute a "bigger" infinitesimal than others.  Here, $k$ is real, but $g(k)$ is complex-valued in general.
Now suppose that all of the sinusoidal functions that sum up to the $t=0$ function are actually $t=0$ snapshots of traveling harmonic waves, where each harmonic wave moves at a phase velocity equal to  $\omega/k$  when the clock is running.  In much of physics, it is usually the case that $\omega$ is a function of $k$.  If $\omega(k)=ck$, where $c$ is a constant, then we can see that the phase velocity of every harmonic wave is the same; it's just $c$.  However, if $\omega$ is a more complicated function of $k$, then each wave that contributes to the over all $\psi$ function will travel at a different phase velocity.  This is an important concept that explains why wave packets representing particles spread out over time.
So what your first integral says is that the time-dependent complex wave function $\psi(x,t)$ is the infinite sum of traveling harmonic waves, each having a complex relative amplitude of $g(k)$.
If the component waves making up your $t=0$ wave function all travel at the same phase velocity, then you will see your wave function travel at the same velocity without changing its shape.  However, if the component waves have a range of differing phase velocities, this means that your wave function will change it's shape over time.  
If the g(k) function looks like a "bell curve" centered about some average $k_0$, then the real part of your time-dependent wave function will look like an oscillating wave packet that widens and decreases in amplitude over time as it travels.
