Workshop on the spherical harmonics
This workshop is designed to show you the use of MAPLE to illustrate the second order spherical harmonics.

The above formula is only valid for positive values of m. For negative values of m use the following relation.
![]()
Linear combinations of these functions correspond to the d-orbitals of the hydrogen atom. The definitions of theta and phi are reversed in the MAPLE from our definition. Once you figure this out you can plot the spherical harmonics with no problem.
To obtain Y22(
q,f),Y21(q,f),Y20(q,f),Y2,-1(q,f),Y2,-2(q,f) type in the following function definitions at the MAPLE prompt (or simply copy and paste them into MAPLE one by one):
> y22:=.25*sqrt(15/(2*Pi))*(sin(phi))^2*exp(2*I*theta);
> y21:=-sqrt(15/(2*Pi))*sin(phi)*cos(phi)*exp(I*theta);
> y20:=.25*sqrt(5/Pi)*(1.5*cos(phi)^2-.5);
> y2neg1:=sqrt(15/(2*Pi))*sin(phi)*cos(phi)*exp(-I*theta);
> y2neg2:=.25*sqrt(15/(2*Pi))*(sin(phi))^2*exp(-2*I*theta);
At this point you have defined the functions. Now you can plot them using the following commands
> plot3d(Re(y22),theta=0..2*Pi,phi=0..Pi, coords=spherical, axes=normal, labels=[x,y,z], scaling=CONSTRAINED);

> plot3d(Re(y21),theta=0..2*Pi,phi=0..Pi, coords=spherical, axes=normal, labels=[x,y,z], scaling=CONSTRAINED);

> plot3d(Re(y20),theta=0..2*Pi,phi=0..Pi, coords=spherical, axes=normal, labels=[x,y,z], scaling=CONSTRAINED);

Note that the d-orbitals are actually linear combinations of the spherical harmonics. For example,
![]()
> dxy:=.25*sqrt(15/(2*Pi))*(sin(phi))^2*sin(2*theta);
> plot3d(dxy,theta=0..2*Pi,phi=0..Pi, coords=spherical, axes=normal, labels=[x,y,z], scaling=CONSTRAINED);

The probability is proportional to the square of the wavefunction. The probability for dxy is:
> dxy_2:=.0625*(15/(2*Pi))^0.25*(sin(phi))^4*sin(2*theta)^2;
> plot3d(dxy_2,theta=0..2*Pi,phi=0..Pi, coords=spherical, axes=normal, labels=[x,y,z], scaling=CONSTRAINED);
