# 1D Wave PDE with Nonzero Initial and Boundary Conditions

I'm not sure how to start this PDE since the initial and boundary conditions are nonzero. May someone point me in the right direction?

This is the problem:

$$u_{tt} = u_{xx}$$ $$u(x,0) = \frac{1}{2+ \sin(x)}$$ $$u_t(x,0) = -\frac{\cos(x)}{(2+ \sin(x))^2}$$ $$u(0,t) = u(2\pi,t)= \frac{1}{2+ \sin(t)}$$

Hint: The general solution of the 1D wave equation is $$u(x,t)=F(x+t)+G(x-t)$$.
• Insert the boundary conditions and figure out what $F,G$ must be. Jan 21, 2021 at 1:24
• I got $$u(x,t)= \frac{1}{2+\sin(x+t)}$$ for $$x > t$$. Is that right? Jan 21, 2021 at 4:01
• That's what I found too, though I don't see the need for $x>t$. (As a similar exercise, one can instead apply D'Alembert's formula. But said formula is derived from the above general solution so it's not actually different.) Jan 21, 2021 at 4:31
Firstly, you should get homogenous boundary conditions. Let $$v(x, t) = \frac{1}{2+ \sin(t)}$$. We will seek the solution in the form $$u(x, t) = v(x, t) + w(x, t)$$, so $$w(x, t) = u(x, t) - v(x, t)$$. After substitution $$u$$ into equation, we get $$\partial_t^2 w - \partial_x^2 w = -\frac{4 \sin (t)+\cos (2 t)+3}{2 (\sin (t)+2)^3}$$. In this case, the initial conditions will take the form $$w(x, 0) = u(x, 0) - v(x, 0) = \frac{1}{2+ \sin(x)} - \frac{1}{2}$$ and $$\partial_t w(x, 0) = \partial_t u(x, 0) - \partial_t v(x, 0) = -\frac{\cos(x)}{(2+ \sin(x))^2} + \frac{1}{4}$$, and the boundary conditions $$w(0, t) = w(2 \pi, t) =0$$. We will find $$w$$ as $$w = y + z$$, where
$$\partial_t^2 y - \partial_x^2 y = 0, y(x, 0) = \frac{1}{2+ \sin(x)} - \frac{1}{2}, \partial_t y(x, 0) = -\frac{\cos(x)}{(2+ \sin(x))^2} + \frac{1}{4}, y(0, t) = y(2 \pi, t) =0$$ $$\partial_t^2 z - \partial_x^2 z= -\frac{4 \sin (t)+\cos (2 t)+3}{2 (\sin (t)+2)^3}, z(x, 0) = \partial_t z(x, 0) = z(0, t) = z(2 \pi, t) =0$$