Pi molecular orbitals of polyenes
These pi-type MOs are most commonly derived using Hückel MO theory. I've never been a fan of Wikipedia's technical articles, so for further reading I'd suggest using the QMUL resources online, which are very comprehensive. $\require{begingroup}\begingroup \newcommand{ket}[1]{\left|#1\right&gt;} \newcommand{bra}[1]{\left&lt;#1\right|} \newcommand{braket}[1]{\left&lt; #1 \right&gt;}$



Theory

Simple Hückel theory makes some key assumptions about the forms of the MOs as well as some of the integrals involved in a typical quantum chemical calculation:


pi-type MOs are linear combinations of p-orbitals, and no other orbitals contribute (so-called "sigma-pi separation")
the value of $\braket{a|b}$ (where $\ket{a},\ket{b}$ are p-type AOs on atoms $a$ and $b$) is equal to $\delta_{ab}$ ($1$ if $a = b$, $0$ otherwise)
the value of $\braket{a|H|b}$ is


$$H_{ab} = \braket{a|H|b} = \begin{cases}\alpha \text{ if } a = b \\ \beta \text{ if atom }a\text{ is bonded to atom } b \\ 0 \text{ otherwise}\end{cases}$$

With these simplifications the secular equations

$$\mathbf{H}\mathbf{c} = E\mathbf{S}\mathbf{c}$$

can be readily solved (the derivation of the secular equations will not be presented here). Here $\mathbf{H}$ refers to the Hamiltonian matrix and $\mathbf{S}$ refers to the overlap matrix. These are defined as the matrices with elements $\mathbf{H}_{ij} = \braket{i|H|j}$ and $\mathbf{S}_{ij} = \braket{i|j}$ respectively. In simple Hückel theory the matrix $\mathbf{S}$ can be neglected as it is simply equal to the identity matrix.

$\mathbf{c}$ is a column vector and one column vector represents one MO. The elements of $\mathbf{c}$ represent the contribution of each AO to the MO. This will be clearer with an example (to follow). 

In general, for $n$ atoms there will be $n$ vectors $\mathbf{c}$ that will satisfy the secular equations, and $n$ corresponding values of the energy $E$. Thus, for the allyl cation (for example), there will be three column vectors $\mathbf{c}_1, \mathbf{c}_2, \mathbf{c}_3$ and four associated energies $E_1, E_2, E_3$.



The allyl cation



Using the atom numbering scheme as shown above, and the assumptions mentioned in the previous section, we find that the Hamiltonian matrix $\mathbf{H}$ is:

$$\mathbf{H} =
\begin{pmatrix}
\alpha &amp; \beta &amp; 0 \\
\beta &amp; \alpha &amp; \beta \\
0 &amp; \beta &amp; \alpha
\end{pmatrix}$$

For example the entry $\mathbf{H}_{12} = \beta$ because atoms 1 and 2 are bonded to each other, and the entry $\mathbf{H}_{13} = 0$ because atoms 1 and 3 are not bonded to each other.

The secular equations then reduce to the eigenvalue problem

$$\begin{pmatrix}
\alpha &amp; \beta &amp; 0 \\
\beta &amp; \alpha &amp; \beta \\
0 &amp; \beta &amp; \alpha
\end{pmatrix}
\begin{pmatrix}
c_1 \\
c_2 \\ 
c_3
\end{pmatrix} = E\begin{pmatrix}
c_1 \\
c_2 \\
c_3
\end{pmatrix}$$

Obtaining the eigenvalues and eigenvectors of a matrix is a process outlined in many maths books. The crux is that the "secular determinant" must equal zero:

$$\begin{vmatrix}
\alpha - E &amp; \beta &amp; 0 \\
\beta &amp; \alpha - E &amp; \beta \\
0 &amp; \beta &amp; \alpha - E
\end{vmatrix} = 0$$

from which one obtains the eigenvalues (here I chose an example where it's easy to do by hand, but in general you can use software like MATLAB). In increasing energy (note that $\beta &lt; 0$), they are

$$\begin{align}E_1 &amp;= \alpha + \sqrt{2}\beta &amp; E_2 &amp;= \alpha &amp; E_3 &amp;= \alpha - \sqrt{2}\beta \end{align}$$

and the corresponding eigenvectors

$$\begin{align}
\mathbf{c}_1 &amp;= \begin{pmatrix} 1/2 \\ 1/\sqrt{2} \\ 1/2 \end{pmatrix}
&amp;
\mathbf{c}_2 &amp;= \begin{pmatrix} 1/\sqrt{2} \\ 0 \\ -1/\sqrt{2} \end{pmatrix}
&amp;
\mathbf{c}_3 &amp;= \begin{pmatrix} 1/2 \\ -1/\sqrt{2} \\ 1/2 \end{pmatrix}
\end{align}$$

This means that the lowest-energy pi-type MO, $\mathbf{c}_1$, is

$$\psi_1 = \frac{1}{2}\mathrm{p}_1 + \frac{1}{\sqrt{2}}\mathrm{p}_2 + \frac{1}{2}\mathrm{p}_3$$

where $\mathrm{p}_i$ is the 2p atomic orbital on carbon $i$. Note that the coefficients all have the same sign, indicating that the p orbitals are all in phase with each other. However, the coefficient for carbon 2 (the middle carbon) is larger than the others. Hence, a sketch of this MO should technically show that the middle p-orbital makes a larger contribution than the outer two p-orbitals. This is what TAR86 meant by their comment on your question:


  Hückel MO theory will also give you different absolute values for the linear combination coefficients, whereas your drawing suggests the same coefficients throughout.


Anyway, likewise for the LUMO we have

$$\psi_2 = \frac{1}{\sqrt{2}}\mathrm{p}_1 - \frac{1}{\sqrt{2}}\mathrm{p}_3$$

Note that 1) the p orbitals have different phases (different sign of coefficient), and 2) the p orbital on carbon 2 does not contribute to the MO - this leads to the node observed in the second MO. This is why the allyl cation is electrophilic on C-1 and C-3, but not on C-2: the LUMO has zero coefficient on C-2.

All in all, considering that the allyl cation only has two electrons in the pi system, this lets us construct the MO diagram