# Can't get PDE solution in textbook

• May 25th 2011, 03:41 AM
olski1
Can't get PDE solution in textbook
Hey guys having trouble getting the same answer in the text book.

Question: Consider solving wave equation (c=1) for string length Pi with fixed endpoints u(0,t)=0 and u(pi,t)=0 and initial velocity = 0 and displacement = 0.02sinx.

So after doing the usual steps i arrived at $u_n(x,t) = \sum_{n = 1}^\infty (Ancos(nt) + Bnsin(nt))*sin(nx)$

Using the initial conditions and fourier coefficient formula's i have Bn=0

and $An=\frac{2}{\pi } \int 0.02sin(x)*sin(nx) dx$

Can i treat these both as sin(x)? and use the trig indentity 1/2 -1/2cos(2x) to solve?

because the answer is u(x,t)=0.02costsinx and if i do that it will work.

but i just dont understand where the 'n' went in my solution :

$u_n(x,t) = \sum_{n = 1}^\infty (A_ncos(nt) + B_nsin(nt))*sin(nx)$

seeing that it should be an infinite series and the answer given is not!
• May 25th 2011, 07:11 AM
Jester
Realize that you want to calculate

$\int_0^{\pi} \sin x \sin nx\,dx$.

There will two answers depending of the value of $n$.

$n = 1\;\; \int_0^{\pi} \sin^2 x \,dx = \dfrac{\pi}{2}$ (this is where your identity comes in)

$n \ne 1\;\; \int_0^{\pi} \sin x \sin nx\,dx = \dfrac{-\sin n \pi}{n^2-1} = 0$
• May 25th 2011, 07:31 AM
HallsofIvy
Quote:

Originally Posted by olski1
Hey guys having trouble getting the same answer in the text book.

Question: Consider solving wave equation (c=1) for string length Pi with fixed endpoints u(0,t)=0 and u(pi,t)=0 and initial velocity = 0 and displacement = 0.02sinx.

So after doing the usual steps i arrived at $u_n(x,t) = \sum_{n = 1}^\infty (Ancos(nt) + Bnsin(nt))*sin(nx)$

Using the initial conditions and fourier coefficient formula's i have Bn=0

and $An=\frac{2}{\pi } \int 0.02sin(x)*sin(nx) dx$

A standard technique for integrating such a thing is to use the trig identity
sin(a)sin(b)= (1/2)(cos(a-b)- cos(a+b) so that sin(x)sin(nx)= (1/2)(cos((1-n)x)- cos((1+n)x)

But, in fact, the functions "sin(nx)" and "sin(mx)" are "orthogonal" if $m\ne n$ then $\int_{-\pi}^\pi sin(x)sin(nx)dx= 0$ as well as sin(nx) being orthogonal to cos(mx) for any m.

[/quote]Can i treat these both as sin(x)? and use the trig indentity 1/2 -1/2cos(2x) to solve?

because the answer is u(x,t)=0.02costsinx and if i do that it will work.

but i just dont understand where the 'n' went in my solution :

$u_n(x,t) = \sum_{n = 1}^\infty (A_ncos(nt) + B_nsin(nt))*sin(nx)$

seeing that it should be an infinite series and the answer given is not![/QUOTE]
$\int_{-\pi}^\pi sin(x)sin(nx) dx= 0$
as long as $n\ne 1$ while for n= 1
$\int_{-\pi}^\pi sin^2(x)= \pi$
You have $A_1= 0.002$ while $A_n= 0$ for n> 1 and $B_n= 0$ for all n.

Since
• May 25th 2011, 12:46 PM
TheCoffeeMachine
With what the experts have said in mind, if you can't recall the product-to-sum identities, let

$I = \int_{-\pi}^{\pi}\sin{x}\sin{nx}\;{dx}, ~~ J = \int_{-\pi}^{\pi}\cos{x}\cos{nx}\;{dx}$

Then calculate J+I and J-I. Of course, you will need to know the cosine double angle formulas.