pde – Solving the wave equation with initial conditions $ u_x = 0 $ in $ x = 0, pi $

So, we have,

$ u_ {tt} -c ^ 2u_ {xx} = 0 $, with initial conditions $ u_x = 0 $ to $ x = 0, pi $

Without loss of generality, let's take $ c = 1 $, and suppose that our solution is in the form. $ u (x, t) = X (x) T (t) $. Then we can rewrite our equation as,

$ XT ^ {& # 39; & # 39;} = X ^ {& # 39; & # 39;} T $

$ frac {T ^ {& # 39; & # 39;}} {T} = frac {X {& # 39; & # 39;}} {X} = – lambda $, where $ lambda> 0 $ It is our separation constant.

Solving the X equation:

$ X ^ {& # 39; & # 39;} + lambda X = 0 implies X = Acos ( sqrt { lambda} x) + Bsin ( sqrt { lambda} x) $

We differentiate this equation to apply the initial conditions.

$ X ^ {& # 39;} = – sqrt { lambda} A sin ( sqrt { lambda} x) + sqrt { lambda} B cos ( sqrt { lambda} x) $

Using the first initial condition we obtain:

$ 0 = sqrt { lambda} B implies B = 0 $

Then our $ X ^ {& # 39;} $ the equation is reduced to

$ X ^ {& # 39;} = – sqrt { lambda} A sin ( sqrt { lambda} x) $

Applying the second initial condition you get …

$ 0 = – sqrt { lambda} A sin ( sqrt { lambda} pi) $, for a non-trivial solution we solve $ sin ( sqrt { lambda} pi) = 0 $

$ implies sqrt { lambda} pi = n pi implies sqrt { lambda} = n $

So the equation of X is,

$ X ^ {& # 39;} = -nA_n sin (n pi x) $

Then integrating,

$ X = frac {A_n} { pi} cos (n pi x) $

Is this the correct solution for the X equation? Thank you!