# Solving wave equation using Fourier series

So I have the problem as follows:

$$u_{tt} = c^2 u_{xx}(x,t), 00$$ $$u(0,t) =0, u(1,t) = 0 , t >0$$ $$u(x,0)= f(x) , u_t(x,0) = g(x) 0 < x < 1$$

For: $$f(x) = sin(\pi x)cos(\pi x) = \frac{1}{2} sin(2 \pi x)$$ $$g(x) = 0$$ $$c = \frac{1}{\pi}$$

So from my understanding: $$L = 1$$ $$u(x,t) = \sum sin(n \pi x) ( A_n cos(\frac{cn\pi t}{L}) + B_n sin(\frac{cn \pi t}{L}))$$ $$= \sum sin(n \pi x) ( A_n cos(nt) + B_n sin(nt))$$

$$A_n = 2 \int_0^1 f(x) (sin(n \pi x)) dx$$ $$B_n = \frac{2}{ n \pi} \int_0^1 g(x) sin(n \pi x) dx$$

Since $$g(x) = 0$$ , $$B_n$$ must be 0.

Thus to solve for $$(A_n)$$: $$A_n = 2 \int_0^1 \frac{1}{2} sin(2 \pi x) (sin(n \pi x)) dx$$

Should I just solve this integral by using a trig identity or is there any easier way to do this? I was looking at the solutions given by my professor but it seems very confusing. I am not sure where the $$A_n$$ values are coming from in the solution. Thank you for any guidance.

• You honestly don't need to do the integration. $\sin(2\pi x)$ is already a term in the Fourier series, with $n=2$ – Dylan Mar 2 at 4:38

Hint To evaluate $$\int_0^1 \sin 2 \pi x \sin n \pi x \,dx$$ Use the product-to-sum formula $$\sin \alpha \sin \beta = \cos \frac{\alpha - \beta}{2} - \cos \frac{\alpha + \beta}{2} .$$
Similarly evaluating gives the basic and useful fact that $$\int_0^1 \sin m \pi x \sin n \pi x \,dx \neq 0$$ iff $$m = \pm n$$.
Expand $$\Sigma a_n sin n\pi$$ to get $$a_1 sin \pi x + a_2 sin 2\pi x + a_3 sin 3\pi x + a_4 sin 4\pi x + ...$$ so on
you get $$\frac{1}{2} sin 2\pi x= a_2 sin 2\pi x$$ and rest all a's as zeroes.. so $$a_2 = \frac{1}{2}$$