  A particle confined to an impassable box is a paradigmatic and exactly
solvable one-dimensional quantum system modeled by an infinite square well
potential. Here we explore some of its infinitely many generalizations to two
dimensions, including particles confined to rectangle, elliptic, triangle, and
cardioid-shaped boxes, using physics-informed neural networks. In particular,
we generalize an unsupervised learning algorithm to find the particles'
eigenvalues and eigenfunctions. During training, the neural network adjusts its
weights and biases, one of which is the energy eigenvalue, so its output
approximately solves the Schr\"odinger equation with normalized and mutually
orthogonal eigenfunctions. The same procedure solves the Helmholtz equation for
the harmonics and vibration modes of waves on drumheads or transverse magnetic
modes of electromagnetic cavities. Related applications include dynamical
billiards, quantum chaos, and Laplacian spectra.
