# Wave equation

#### Markov

##### Member
Solve

\begin{aligned} & {{u}_{tt}}={{u}_{xx}},\text{ }x\in [0,1],\text{ }t>0, \\ & u(x,0)=f(x), \\ & {{u}_{t}}(x,0)=0,\text{ }u(0,t)=u(1,t)=0 \\ \end{aligned}

where $f(x)$ is defined by $f(x)=x$ if $0\le x\le \dfrac12$ and $f(x)=1-x$ if $\dfrac12\le x\le1.$

I'm not sure how to proceed here, what's the standard way?

#### Jester

##### Well-known member
MHB Math Helper
Since you're on a finite interval (i.e. [0,1]) use separation of variables.

• Markov

#### HallsofIvy

##### Well-known member
MHB Math Helper
Another way to do this is to change variables: let s= x- y, t= x+ y. $u_x= u_ss_x+ u_tt_x= u_s+ u_t$ so that $u_{xx}= (u_s+ u_t)_x= (u_s+ u_t)_s+ (u_s+ u_t)_t= u_{ss}+ 2u_{st}+ u_{tt}$ and $u_y= u_ss_y+ u_tt_y= -u_s+ u_t$ so that $u_{yy}= -(-u_s+ u_t)_u+ (-u_s+ u_t)_t= u_{ss}- 2y_{st}+ u_{tt}$. Put those into $u_{xx}= u_{tt}$.

May I ask why you are trying to solve such an equation if you have never had any instruction in it?

Last edited:
• Markov

#### Markov

##### Member
My professor is really bad so I started to learn this by myself.

By using separation of variables, I need to set $u(x,t)=f(x)g(t)$ and substitute, right?

#### HallsofIvy

##### Well-known member
MHB Math Helper
Yes. Of course, there might not be a function of that form satisfying the initial conditions but then you could use a sum of such things.

#### Markov

##### Member
Okay but do I need to make it twice? I mean working with $0\le x\le\dfrac12,$ and then using separation of variables for the other interval?

#### Markov

##### Member
Jester, we can actually use the direct results by using separation of variables. I know the solution is a series where the coefficients must be found, but I actually want to know is if I need to pick my $f$ on one interval and then pick it from the other interval, which means that I'd have to solve two equations.

It's like:

 \begin{aligned} & {{u}_{tt}}={{u}_{xx}},\text{ }x\in [0,1/2],\text{ }t>0, \\ & u(x,0)=x, \\ & {{u}_{t}}(x,0)=0,\text{ }u(0,t)=u(1,t)=0 \\ \end{aligned}

and in the same fashion for the other. Does that make sense?