Calculating the coefficients with the Fourier series

In summary, the conversation discusses a problem involving the method of separation of variables and boundary value conditions. The solution is found using the eigenfunctions and the coefficients are calculated using the Fourier series or the Sturm-Liouville theory. There is a discrepancy in the results when using the Fourier series, which is resolved by applying the inner product formula. The conversation also addresses the issue of expanding the function in an odd or even way and offers a solution for mixed boundary conditions.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

I have to solve the following initial and boundary value problem:
$$u_t=u_{xx}, 0<x<L, t>0 (1)$$
$$u(0,t)=u_x(L,t)=0, t>0$$
$$u(x,0)=x, 0<x<L$$

I did the following:
Using the method separation of variables, the solution is of the form: $u(x,t)=X(x)T(t)$

Replacing this at $(1)$, we get:

$$\left.\begin{matrix}
X''+\lambda X=0, 0<x<L\\
X(0)=0, X'(L)=0
\end{matrix}\right\} (2)$$

$$\left.\begin{matrix}
T'+\lambda T=0, t>0
\end{matrix}\right\} (3)$$

$$u(x,0)=X(x)T(0)=x$$Solving the problem $(2)$ we get that the eigenfunctions are $$X_n(x)=\sin{(\frac{(2n+1) \pi x}{2L})}$$

Solving the problem $(3)$ we get $$T_n(t)=A_ne^{-(\frac{(2n+1) \pi}{2L})^2t}$$

So the solution of the initial problem is of the form $$u(x,t)=\sum_{n=1}^{\infty}{A_n \sin{(\frac{(2n+1) \pi x}{2L})}e^{-(\frac{(2n+1) \pi}{2L})^2t}}$$

$$u(x,0)=x \Rightarrow x=\sum_{n=1}^{\infty}{A_n \sin{(\frac{(2n+1) \pi x}{2L})}}$$

To calculate the coefficients $A_n$ can I do the following:

We expand the function $f(x)=x$ in an odd way in $[-L,L]$.
So we can write $f$ as a Fourier series:
$$f(x)=\sum_{n=1}^{\infty}{b_n \sin{(\frac{2(2n+1) \pi x}{2 \cdot 2L})}}, \text{ where } b_n=\frac{2}{4L} \int_{-L}^L{f(x) \sin{(\frac{2(2n+1) \pi x}{4L})}}dx$$

Or is it wrong to calculate these coefficients in that way?? (Wondering)
 
Physics news on Phys.org
  • #2
Or is it better to calculate them with the Sturm-Liouville theory?
 
  • #3
When I calculate the coefficients using the Fourier series, I get the following:

$$f(x)=\sum_{n=1}^{\infty}{b_n \sin{(\frac{2 (2n+1) \pi x}{2 \cdot 2L})}},$$ $$\text{ where } b_n=\frac{2}{4L} \int_{-L}^L{f(x) \sin{(\frac{2 (2n+1) \pi x}{4L})}}dx=\frac{1}{L} \int_0^L{f(x) \sin{(\frac{ (2n+1) \pi x}{2L})}}dx$$

So $$A_n=\frac{1}{L} \int_0^L{x \sin{(\frac{(2n+1) \pi x}{2})}}dx =\frac{1}{L} \frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n=\frac{4L}{(2n+1)^2 \pi^2}(-1)^n$$When I use the Sturm-Liouville theory, I get the following:

$$A_n=\frac{(f(x),X_n(x))}{||X_n||^2}$$

$$(f(x),X_n(x))=\int_0^L{f(x) \sin{(\frac{ (2n+1) \pi x}{2L})}}dx=\int_0^L{x \sin{(\frac{ (2n+1) \pi x}{2L})}}dx=\frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n$$

$$||X_n^2||=\int_0^L{\sin^2{(\frac{ (2n+1) \pi x}{2L})}}dx=\frac{L}{2}$$

So $$A_n=\frac{2}{L}\frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n=\frac{8L}{(2n+1)^2 \pi^2}(-1)^n$$The results are not the same...
What have I done wrong? (Wondering)
 
  • #4
