Spherical harmonics (below image)
Schrodinger equation (below image)
What is the relationship between spherical harmonics and the schrodinger equation?
Spherical harmonics (below image)
Schrodinger equation (below image)
What is the relationship between spherical harmonics and the schrodinger equation?
This is a great question which is unfortunately backwards! Let me answer it in two parts.
As the Wikipedia page on spherical harmonics points out, spherical harmonics were developed by Laplace in 1782 to try and solve the differential equation $\nabla^2 f = 0$ in spherical coordinates, where it takes the form $$ \nabla^2 f = \frac{1}{r^2} \frac{\partial}{\partial r}\left(r^2 \frac{\partial f}{\partial r}\right) + \frac{1}{r^2 \sin\theta} \frac{\partial}{\partial \theta}\left(\sin\theta \frac{\partial f}{\partial \theta}\right) + \frac{1}{r^2 \sin^2\theta} \frac{\partial^2 f}{\partial \varphi^2} = 0,$$ which is pretty complicated! You can see why physicists prefer just the $\nabla^2 f$ abbreviation whenever we can get away with it.
So the trick that we use to solve any of these linear-partial-differential-equations is pretty common, it is called "separation of variables." It comes from observing that if $\nabla^2 f_1 = 0$ and $\nabla^2 f_2 = 0$ then it turns out that $\nabla^2 \big(c_1 f_1 + c_2 f_2\big) = 0$ for arbitrary constants $c_1, c_2$ and so if $f_1$ and $f_2$ are solutions then the "linear combinations" $c_1 f_1 + c_2 f_2$ are also a solution. Therefore, we try to create a "basis set" of solutions with the understanding that later you'll make your real solution out of our basis solutions with some extra complicated mathematics. The spherical harmonics are one of these sets of basis solutions.
Separation of variables is a useful way to derive basis solutions by assuming that they're of the form $f(r,\theta,\varphi) = R(r)~\Theta(\theta)~\Phi(\varphi).$ Obviously this is not fully general, but it usually lets us create a good basis set. And it lets us convert these complicated partial derivatives into straightforward ordinary derivatives.
When you apply this assumption above, you find,$$ r^2 \nabla^2 f = (2r~R' + r^2~R'')\Theta\Phi + (\sin\theta)^{-1} (\cos\theta~\Theta' + \sin\theta~\Theta'') R \Phi + (\sin \theta)^{-2} R \Theta \Phi'' = 0, $$ and if you divide through by $f = R\Theta\Phi$ you find that part of this equation depends on $r$, the other part depends on $\theta, \varphi$:$$ \frac{r^2 \nabla^2 f}f = \frac{2r~R' + r^2~R''}R + \frac{\cos\theta~\Theta' + \sin\theta~\Theta''}{\Theta~\sin\theta} + \frac{\Phi''}{\Phi~\sin^2 \theta} = 0, $$ Notice that the $r$ dependence is confined now to the first term, the $\varphi$ dependence is confined to the last one, and the $\theta$ dependence straddles the last two. Here's the trick: the only way this expression can be $0$ for all $r$, is if that first term is some constant number $\lambda_R$ with respect to $r$. If it's not constant, then just vary $r$ while holding $\theta, \varphi$ constant, and the expression must change from $0,$ because those second two terms remained the same and the first one changed. So if it can't change, it's some constant $\lambda_R,$ period. (Physicists like really simple logic.)
Therefore we can break it up into two parts: first we have the equation $2r~R' + r^2~R'' = \lambda_R~R,$ second there is the equation $$ \lambda_R + \frac{\cos\theta~\Theta' + \sin\theta~\Theta''}{\Theta~\sin\theta} + \frac{\Phi''}{\Phi~\sin^2 \theta} = 0. $$And then of course you can do the same trick with $\Phi''/\Phi$ must be some constant $\lambda_\Phi$, and what remains is an ordinary differential equation for $\Theta.$ So that's a very common trick for converting partial differential equations into ordinary differential equations, works quite well. The resulting family of possible $\Theta\Phi$ is called $Y^m_\ell(\theta, \varphi),$ for $\ell \in \{0, 1, 2, \dots\}$ and $m \in \{-\ell, -\ell+1, \dots, 0, 1, \dots \ell - 1, \ell\}$ and I believe that it just forces $\lambda_R = -\ell (\ell + 1).$
In summary: with pretty much all linear partial differential equations we can search for some nice separation of "here is the angular equation, here is the radial equation," and the spherical harmonics solve the angular side of the problem for Laplace's equation, with a lot of generality.
The Schrödinger equation was not derived from these spherical harmonics, to my knowledge. However the Schrödinger equation for the hydrogen atom has solutions which "look like" these spherical harmonics, as your pictures show. And, in fact, the harmonics are intimately related to these, reappearing in the solutions to the Schrödinger equation. What gives?
Well, in quantum mechanics, we associate momentums with wave-vectors, $\vec p = \hbar \vec k,$ and energies with frequencies, $E = \hbar \omega,$ in a way that can be understood most generally by simply looking at the expression for a complex plane wave, $\Psi(\vec r, t) = A~\exp\big(i \vec k \cdot \vec r - i \omega t\big).$ Therefore the momentum comes out of this wave with an operator $-i \hbar \nabla$ whereas the energy comes out of this wave with an operator $i \hbar \partial_t.$ The classical energy expression of course is $E = p^2/(2m) + U$ for some potential energy $U;$ one way to view Schrödinger's equation involves simply substituting the above into this expression to find: $$ i \hbar \frac{\partial\Psi}{\partial t} = -\frac{\hbar^2}{2m} \nabla^2 \Psi + U~\Psi.$$ So we're already hinting at the connection: both of them have a $\nabla^2$ in them!
When you solve this equation you get a "wavefunction", which tells you how the electron (or whatever particle you're modeling) is distributed over space.
What do we do with such a linear partial differential equation? Why, we separate the variables, of course! We can first try to solve the subproblem $\Psi(\vec r, t) = \psi(\vec r)~T(t).$ After doing our "divide by $\Psi = \psi~T$" trick again, we find $i \hbar T'/T = E$ for some constant $E,$ very simple to solve (with $T = e^{-i E t/\hbar}$), and what remains is simply:$$E \psi = -\frac{\hbar^2}{2m} \nabla^2 \psi + U(\vec r)~\psi.$$ This is called the time-independent Schrödinger equation. If you've understood all of this, we're ready to solve the last step.
Now suppose that $U(\vec r) = U(r)$, where $r = |\vec r|$ is simply the distance of the position from the origin: in other words, the potential is spherically symmetric, depending on nothing other than distance from the origin. One particular example of this comes from the Hydrogen atom, where the nucleus is very small and exerts a Coulomb force with potential energy going like $U(r) \propto 1/r.$
If that's true, then of course it makes a lot of sense to use spherical coordinates to expand $\psi = R\Theta\Phi$ again! But here's where things become special: after multiplying through by $r^2$ and dividing through by $\psi$ we will have exactly the expressions from above for $r^2\nabla^2 f / f$ in the appropriate spaces; I will just call these expressions $\text{R-part}$ and ${\Theta,\Phi}\text{-part}.$ Anyway the equation is: $$r^2 E = -\frac{\hbar^2}{2m} \Big(\text{R-part} + {\Theta, \Phi}\text{-part}\Big) + r^2 U(r).$$ Now draw the $E$ and the $U(r)$ into the $\hbar^2/2m$ part and you will find:$$\Big(\text{R-part} - \frac{2mr^2}{\hbar^2}\big(U(r) - E\big)\Big) ~+~ \Theta,\Phi\text{-part} ~=~ 0.$$The first term on the left-hand side is the only part which depends on $r$, therefore again, it must be a constant $\lambda_R,$ whatever that is, and we split into two equations! But what's the remaining equation? It's $$\lambda_R ~+~ \Theta,\Phi\text{-part} ~=~ 0,$$ and that's the exact same equation that Laplace solved for the spherical harmonics.
In other words, as long as the potential energy function is spherically symmetric, we can copy-and-paste Laplace's 1700s-reasoning for a 1900s-problem because the way we're messing with the equation only involves $r$-stuff, but Laplace's reasoning was about the $\theta,\varphi$-stuff in the equation. The latter stuff has not been changed.
So we can say that whereas Laplace's equation $\nabla^2 f = 0$ was solved by $$f(r, \theta\ \varphi) ~=~ \sum_{\ell=0}^\infty \sum_{m=-\ell}^\ell c_{\ell m} r^\ell Y^m_\ell(\theta, \varphi),$$ the Schrödinger equation for a spherically symmetric potential $U$, while it's more complicated, must be solved in a very similar way. In particular, the radial component is going to be some complicated set of functions which usually force $E$ to take on some discrete values, typically indexed with an $n,$ so that $E$ becomes $E_n$; then the radial component is some $f_n^\ell(r)$ and the most general solution is: $$ \Psi(r,\theta,\varphi, t) = \sum_{n=0}^\infty \sum_{\ell=0}^\infty \sum_{m=-\ell}^{\ell} c_{\ell m n} e^{-i E_n t / \hbar} ~ f^\ell_n(r) ~ Y^m_\ell(\theta, \varphi).$$All of the complexity introduced by the potential appears in $f^\ell_n,$ while Laplace's $Y^m_\ell$ just sails right through all of the mathematics unharmed.
And that's why they are the same. It's because the potential is spherically symmetric.