Problem 3: ME 303 Spring 1998

M.M. Yovanovich

S98MTPROB3.MWS

Problem 3 solution.

(a) Given [Maple Math] and [Maple Math] show that they are solutions of the Laplace equations: [Maple Math] and [Maple Math] .

(b) Given the function [Maple Math] on the interval [Maple Math] , obtain the Fourier coefficients.

(c) Write the first three terms of the Fourier series expansion of the given function [Maple Math] .

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: [Maple Math] and [Maple Math]

> u:= exp(-y)*cos(x); v:= exp(-y)*sin(x);

[Maple Math]

[Maple Math]

> ux:= diff(u,x); uxx:= diff(ux,x);

[Maple Math]

[Maple Math]

> uy:= diff(u,y); uyy:= diff(uy,y);

[Maple Math]

[Maple Math]

> uxx + uyy;

[Maple Math]

> vx:= diff(v,x); vxx:= diff(vx,x);

[Maple Math]

[Maple Math]

> vy:= diff(v,y); vyy:= diff(vy,y);

[Maple Math]

[Maple Math]

> vxx + vyy;

[Maple Math]

Both functions satisfy the Laplace equations: [Maple Math] and [Maple Math] .

(b) Obtain the Fourier coefficients for the function: [Maple Math] .

This function defined on the interval [Maple Math] 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 [Maple Math] .

Fourier coefficients. Definitions and values.

> A0:= 1/L*Int(x/L*(1-x/L),x=0..L);

[Maple Math]

> A0:= value(A0);

[Maple Math]

> An:= 2/L*Int(x/L*(1-x/L)*cos(n*Pi*x/L),x=0..L);

[Maple Math]

> An:= value(An);

[Maple Math]

> An:= subs(sin(n*Pi) = 0, cos(n*Pi) = (-1)^n, An);

[Maple Math]

> An:= expand(An);

[Maple Math]

> An:= -2/(n^2*Pi^2)*(1 + (-1)^n);

[Maple Math]

> Bn:= 2/L*Int(x/L*(1-x/L)*sin(n*Pi*x/L), x = 0..L);

[Maple Math]

> Bn:= value(Bn);

[Maple Math]

> Bn:= expand(subs(sin(n*Pi) = 0, cos(n*Pi) = (-1)^n, Bn));

[Maple Math]

How to use Maple to find the Fourier cosine coefficients [Maple Math] 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);

[Maple Math]

> A0:= value(A0);

[Maple Math]

The Fourier cosine coefficients [Maple Math] are determined below.

> Bn1:= 2/L*Int(x/L*cos(n*Pi*x/L),x=0..L);

[Maple Math]

> Bn2:= 2/L*Int(-(x/L)^2*cos(n*Pi*x/L),x=0..L);

[Maple Math]

Change the variable and the limits of integration by introducing [Maple Math] into the two integrals. With [Maple Math] they become the following two integrals with limits: [Maple Math] and [Maple Math] . Remember that [Maple Math] and [Maple Math] .

> An1:= 2*Int(u*cos(a*u),u = 0..1);

[Maple Math]

> An2:= 2*Int(-u^2*cos(a*u),u = 0..1);

[Maple Math]

Integrating we get the results:

> An11:= value(An1);

[Maple Math]

> An12:= subs(cos(a) = (-1)^n, sin(a) = 0, a = n*Pi, An11);

[Maple Math]

> An22:= value(An2);

[Maple Math]

> An22:= subs(cos(a) = (-1)^n, sin(a) = 0, a = n*Pi, An22);

[Maple Math]

Combining the two results we get the Fourier cosine coefficients [Maple Math] for the given function.

> An:= simplify(An12 + An22);

[Maple Math]

Compute the first six coefficients [Maple Math] .

> Anvals:= [seq(An, n = 1..6)];

[Maple Math]

Note that all odd coefficients are zero.

The Fourier sine coefficients [Maple Math] are determined below.

> Bn:= 2/L*Int(x/L*(1-x/L)*sin(n*Pi*x/L), x=0..L);

[Maple Math]

Again change the variable and the limits of integration by introducing [Maple Math] into the two integrals. With [Maple Math] they become the following two integrals with limits: [Maple Math] and [Maple Math] . Split the integral into two parts.

> Bn1:= 2*Int(u*sin(a*u), u=0..1);

[Maple Math]

> Bn2:= 2*Int(-u^2*sin(a*u), u=0..1);

[Maple Math]

Evalute each integral and put [Maple Math] .

> Bn11:= value(Bn1);

[Maple Math]

> Bn12:= subs(a = n*Pi, subs(sin(a) = 0, cos(a) = (-1)^n, Bn11));

[Maple Math]

> Bn21:= value(Bn2);

[Maple Math]

> Bn22:= subs(sin(a) = 0, cos(a) = (-1)^n, Bn21);

[Maple Math]

> Bn22:= simplify(subs(a = n*Pi, Bn22));

[Maple Math]

Combine the two results.

> Bn:= 'Bn'; #Clear Bn definition.

[Maple Math]

> Bn:= expand(Bn12 + Bn22);

[Maple Math]

Compute the first six coefficients [Maple Math] .

> Bnvals:= [seq(Bn, n = 1..6)];

[Maple Math]

We observe that all even coefficients are zero.

(c) First 3 terms of the Fourier series expansion of [Maple Math] .

> `f(x)`= A[0] + A[2]*cos(2*Pi*x/L) + B[1]*sin(Pi*x/L);

[Maple Math]

because [Maple Math] . Therefore,

> f(x) = 1/6 + Anvals[2]*cos(2*Pi*x/L) + Bnvals[1]*sin(Pi*x/L);

[Maple Math]

>