# Trying to solve wave equation with initial condition

Solve the initial value problem: $$u_{tt} - u_{xx} = 0 \\ u(x,0) = 0 \\ u_t(x,0) = \begin{cases} \cos \pi (x-1) & \text{if } 1 < x < 2 \\ 0 & \text{otherwise} \end{cases}$$ Find and draw the solution at $$t=3$$ for

(a). $$x\in (-\infty, \infty)$$.

(b). $$x\in (0, \infty)$$ with $$u_x(0,t) = 0$$.

(c). $$x\in (-\infty, 3)$$ with $$u(3,t) = 0$$.

(d). $$x\in (0,3)$$ with $$u_x(0,t)=u_x(3,t)=0$$.

For (a) since we are in the entire real line, we can just use d'Alembert's solution and obtain $$u = \sin(\pi(x-3t))-\sin(\pi(x+3t))$$, but how do we do it for the other cases that we have semi infinite domain?

For (d) we can use separation of variables, correct?

• Please do not use pictures for critical portions of your post. Pictures may not be legible, cannot be searched and are not view-able to some, such as those who use screen readers. I have edited your question to reflect this principle. – Brian Apr 9 at 3:38

You should only ask questions about a single problem. This is not the place for a homework dump.

With that being said, I'm going to solve the first problem. First, define the primitive of $$u_t(x,0)=g(x)$$ as

$$G(s) = \int g(s)\ ds = \begin{cases} \dfrac{1}{\pi}\sin\big(\pi(s-1)\big), & 1 < s < 2 \\ 0, & \text{otherwise} \end{cases}$$

Then the solution given by d'Alembert's formula is

$$u(x,t) = \frac{G(x+t) - G(x-t)}{2}$$

where you have to check case by case for both $$x+t$$ and $$x-t$$. Below is a graph ($$x$$ vs. $$t$$) of the 4 characteristic lines going through $$x=1$$ and $$x=2$$.

The numbered regions are as follows:

$$\begin{array}{rrr} \text{I}: && x - t < 1, && x + t < 1 \\ \text{II}: && x - t < 1, && 1 < x + t < 2 \\ \text{III}: && x - 1 < 1, && x + t > 2 \\ \text{IV}: && 1 < x - t < 2, && 1 < x + t < 2 \\ \text{V}: && 1 < x - t < 2, && x + t > 2 \\ \text{VI}: && x - t > 2, && x + t > 2 \\ \end{array}$$ Then, you can simplify the solution

$$u(x,t) = \begin{cases} 0, && (x,t) \in \text{I, III, VI} \\ \dfrac{1}{2\pi}\sin\big(\pi(x+t-1)\big), && (x,t) \in \text{II} \\ \dfrac{1}{2\pi}\Big[\sin\big(\pi(x+t-1)\big) - \sin\big(\pi(x-t-1)\big) \Big], && (x,t) \in \text{IV} \\ -\dfrac{1}{2\pi}\sin\big(\pi(x-t-1)\big), && (x,t) \in \text{V} \end{cases}$$

• can you give a hint in to how to approach part b) ? – Mikey Spivak Apr 11 at 3:08
• @MikeySpivak I commented on your other question. (b) is an even extension (of the above free-space solution) across $x=0$. (c) is an odd extension across $x=3$. For (d) separation of variables will do the trick. – Dylan Apr 11 at 6:11
• can you explain a little bit more? – Mikey Spivak Apr 16 at 3:28
• @MikeySpivak The solution for (b) is given by $v(x,t) = u(x,t) + u(-x,t)$ where $u(x,t)$ is the solution in (a). Similarly, the solution is (c) is given by $v(x,t) = u(x,t) - u(6-x,t)$ – Dylan Apr 16 at 17:35
• how do you get part (c)? – Mikey Spivak Apr 16 at 18:40