mathmari said:
When I calculate the coefficients using the Fourier series, I get the following:

$$f(x)=\sum_{n=1}^{\infty}{b_n \sin{(\frac{2 (2n+1) \pi x}{2 \cdot 2L})}},$$ $$\text{ where } b_n=\frac{2}{4L} \int_{-L}^L{f(x) \sin{(\frac{2 (2n+1) \pi x}{4L})}}dx=\frac{1}{L} \int_0^L{f(x) \sin{(\frac{ (2n+1) \pi x}{2L})}}dx$$

So $$A_n=\frac{1}{L} \int_0^L{x \sin{(\frac{(2n+1) \pi x}{2})}}dx =\frac{1}{L} \frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n=\frac{4L}{(2n+1)^2 \pi^2}(-1)^n$$When I use the Sturm-Liouville theory, I get the following:

$$A_n=\frac{(f(x),X_n(x))}{||X_n||^2}$$

$$(f(x),X_n(x))=\int_0^L{f(x) \sin{(\frac{ (2n+1) \pi x}{2L})}}dx=\int_0^L{x \sin{(\frac{ (2n+1) \pi x}{2L})}}dx=\frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n$$

$$||X_n^2||=\int_0^L{\sin^2{(\frac{ (2n+1) \pi x}{2L})}}dx=\frac{L}{2}$$

So $$A_n=\frac{2}{L}\frac{4L^2}{(2n+1)^2 \pi^2}(-1)^n=\frac{8L}{(2n+1)^2 \pi^2}(-1)^n$$The results are not the same...
What have I done wrong? (Wondering)

Hey! (Blush)

Hmm, I don't think you have the right Fourier formula...

What you call Sturm-Liouville theory is actually an inner product formula, which does look correct.
 
  • #5
I like Serena said:
Hey! (Blush)

Hmm, I don't think you have the right Fourier formula...

What you call Sturm-Liouville theory is actually an inner product formula, which does look correct.

Ahaa! Ok! So I have to use the inner product formula in these cases? (Wondering)
 
  • #6
mathmari said:
Ahaa! Ok! So I have to use the inner product formula in these cases? (Wondering)

It boils down to the same thing.
The great discovery Fourier made was that $\{\cos(n\pi x), \sin(n\pi x) \}$ forms a basis for all square integrable functions. To find the coefficients we simply need to take the inner product.
If you apply the Fourier sine series correctly you should find the same result.
 
  • #7
I like Serena said:
It boils down to the same thing.
The great discovery Fourier made was that $\{\cos(n\pi x), \sin(n\pi x) \}$ forms a basis for all square integrable functions. To find the coefficients we simply need to take the inner product.
If you apply the Fourier sine series correctly you should find the same result.

Ahaa! Ok!

What have I done wrong at the Fourier series?? (Wondering)

Since the boundary conditions are mixed we cannot expand the function neither in an odd way nor in an even way...

What can I do in this case?? (Wondering)
 

FAQ: Calculating the coefficients with the Fourier series

What is the Fourier series?

The Fourier series is a mathematical representation of a periodic function as a sum of sinusoidal functions. It can be used to approximate any continuous, periodic function by breaking it down into simpler components.

How are coefficients calculated in the Fourier series?

The coefficients in the Fourier series are calculated using the Fourier transform, which involves integrating the function over one period and multiplying it by a complex exponential function. The resulting value is then divided by the period length to get the coefficient.

Can the Fourier series be used for non-periodic functions?

No, the Fourier series is only applicable to periodic functions. For non-periodic functions, the Fourier transform can be used to analyze the frequency components, but it cannot be used to represent the entire function.

How many coefficients are needed to accurately represent a function with the Fourier series?

The number of coefficients needed depends on the complexity of the function and the desired level of accuracy. In general, the more coefficients used, the more accurate the representation will be.

Are there any limitations to using the Fourier series?

Yes, there are some limitations to using the Fourier series. It is only applicable to periodic functions, and the function must be continuous and have a finite number of discontinuities within one period. Additionally, the Fourier series may not be able to accurately represent functions with sharp corners or abrupt changes.

Similar threads

Back
Top