University of Florida/Egm4313/s12.team5.R6

Question
Find the (smallest) period of $$ cos n \omega x $$ and $$ sin n \omega x $$. Show that these functions also have a period p. Show that the constant $$ a_o $$ is also a periodic function with period p.

Solution
Given (1) p.9-2: $$ f(x+np)=f(x) $$ for all $$ n (..., -2, -1, 0, 1, 2...) $$ and where p is the period. The smallest period occurs when n=1 thus we can use the equation as: $$ f(x+p)=f(x) $$

For $$ f(x) = cos (n \omega x) $$ we have: $$ f(x+p)= cos n \omega(x+p) = cos(n \omega x + n \omega p)= cos(n \omega x)cos( n \omega p)-sin(n \omega x)sin( n \omega p)  $$ Thus, $$ cos(n \omega x)cos( n \omega p)-sin(n \omega x)sin( n \omega p)=cos n \omega x $$ $$ cos(n \omega x)cos( n \omega p)=cos (n \omega x)(1) $$ $$ cos( n \omega p) = 1 $$ $$ n \omega p = 2 \pi  $$ $$  p = \frac{2 \pi}{n \omega} $$, smallest period occurs when n=1 so, $$ p =\frac{2 \pi}{\omega} $$

For $$ f(x) = sin( n \omega x) $$ we have: $$ f(x+p)= sin n \omega(x+p) = sin(n \omega x + n \omega p)= sin(n \omega x)cos( n \omega p)-cos(n \omega x)sin( n \omega p) $$

Thus, $$ sin(n \omega x)cos( n \omega p)-cos(n \omega x)sin( n \omega p)=sin( n \omega x) $$ $$ sin(n \omega x)cos( n \omega p)=sin (n \omega x)(1) $$ $$ cos( n \omega p) = 1 $$ $$ n \omega p = 2 \pi  $$ $$  p = \frac{2 \pi}{n \omega} $$, smallest period occurs when n=1 so, $$ p =\frac{2 \pi}{\omega} $$

From (1) p9-5, we know that $$ \omega = \frac{2 \pi}{p} $$ Then, $$  p = \frac{2 \pi}{\omega} = \frac{2 \pi}{\frac {2 \pi}{p}} = p $$ Thus, the period of both of these functions is also $$ p $$.

From (1) p.9-7, we know $$ a_o= \frac {1}{2L} \int_{0}^{2L} f(x) dx = \frac{1}{p}$$ Also, $$ a_o= \frac {1}{2 \pi} \int_{0}^{2 \pi} f(x) dx = \frac{1}{p} $$ Thus, $$ p = 2 \pi $$ showing $$ a_o $$ is a periodic function with period $$ p $$.

Author
This problem is solved and uploaded by Radina Dikova

Question
Is the given function even or odd or either even nor odd? Find its Fourier series. Show details of your work. $$ 11.  f(x) = x^{2}, \; (-1<x<1),  \; p=2 $$ $$ 12.  f(x) = 1- \frac {x^{2}}{4}, \; (-2<x<2), \; p=4 $$

Author
Solved and uploaded by William Knapper

Question
K 2011 p.491 pbs 15,17 Find if the graph is for an even or odd problem and then find the fourier series. Graph the resulting equations. Problem 15:

Problem 17:

