Solve the wave equation u_tt = c^2 * u_xx for a string of length L with initial displacement g(x) and initial velocity h(x).
To solve the wave equation with given initial conditions, we can use the method of separation of variables and superposition. We first assume a solution of the form:

u(x,t) = X(x)T(t)

Plugging this into the wave equation, we get:

X(x)T''(t) = c^2 * X''(x)T(t)

Now, divide both sides by c^2 * X(x)T(t):

T''(t)/c^2*T(t) = X''(x)/X(x)

Since the left side depends only on t and the right side depends only on x, they must be equal to a constant, say -k^2:

T''(t)/c^2*T(t) = X''(x)/X(x) = -k^2

This gives us two ordinary differential equations (ODEs):

1) T''(t) + c^2*k^2*T(t) = 0
2) X''(x) + k^2*X(x) = 0

Solving the second ODE for X(x), we have:

X(x) = A*cos(k*x) + B*sin(k*x)

We need to apply boundary conditions at x=0 and x=L:

X(0) = A = 0 since u(0,t) = 0 (the string is fixed at x=0)
X(L) = B*sin(k*L) = 0

For non-trivial solutions, sin(k*L) = 0, which implies that k*L = n*pi for some integer n. Thus, k_n = n*pi/L.

So, the spatial part of the solution is:

X_n(x) = B_n*sin(k_n*x) = B_n*sin(n*pi*x/L)

Now, let's solve the first ODE for T(t). This is a simple harmonic oscillator equation:

T''(t) + c^2*k_n^2*T(t) = 0

The solution is of the form:

T_n(t) = C_n*cos(c*k_n*t) + D_n*sin(c*k_n*t)

Now, we have u(x,t) = X_n(x)*T_n(t), but this is just one possible mode of vibration. The actual solution will be a superposition of all possible modes:

u(x,t) = sum_{n=1}^{infinity} [X_n(x)*T_n(t)] = sum_{n=1}^{infinity} [(A_n*cos(c*k_n*t) + B_n*sin(c*k_n*t))*sin(n*pi*x/L)]

We need to find A_n and B_n using the initial conditions:

g(x) = u(x,0) = sum_{n=1}^{infinity} [A_n*sin(n*pi*x/L)]
h(x) = u_t(x,0) = sum_{n=1}^{infinity} [c*k_n*B_n*sin(n*pi*x/L)]

Using Fourier sine series, we can find A_n and B_n as follows:

A_n = (2/L)*integral_0^L [g(x)*sin(n*pi*x/L) dx]
B_n = (2/c*L*k_n)*integral_0^L [h(x)*sin(n*pi*x/L) dx]

Finally, substitute A_n and B_n back into the expression for u(x,t):

u(x,t) = sum_{n=1}^{infinity} {[(2/L)*integral_0^L [g(x)*sin(n*pi*x/L) dx]*cos(c*k_n*t) + (2/c*L*k_n)*integral_0^L [h(x)*sin(n*pi*x/L) dx]*sin(c*k_n*t)]*sin(n*pi*x/L)}

This is the solution to the wave equation with initial displacement g(x) and initial velocity h(x) for a string of length L.