Problem 3: ME 303 Spring 1998
M.M. Yovanovich
S98MTPROB3.MWS
Problem 3 solution.
(a) Given
and
show that they are solutions of the Laplace equations:
and
.
(b) Given the function
on the interval
, obtain the Fourier coefficients.
(c) Write the first three terms of the Fourier series expansion of the given function
.
The Maple worksheet shows all steps required to answer the three parts of this problem.
> restart:
(a) Show that u(x,y) and v(x,y) satisfy the Laplace equations:
and
> u:= exp(-y)*cos(x); v:= exp(-y)*sin(x);
> ux:= diff(u,x); uxx:= diff(ux,x);
> uy:= diff(u,y); uyy:= diff(uy,y);
> uxx + uyy;
> vx:= diff(v,x); vxx:= diff(vx,x);
> vy:= diff(v,y); vyy:= diff(vy,y);
> vxx + vyy;
Both functions satisfy the Laplace equations:
and
.
(b) Obtain the Fourier coefficients for the function:
.
This function defined on the interval
is neither even nor odd because it consists of two terms which are odd and even. Use both Fourier cosines and sines for the expansion. Therefore we have
.
Fourier coefficients. Definitions and values.
> A0:= 1/L*Int(x/L*(1-x/L),x=0..L);
> A0:= value(A0);
> An:= 2/L*Int(x/L*(1-x/L)*cos(n*Pi*x/L),x=0..L);
> An:= value(An);
> An:= subs(sin(n*Pi) = 0, cos(n*Pi) = (-1)^n, An);
> An:= expand(An);
> An:= -2/(n^2*Pi^2)*(1 + (-1)^n);
> Bn:= 2/L*Int(x/L*(1-x/L)*sin(n*Pi*x/L), x = 0..L);
> Bn:= value(Bn);
> Bn:= expand(subs(sin(n*Pi) = 0, cos(n*Pi) = (-1)^n, Bn));
How to use Maple to find the Fourier cosine coefficients
with the integrals given in the examination question. Split the integrals into two parts and integrate.
> restart:
> A0:= 1/L*Int(x/L*(1-x/L), x = 0..L);
> A0:= value(A0);
The Fourier cosine coefficients
are determined below.
> Bn1:= 2/L*Int(x/L*cos(n*Pi*x/L),x=0..L);
> Bn2:= 2/L*Int(-(x/L)^2*cos(n*Pi*x/L),x=0..L);
Change the variable and the limits of integration by introducing
into the two integrals. With
they become the following two integrals with limits:
and
. Remember that
and
.
> An1:= 2*Int(u*cos(a*u),u = 0..1);
> An2:= 2*Int(-u^2*cos(a*u),u = 0..1);
Integrating we get the results:
> An11:= value(An1);
> An12:= subs(cos(a) = (-1)^n, sin(a) = 0, a = n*Pi, An11);
> An22:= value(An2);
> An22:= subs(cos(a) = (-1)^n, sin(a) = 0, a = n*Pi, An22);
Combining the two results we get the Fourier cosine coefficients
for the given function.
> An:= simplify(An12 + An22);
Compute the first six coefficients
.
> Anvals:= [seq(An, n = 1..6)];
Note that all odd coefficients are zero.
The Fourier sine coefficients
are determined below.
> Bn:= 2/L*Int(x/L*(1-x/L)*sin(n*Pi*x/L), x=0..L);
Again change the variable and the limits of integration by introducing
into the two integrals. With
they become the following two integrals with limits:
and
. Split the integral into two parts.
> Bn1:= 2*Int(u*sin(a*u), u=0..1);
> Bn2:= 2*Int(-u^2*sin(a*u), u=0..1);
Evalute each integral and put
.
> Bn11:= value(Bn1);
> Bn12:= subs(a = n*Pi, subs(sin(a) = 0, cos(a) = (-1)^n, Bn11));
> Bn21:= value(Bn2);
> Bn22:= subs(sin(a) = 0, cos(a) = (-1)^n, Bn21);
> Bn22:= simplify(subs(a = n*Pi, Bn22));
Combine the two results.
> Bn:= 'Bn'; #Clear Bn definition.
> Bn:= expand(Bn12 + Bn22);
Compute the first six coefficients
.
> Bnvals:= [seq(Bn, n = 1..6)];
We observe that all even coefficients are zero.
(c) First 3 terms of the Fourier series expansion of
.
> `f(x)`= A[0] + A[2]*cos(2*Pi*x/L) + B[1]*sin(Pi*x/L);
because
. Therefore,
> f(x) = 1/6 + Anvals[2]*cos(2*Pi*x/L) + Bnvals[1]*sin(Pi*x/L);
>