Solution
For problem 15: f(-x) = -f(x), therefore the graph shows an odd function. Similarly, L = $$ \pi $$. Therefore we can use the Euler formula for an odd function: $$ f(x) = \sum_{n=1}^\infty b_n \sin(nx) $$ $$ b_n = \frac{2}{\pi} \int_0^{\pi} f(x) \sin(nx)dx $$ During $$[0,\frac{\pi}{2}]$$, f(x) = x. During $$[\frac{\pi}{2},\pi]$$, $$f(x) = \pi-x$$ Therefore, $$ b_n = \frac{2}{\pi} (\int_0^\frac{\pi}{2} x \sin(nx)dx + \int_{\frac{\pi}{2}}^{\pi} (\pi-x)\sin(nx)dx) $$ Using integration by parts shows $$ b_n $$ to be: $$ b_n = \frac{2}{\pi n^2} (2\sin(\frac{\pi}{2} n) - \sin(\pi n)) $$ when, for the first integral: $$ u = x, du = dx, dv = \sin(nx)dx, and v = -\frac{1}{n}\cos(nx) $$ and for the second integral (where u, du, v, and dv are not the same as the first integral): $$ u = \pi-x, du = -dx, dv = -\sin(nx)dx, and v = \frac{1}{n}\cos(nx) $$ Therefore, when n is odd, $$ b_n = + or - \frac{4}{\pi n^2} $$ and when n is even, $$ b_n = 0 $$ Therefore, the fourier series' are as follows: For n=2 -> $$ f(x) = \frac{4}{\pi} \sin(x) $$ For n=4 -> $$ f(x) = \frac{4}{\pi} \sin(x) + \frac{4}{\pi 9} \sin(3x) $$ For n = 8 -> $$ f(x) = \frac{4}{\pi} \sin(x) + \frac{4}{\pi 9} \sin(3x) + \frac{4}{\pi 25} \sin(5x) + \frac{4}{\pi 49} \sin(7x) $$ A graph of the fourier series' is shown below: For Problem 17: $$ f(-x) = f(x) $$ Therefore, it is an even function and L = 1. Similarly, because it's an even function, the Euler equations for an even function can be used: $$ f(x) = a_0 + \sum_{n=1}^{\infty} a_n \cos(nx) $$ $$ a_0 = \frac{1}{\pi} \int_0^{\pi} f(x)dx $$ $$ a_n = \frac{2}{\pi} \int_0^{\pi} f(x) \cos(nx)dx $$ During [0,1], $$ f(x) = 1-x $$ Therefore: $$ a_0 = \int_0^1 (1-x)dx = \frac{1}{2} $$ However, the period is not 2$$\pi$$, so in $$a_n$$ $$\cos(nx)$$ is replaced with $$cos(n\pi x)$$ to shift the function to a period of 2$$\pi$$. Similarly, $$\frac{2}{\pi}$$ is replaced with $$\frac{2}{1}$$ since L = 1. Therefore: $$ a_n = 2 \int_0^1 (f(x) \cos(n\pi x))dx = 2 \int_0^1 ((1-x) \cos(n\pi x))dx $$ Letting $$u = 1-x, du = -dx, dv = \cos(n \pi x)dx, v = \frac{1}{n \pi} \sin(n \pi x) $$ where u, du, v, and dv are not the same as was used in number 15 above. Integration by parts then yields: $$ a_n = 2(\frac{-1}{n^2 \pi^2} (\cos(n \pi) + \frac{1}{n^2 \pi^2}) $$

Therefore, when n is odd, $$a_n = \frac{4}{n^2 \pi^2}$$ and when n is even, $$a_n = 0$$ Therefore, the fourier series's are as follows: For n = 2 -> $$ f(x) = \frac{1}{2} + \frac{4}{\pi^2} \cos(\pi x) $$ For n = 4 -> $$ f(x) = \frac{1}{2} + \frac{4}{\pi^2} \cos(\pi x) + \frac{4}{9 \pi^2} \cos(3 \pi x) $$ For n = 8 -> $$ f(x) = \frac{1}{2} + \frac{4}{\pi^2} \cos(\pi x) + \frac{4}{9 \pi^2} \cos(3 \pi x) + \frac{4}{25 \pi^2} \cos(5 \pi x) + \frac{4}{49 \pi^2} \cos(7 \pi x) $$

Author
This problem was solved and uploaded by John North

Question
Consider the L2-ODE-CC with the window function f(x) from p9-8 as excitation:

$$ \ y'' - 3y'+ 2y = r(x) \ $$ where r(x) = f(x)

and the initial conditions

$$ \ y(0) = 1, y'(0) = 0 \ $$

1. Find $$ \ y_n(x) \ $$ such that:

$$ \ y_n'' + ay_n' + by_n = r_n(x) \ $$

with the same initial conditions as above.

Plot $$ \ y_n(x) \ $$ for n = 3, 6, 9 for x in [0, 10]

2. Use the matlab command ode45 to integrate the L2-ODE-CC and plot the numerical soln to compare with the analytical soln.

Level 1: n = 0,1

Solution
$$ \ \lambda^2 - 3\lambda + 2 = 0 => (\lambda-2)(\lambda-1) = 0 \ $$

$$ \ \lambda_{1,2} = 2, 1 \ $$

The Fourier series of a periodic function

$$ \ f(x) = a_0 + \sum_{n=1}^\infty[a_n \ $$ cos(nωx) + $$ \ b_n \ $$ sin(nωx)]

For an odd function the Fourier series will be the following:

$$ \ f(x) = \sum_{n=1}^\infty b_n \ $$ sin(nωx) $$ \ = \sum_{n=1}^\infty b_n sin( \frac{n*pi}{L}x)dx \ $$

The independent variable t will be used to shift x to the left

$$ \ t = x - \frac{1}{4} \ $$

The period of oscillation and frequency of oscillation will be as follows:

$$ \ p = 2L = 4 \ $$ ω = π/2

where $$ \ b_n = \frac{2}{L} \int_{0}^{L} f(x)sin( \frac{n*pi}{L}x)dx = \frac{1}{2} \int_{0}^{2} f(x)sin( \frac{n*pi}{2}x)dx \ $$

which comes to be: $$ \ b_n = \frac{A}{n*pi} \ $$ (1 - cosnπ)

$$ \ y'' - 3y' + 2y = r(x) \ $$ = 1/2 + (2/nπ) sin(nπ/2}t

The homogeneous equation for Y will be as follows:

$$ \ Y_h = C_1e^{2x} + C_2e^x \ $$

$$ \ Y = Y_h + Y_p = C_1e^{2x} + C_2e^x + C_3 \ $$

Author
This problem was solved and uploaded by Mike Wallace

Question
Redo R4.2 to redisplay the particular solution, the homogenous solution, and the exact solution for n = 3,5,9 over the interval [0,20π]

Redisplay the particular solution, the homogenous solution, and the exact solution. Superpose each solution with the exact solution.

Redo R4.3 with the TA code over the interval [0.10]. Zoom in about x = -0.5, 0, and 0.5 and comment on the accuracy of different approximations.

Redo R4.4 with the TA code over the interval [0.9,10] for n = 4, 7. Zoom in about x = 1, 1.5, 2, 2.5 and comment on the accuracy of different approximations.

R 4.2 redo
The re-displayed functions for the homogenous solutions are:

$$ \displaystyle y_{3h}(x) = 2e^x - 0.8008e^{2x}\ $$

$$ \displaystyle y_{5h}(x) = 2.0001e^x - 0.8001e^{2x}\ $$

$$ \displaystyle y_{9h}(x) = 2e^x - 0.8e^{2x}\ $$

The re-displayed functions for the particular solutions are:

$$ \displaystyle y_{3p}(x) = -9.9206*10^{-5}x^7-0.0010x^6-0.0031x^5-0.0078x^4-0.0990x^3-0.3984x^2-0.3984x - 0.1992\ $$

$$ \displaystyle y_{5p}(x) = -1.2526*10^{-8}x^{11}-2.0668*10^{-7}x^{10}-1.0334*10^{-6}x^9-4.6503*10^{-6}x^8 -1.1781*10^{-4}x^7\ $$

$$ \displaystyle -0.0011x^6-0.0033x^5-0.0083x^4-0.0999x^3-0.3999x^2-0.399x-0.2000\ $$

$$ \displaystyle y_{9p}(x) = -4.1103*10^{-18}x^{19}-1.1714*10^{-16}x^{18}-1.0543*10^{-15}x^{17}-8.9615*10^{-15}x^{16}\ $$

$$ \displaystyle -4.5405*10^{-13}x^{15}-9.1408*10^{-12}x^{14}-6.3985*10^{-11}x^{13}-4.1590*10^{-10}x^{12}-1.5021*10^{-8}x^{11} -2.2040*10^{-7}x^{10}$$

$$ \displaystyle -1.1020*10^{-6}x^9-4.9591*10^{-6}x^8-1.1904*10^{-4}x^7-0.0011x^6-0.0033x^5-0.0083x^4-0.1000x^3-0.4000x^2-0.4000x-0.2000\ $$

The re-displayed functions for the general solutions are:

$$ \displaystyle y_{3}(x) = 2e^x - 0.8008e^{2x}-9.9206*10^{-5}x^7-0.0010x^6-0.0031x^5-0.0078x^4-0.0990x^3-0.3984x^2-0.3984x - 0.1992\ $$

$$ \displaystyle y_{5}(x) = 2.0001e^x - 0.8001e^{2x} -1.2526*10^{-8}x^{11}-2.0668*10^{-7}x^{10}-1.0334*10^{-6}x^9-4.6503*10^{-6}x^8 \ $$

$$ \displaystyle -1.1781*10^{-4}x^7-0.0011x^6-0.0033x^5-0.0083x^4-0.0999x^3-0.3999x^2-0.399x-0.2000\ $$

$$ \displaystyle y_{9}(x) =2e^x-0.8e^{2x} -4.1103*10^{-18}x^{19}-1.1714*10^{-16}x^{18}-1.0543*10^{-15}x^{17}-8.9615*10^{-15}x^{16}\ $$

$$ \displaystyle -4.5405*10^{-13}x^{15}-9.1408*10^{-12}x^{14}-6.3985*10^{-11}x^{13}-4.1590*10^{-10}x^{12}-1.5021*10^{-8}x^{11}\ $$

$$ \displaystyle -2.2040*10^{-7}x^{10}-1.1020*10^{-6}x^9-4.9591*10^{-6}x^8-1.1904*10^{-4}x^7-0.0011x^6\ $$

$$ \displaystyle -0.0033x^5-0.0083x^4-0.1000x^3-0.4000x^2-0.4000x-0.2000\ $$

Plot for $$ \displaystyle y_{3}(x)\ $$

Plot for $$ \displaystyle y_{5}(x)\ $$

Plot for $$ \displaystyle y_{9}(x)\ $$

R 4.3 Redo
Matlab code:

x = 0:0.01:10;

y = log(1+x);

EDU>> x1 = 0:0.01:10;

EDU>> y1 = zeros(1,1001);

EDU>> for i = 1:4

for j = 1:1001

y1(j) = y1(j) - ((-x1(j))^i)/i;

end

end

EDU>> y2 = zeros(1,1001);

EDU>> for i = 1:7

for j = 1:1001

y2(j) = y2(j) - ((-x1(j))^i)/i;

end

end

EDU>> y3 = zeros(1,1001);

EDU>> for i = 1:11

for j = 1:1001

y3(j) = y3(j) - ((-x1(j))^i)/i;

end

end

EDU>> y4 = zeros(1,1001);

EDU>> for i = 1:16

for j = 1:1001

y4(j) = y4(j) - ((-x1(j))^i)/i;

end

end

EDU>> h = plot(x,y);

orange = [1 0.5 0.2];

EDU>> set(h,'Color',orange);

EDU>> hold on;

EDU>> plot(x1,y1,'r');

EDU>> plot(x1,y2,'g');

EDU>> plot(x1,y3,'b');

EDU>> plot(x1,y4,'c');

legend('log(1+x)','T_4','T_7','T_1_1','T_1_6');

EDU>> grid on;

EDU>> axis([0 10 -10 10])



Zoom plot about 0:

This plot makes it appear that only the 16 term approximation is in the window at point 0. This is, therefore, the most accurate of the other n solution approximations.

Zoom plot about 0.5:

This plot makes it appear that most of the approximations are very accurate and close to the exact solution. The only approximation that appears to deviate a little after 0.5 is the n = 4 approximation.

R 4.4 redo
Matlab code:

syms x

EDU>> f = log(x+1);

EDU>> fT1 = taylor(f,5,1);

EDU>> fT2 = taylor(f,8,1);

X = 0.9:0.1:10;

Y(:,1) = subs(fT1,'x',X);

EDU>> Y(:,2) = subs(fT2,'x',X);

EDU>> Y(:,3) = log(1+X);

EDU>> figure

EDU>> plot(X,Y);

axis([0.9 10 -10 10])



Zoom in about 1:

This shows that neither of the approximations are very close about x = 1 to the exact solution.

Zoom in about 1.5:

This shows that the n = 7 approximation is close about x = 1.5 to the exact solution.

Zoom in about 2:



This shows that all the approximations are very close to the exact solution about x = 2.

Zoom in about 2.5:

This shows that the approximations are very close about x = 2.5, however, the n = 4 approximation is beginning to deviate and soon will not be a good approximation.

Author
This problem was solved and uploaded by David Herrick

Question
Given $$\displaystyle y_{p}''+4y_{p}'+13y_{p}=2e^{-2x}cos(3x) $$


 * (1) Simplify the first term $$\displaystyle y_{p}'' $$ on the lhs
 * (2) Simplify the second term $$\displaystyle 4y_{p}' $$ and combine with the simplified first term
 * (3) Finally, add the third term $$\displaystyle 13y_{p} $$

