# Wave Equation for a Vibrating String

## Homework Statement

A string of length l has a zero initial velocity and a displacement y$_{0}$(x) as shown. (This initial displacement might be caused by stopping the string at the center and plucking half of it). Find the displacement as a function of x and t.

See the following link for the figure. It's the first one on the page.

http://web.physics.ucsb.edu/~physCS33/spring2011/hw1.pdf [Broken]

## The Attempt at a Solution

Now, to be honest with you all, I'm not really having trouble with the process. I understand how to find a form for y given the boundary conditions, and in fact I come up with,

y=Bn * sin(n$\pi$x/l) * cos(n$\pi$vt/l)

where Bn is equal to the fourier sine series,

Bn=2/l ∫ f(x)*sin(2$\pi$nx/l)dx.

My problem is that my answer doesn't look like that in the book, or the answer on the page I linked above. They might be equivalent, and I'm just not seeing it?

I got y=2h/$\pi^{2}$ $\sum$1/n$^{2}$ [2sin($\pi$n/2) - sin($\pi$n] sin(n$\pi$x/l) cos (n$\pi$vt/l).

I got Bn from setting f(x)=y$_{0}$(x) = 4hx/l for 0<x<l/4 and 2h-4hx/l for l/4<x<l/2.

Now my main question is -- way back to pre-algebra -- are my f(x) equations correct? I've done the fourier series integrals over and over again, and can't find any errors, and so I'm left to think that I must have concluded f(x) incorrectly.

Sorry for the pretty silly question, but I'm at a loss here!

Thanks so much.

Last edited by a moderator:

Simon Bridge
Homework Helper
You got:

y=2h/$\pi^{2}$ $\sum$1/n$^{2}$ [2sin($\pi$n/2) - sin($\pi$n] sin(n$\pi$x/l) cos (n$\pi$vt/l).

Here - let me tidy that up...

You got:
$$y(x,t)=\frac{2h}{\pi^2}\sum A_n \sin_{n=1}^\infty \frac{n\pi x}{l} \cos \frac{n\pi vt}{l}\\ A_n=\frac{1}{n^2}\left[\sin\frac{\pi n}{2} - \sin\pi n \right]$$

They got $$y(x,t)=\frac{8h}{\pi^2}\sum_{n=1}^\infty A_n\sin\frac{n\pi x}{l}\cos\frac{n\pi v t}{l}\\ A_n= \frac{1}{n^2}\left[ \sin\frac{n\pi}{4}-\sin\frac{n\pi}{2}\right]$$

Now my main question is -- way back to pre-algebra -- are my f(x) equations correct? I've done the fourier series integrals over and over again, and can't find any errors, and so I'm left to think that I must have concluded f(x) incorrectly.
Well ... I didn't see your f(x) or details of your working - but you have clearly missed something out.
What did you use for y(x,0)?

LCKurtz
Homework Helper
Gold Member
Yes, your f(x) equations are correct as you can verify by checking their values at their end points.

Yes, your f(x) equations are correct as you can verify by checking their values at their end points.

That's exactly what I did, but I guess I just convinced myself there was something I wasn't seeing there. Thanks for the confirmation!

You got:

Well ... I didn't see your f(x) or details of your working - but you have clearly missed something out.
What did you use for y(x,0)?

I used y= 4hx/l for 0<x<l/4

2h-4hx/l for l/4<x<l/2

0 for l/2<x<l

So this basically gave me two equations for An, where the first is equal to

An = 2/l (from 0 to l/4)∫(4hx/l)*sin(2$\pi$nx/l)dx

and the second, for l/4<x<l/2

An = 2/l ∫(2h-4hx/l)*sin(2$\pi$nx/l)dx

Do those look ok?

Sorry for the awful formatting!

Simon Bridge
Homework Helper
I used y= 4hx/l for 0<x<l/4

2h-4hx/l for l/4<x<l/2

0 for l/2<x<l

So this basically gave me two equations for An, where the first is equal to

An = 2/l (from 0 to l/4)∫(4hx/l)*sin(2$\pi$nx/l)dx

and the second, for l/4<x<l/2

An = 2/l ∫(2h-4hx/l)*sin(2$\pi$nx/l)dx

Do those look ok?
I'll have to check it later ... gotta go.
LCKurtz should be able to help meantime.

Sorry for the awful formatting!
If you use the quote button on any of my posts, you'll see how I did that :)
It's worth the effort to learn and you aren't doing anything very complicated.

You got:

Here - let me tidy that up...

You got:
$$y(x,t)=\frac{2h}{\pi^2}\sum A_n \sin_{n=1}^\infty \frac{n\pi x}{l} \cos \frac{n\pi vt}{l}\\ A_n=\frac{1}{n^2}\left[\sin\frac{\pi n}{2} - \sin\pi n \right]$$

They got $$y(x,t)=\frac{8h}{\pi^2}\sum_{n=1}^\infty A_n\sin\frac{n\pi x}{l}\cos\frac{n\pi v t}{l}\\ A_n= \frac{1}{n^2}\left[ \sin\frac{n\pi}{4}-\sin\frac{n\pi}{2}\right]$$

So actually, my An includes the prefactor of 2h/$\pi$$^{2}$. There's on the other hand, is independent of the constants out front. That's why I was thinking that maybe the two answers are equivalent, in that they factored those pre-factors out, but then the fact that our sin terms are different is throwing me.

I've recalculated the An integrals in my previous post over and over again, and I still can't find an error. I don't see how they would get a sin(pi/4) at all.

LCKurtz
Homework Helper
Gold Member
I've recalculated the An integrals in my previous post over and over again, and I still can't find an error. I don't see how they would get a sin(pi/4) at all.

I can't bring myself to crunch through all the steps, but I would certainly expect expressions like ##\sin\frac\pi 4## since one of the boundaries is ##\frac l 4##. That caused me to look at your formula:

An = 2/l (from 0 to l/4)∫(4hx/l)*sin(2πnx/l)dx

Are you sure that "2" belongs there?

I can't bring myself to crunch through all the steps, but I would certainly expect expressions like ##\sin\frac\pi 4## since one of the boundaries is ##\frac l 4##. That caused me to look at your formula:

An = 2/l (from 0 to l/4)∫(4hx/l)*sin(2πnx/l)dx

Are you sure that "2" belongs there?

I'm almost certain the 2pi factor belongs there. At least it certainly does in the equations for the coefficients of a fourier series, where the 2pi emerges from ω. Unless for some reason those equations are modified in this case? I know the book tends to leave off the 2pi, but that's when they're assuming a period of 2pi, which is of course not the case here.

That's why I can't see how they'd get ##\sin\frac\pi 4##, as there'd always be a 2 to cancel with the 4.

LCKurtz
Homework Helper
Gold Member
And if that 2 weren't there, to cancel the 4 you would get answers like they claim. That alone should suggest you are wrong. I'm suggesting it too. Perhaps you should look up the FS formulas again.

And if that 2 weren't there, to cancel the 4 you would get answers like they claim. That alone should suggest you are wrong. I'm suggesting it too. Perhaps you should look up the FS formulas again.

http://en.wikipedia.org/wiki/Fourier_series

Everything I've looked up suggests the 2 should be there. I'm also pretty sure I've been using the 2 in all my fourier coefficients calculations up until now. :( I thought the two arises from the fact that ω=2pi/T.

I'm sorry. I guess I'll run through the problem again without the 2, but I don't see why it shouldn't be there...

LCKurtz
Homework Helper
Gold Member
There they are using ##P## for the whole period. Most writeups use ##2p=P## so ##p## is a half period. In your problem ##p = l## is a half period.

There they are using ##P## for the whole period. Most writeups use ##2p=P## so ##p## is a half period. In your problem ##p = l## is a half period.

Yep, I just got that. Makes sense now. Thank you so much!

Although, can I ask, how would one know (without knowing the answer) that the period is in fact 2l and not l, like I wrongly assumed it was, just from reading the problem/looking at the image. Ah man, feeling rather stupid.

LCKurtz
Homework Helper
Gold Member
Yep, I just got that. Makes sense now. Thank you so much!

Although, can I ask, how would one know (without knowing the answer) that the period is in fact 2l and not l, like I wrongly assumed it was, just from reading the problem/looking at the image. Ah man, feeling rather stupid.

Since your string is on the interval ##[0,l]## and you are doing a half range sine expansion for it, that tells you that you are imagining the odd extension of the string to ##[-l,0]## extended periodically. So the period must be ##2l##.

Since your string is on the interval ##[0,l]## and you are doing a half range sine expansion for it, that tells you that you are imagining the odd extension of the string to ##[-l,0]## extended periodically. So the period must be ##2l##.

Hm, ok, fair enough. Thank you so much for all the help. I knew it was going to come down to something silly.

Hm, I was able to work through the problem, correcting for the period, and it looks like I'm now only off by a factor of 2. A friend of mine is also having the same problem. Not sure if we can chalk it up textbook error, or just something we're not seeing...

Ah nevermind, feeling rather silly. Got it all straightened out. Thanks all for the help!

Last edited: