How to add a potential to a wave equation? Imagine you have the wave equation:
$$
\frac{1}{c^2}\frac{\partial^2 u}{\partial t^2}= \nabla^2
u$$
And you have your solution wave is "confined in a box" (or with the extremes of the ropes attached). Or maybe, your rope is confined to a paraboloid well. How would you add this information to the wave equation (in a similar way to the  potential on the Schrödinger Equation).
 A: You can try to add a source term. First, I'm going to define:
$$\partial^2 \equiv \frac{1}{c^2}\frac{\partial^2}{\partial t^2} - \nabla^2$$
and so the wave equation becomes:
$$\partial^2 u = 0$$
you can add a source term like the following:
$$\partial ^2 u = J(\vec{x})$$.
In fact, in electromagnetism, the source term is the current and charge densities, which affect the electromagnetic waves.
In quantum field theory, the wave equation (for spin 0 particle) is:
$$\partial^2\psi - m^2\psi = 0$$
and it's common to add source terms which corresponds to particles:
$$\partial^2 \psi - m^2 \psi = J(\vec{x})$$

I'm not sure if that's what you want though. If you are looking at a classical situation and let's say want to add gravity to a suspended waving rope, it's better to find the lagrangian.
Each piece of a rope has elastic energy:
$$\tau(\sqrt{dx^2 +du^2} - dx)=\tau (\sqrt{1+(\frac{du}{dx})^2}-1)dx$$
(where $\tau$ is elastic constant) and gravitational potential energy:
$$dx \sigma g u$$
(where $\sigma$ is mass per unit length, and assuming u is pointing upwards.)
the total energy is:
$$E=\int dx (\sigma g u + \tau(\sqrt{1+(\frac{du}{dx})^2)} -1))$$
and if you want the rope to be moving through time, you can add the kinetic energy term:
$$dx \frac{1}{2} \sigma (\frac{du}{dt})^2 $$
So the action becomes:
$$S = \int dt T-E = \int dtdx (\frac{1}{2} \sigma (\frac{du}{dt})^2 
-\sigma g u - \tau(\sqrt{1+(\frac{du}{dx})^2)} -1))$$
You can use Euler Lagrange equations to find how the wavy rope evolves with time and you've successfully added potentials to a wave. I'm not sure which do you want so I provided both.
A: Suppose that the potential energy per unit length associated with a displacement $u$ at a point $x$, is $V(u,x)$, then the wave equation will have an extra term of the form $-\frac{\partial V}{\partial u}$ on the RHS. To see why that is, it is easiest to look at the wave-action, taking the form
$$
S=\int dtdx \frac{1}{2c^2}(\partial_tu)^2-\frac{1}{2}( \nabla u)^2
$$
In general, the action has form $S=\int \mathrm{d}t\, T-V$, where $T$ is kinetic and $V$ is potential energy. Now we simply add our extra potential, and derive the equations of motion from the Euler Lagrange equations. This leads us to
$$
0=-\frac{1}{c^2}\partial_t^2u+\nabla^2u-\partial_uV.
$$