Solution

 * From Lecture Notes Sec.10 p.10-3:


 * Particular solution is of the form $$\displaystyle y_{p}(x)=xe^{-2x}[Mcos(3x)+Nsin(3x)] $$


 * From Lecture Notes Sec.10 p.10-3:


 * $$\displaystyle y^{'}_{p}(x)=e^{-2x}[sin(3x)(-3mx-2nx+n)+cos(3x)(-2mx+m+3nx)] $$
 * $$\displaystyle y^{''}_{p}(x)=e^{-2x}[sin(3x)[6m(2x-1)-n(5x+4)]-cos(3x)[m(5x+4)+6n(2x-1)]] $$


 * We want to substitute these derivatives back into the original ODE and verify that Wolfram Alpha's solution of $$\displaystyle 6e^{-2x}[ncos(3x)-msin(3x)] $$ is correct.

(1)


 * $$\displaystyle y^{''}_{p}=e^{-2x}[sin(3x)[6m(2x-1)-n(5x+4)]-cos(3x)[m(5x+4)+6n(2x-1)]] $$


 * $$\displaystyle y''_{p}=e^{-2x}[12mxsin(3x)-6msin(3x)-5nxsin(3x)-4nsin(3x)-5mxcos(3x)-4mcos(3x)-12nxcos(3x)+6ncos(3x)] $$

(2)


 * $$\displaystyle y^{'}_{p}=e^{-2x}[sin(3x)(-3mx-2nx+n)+cos(3x)(-2mx+m+3nx)] $$
 * $$\displaystyle 4y'p=e^{-2x}[-12mxsin(3x)-8nxsin(3x)+4nsin(3x)-8mxcos(3x)+4mcos(3x)+12nxcos(3x)] $$


 * $$\displaystyle y''_{p}+4y'_{p}=e^{-2x}[-6msin(3x)-13nxsin(3x)-13mxcos(3x)+6ncos(3x)] $$

(3)


 * $$\displaystyle 13y_{p}=e^{-2x}[13mxcos(3x)+13nxcos(3x)] $$


 * $$\displaystyle y''_{p}+4y'_{p}+13y_{p}=e^{-2x}[-6msin(3x)+6ncos(3x)] $$

Comparing this to Wolfram Alpha's answer:

$$\displaystyle 6e^{-2x}[ncos(3x)-msin(3x)]=6e^{-2x}[ncos(3x)-msin(3x)] $$

Author
Solved and uploaded by Joshua House

Question
(1) Find the separated ODEs for the heat equation


 * $$\displaystyle \frac{\partial u}{\partial t}=\kappa \frac{\partial^2 u}{\partial x^2} $$

Solution
Assuming $$\displaystyle u(x,t)=F(x)\cdot G(t) $$

Then:


 * $$\displaystyle \frac{\partial u(x,t)}{\partial t}=F(x)\cdot \dot{G}(t) $$


 * $$\displaystyle \frac{\partial^2u(x,t) }{\partial x^2}=F''(x)\cdot{G}(t) $$

Substituting partial derivatives back into original PDE:


 * $$\displaystyle F(x)\cdot \dot{G}(t)=\kappa F''(x)\cdot G(t) $$


 * $$\displaystyle \frac{\dot{G}(t)}{\kappa G(t)}=\frac{F''(x)}{F(x)}=c $$


 * * Where "c" is a constant, because if both sides were variables then they would never be equal one another (each side would be a function of a different variable.) Kreysig 2011, pp.546

Multiplying by the denominators to get two separate ODEs:

$$\displaystyle F''(x)-cF(x)=0 $$ $$\displaystyle \dot{G}(t)-\kappa cG(t)=0 $$

Author
Solved and uploaded by Joshua House

Contribution Summary
Problem 1 was solved and uploaded by: Radina Dikova

Problem 2 was solved and uploaded by: William Knapper

Problem 3 was solved and uploaded by: John North

Problem 4 was solved and uploaded by: Michael Wallace

Problem 5 was solved and uploaded by: David Herrick

Problem 6 was solved and uploaded by: Joshua House

Problem 7 was solved and uploaded by: Joshua House