# University of Florida/Egm4313/IEA-f13-team10/R6
## Report 6
### Problem 1
#### Problem Statement

ODE: $y''-3y'-10y=3cos7x$
Part 1: show that cos7x and sin7x are linearly independent using the Wronskian and Gramian.
Part 2: Find 2 equations for the two unknowns M, N, and solve for M, N.
Part 3: Find the overall solution y(x) that corresponds to the initial conditions: $y(0)=1,y'(0)=0$
Plot the solution over 3 periods

#### Solution
##### Part 1

Wronskian: Function is linearly independent if $W(f,g)\neq 0$ $W(f,g):={\begin{bmatrix}f&g\\f'&g'\end{bmatrix}}=fg'-gf'$
$f=cos7x,f'=-7sin7x$
$g=sin7x,g'=7cos7x$
$W(cos7x,sin7x):={\begin{bmatrix}cos7x&sin7x\\-7sin7x&7cos7x\end{bmatrix}}=7cos^{2}7x+7sin^{2}7x=1$
g(x) and f(x) are linearly independent
Gramian: Function is linearly independent if $\Gamma (f,g)\neq 0$ $\Gamma (f,g):={\begin{bmatrix}<f,f>&<f,g>\\<g,f>&<g,g>\end{bmatrix}}$
$f(x)=cos7x,g(x)=sin7x$ $<f,f>=\int _{-1}^{1}cos7x*cos7xdx=1.07$ $<f,g>=\int _{-1}^{1}cos7x*sin7xdx=0$ $<g,f>=\int _{-1}^{1}sin7x*cos7xdx=0$ $<g,g>=\int _{-1}^{1}sin7x*sin7xdx=0.93$
$\Gamma (f,g):={\begin{bmatrix}1.07&0\\0&0.93\end{bmatrix}}=0.9951$
g(x) and f(x) are linearly independent

##### Part 2

The particular solution for a $r(x)=3cos7x$ will be:
$y_{p}(x)=Mcos7x+Nsin7x$
Differentiate to get:
$y_{p}'(x)=-M7sin7x+N7cos7x$
$y_{p}''(x)=-M7^{2}cos7x-N7^{2}sin7x$
Plug the derivatives into the equation:
$y_{p}''(x)-3y_{p}'(x)-10y_{p}(x)=3cos7x$
$(-M7^{2}cos7x-N7^{2}sin7x)-3(-M7sin7x+N7cos7x)-10(Mcos7x+Nsin7x)$
Separate the sin and cos terms to get 2 equations in order to solve for M and N
$-M7^{2}cos7x-3N7cos7x-10Mcos7x=3cos7x$
$-N7^{2}sin7x+3M7sin7x-10Nsin7x=0$
dividing each equation by cos7x and sin7x respectively:
$-49M-21N-10M=3$
$-49N+21M-10N=0$
$M=-0.0454$
$N=-0.0154$
So the particular solution is:
$y_{p}(x)=-0.0454cos7x-0.0154sin7x$

##### Part 3

The overall solution can be found by:
$y(x)=y_{h}(x)+y_{p}(x)$
The roots given in the problem statement $\lambda _{1}=-2,\ \lambda _{2}=+5$
Lead to the homogeneous solution of:
$y_{h}(x)=C_{1}e^{-2x}+C_{2}e^{5x}$
Combining the homogeneous and particular solution gives us:
$y(x)=C_{1}e^{-2x}+C_{2}e^{5x}-0.0454cos7x-0.0154sin7x$
Solving for the constants by using the initial conditions $y(0)=1,y'(0)=0$
$y(0)=C_{1}e^{0}+C_{2}e^{0}-0.0454cos(0)-0.0154sin(0)=1$
$y'(0)=-2C_{1}e^{0}+5C_{2}e^{0}+0.3178sin(0)-0.1078cos(0)=0$
$C_{1}=0.73$
$C_{2}=0.31$
The overall solution is:
$y(x)=0.73e^{-2x}+0.31e^{5x}-0.0454cos7x-0.0154sin7x$

##### Plot

Plot $y(x)=0.73e^{-2x}+0.31e^{5x}-0.0454cos7x-0.0154sin7x$ over 3 periods:

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 2
#### Problem Statement

Complete the solution to problem on p.8-6. Find the overall solution $y(x)$ that corresponds to the initial condition $y(0)=1,y'(0)=0$ Plot solution over 3 periods.

#### Solution

Given: $y''+4y'+13y=2*e^{-2x}*3cos7x$ $y_{h}(x)=e^{-2x}*(Acos(3x)+BNsin(3x))$ $y_{P}(x)=x*e^{-2x}*(Mcos(3x)+Nsin(3x))$
$y_{P}'(x)=e^{-2x}*cos(3x)(x(-2M+N)+M)+e^{-2x}*sin(3x)(x(-2N-M)+N)$ $y_{P}''(x)=e^{-2x}(-3sin(3x)(x(-2M+N)+M)$ $+cos(3x)(-2M+N))-2e^{-2x}cos(3x)(x(-2M+N)+M)+e^{-2x}(3cos(3x)(x(-2N-M)$ $+N)+sin(3x)(-2N-M))-2e^{-2x}sin(3x)(x(-2N-M)+N)$
$y_{p}''+4y_{p}'+13y_{p}=2*e^{-2x}*3cos7x$
Solve for M and N: $4N=2,-2M+4N$ $M=1,N=0.5$
$y(x)=e^{-2x}*(Acos(3x)+BNsin(3x))+x*e^{-2x}*(cos(3x)+.5*sin(3x))$ Using initial conditions given find A and B
After applying initial conditions, we get $A=1,-2A+3B+1=0$ $A=1,B=1/3$
$y(x)=e^{-2x}*(cos(3x)+sin(3x)/3)+x*e^{-2x}*(cos(3x)+.5*sin(3x))$

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 3
#### Problem Statement

Is the given function even or odd or neither even nor odd? Find its Fourier Series.

#### Solution

$f(x)=x^{2},(-1<x<1),p=2$
$f(-x)=f(x)$ so $f(x)=x^{2}$ is an even function.
The Fourier series is $f(x)=a_{0}+\sum _{n=1}^{\infty }[a_{n}cos(nwx)+b_{n}sin(nwx)]$.
$a_{0}={\frac {1}{2L}}\int _{-L}^{L}f(x)dx$
For $n=1,2,...$ $a_{n}={\frac {1}{L}}\int _{-L}^{L}f(x)cos(nwx)dx$ $b_{n}={\frac {1}{L}}\int _{-L}^{L}f(x)sin(nwx)dx$
For $f(x)=x^{2}$ $a_{0}={\frac {1}{2(1)}}\int _{-1}^{1}x^{2}dx={\frac {1}{3}}$ $a_{n}={\frac {1}{1}}\int _{-1}^{1}x^{2}cos(n\pi x)dx$ The above integral requires two iterations of integration by parts. Which gives
$a_{n}={\frac {1}{n\pi }}[sin(n\pi )-sin(-n\pi )]+{\frac {2}{n^{2}\pi ^{2}}}[cos(n\pi )+cos(-n\pi )]-{\frac {2}{n^{3}\pi ^{3}}}[sin(n\pi )-sin(-n\pi )]$ Similarly, integration by parts needs to be used twice to solve the following integral. $b_{n}={\frac {1}{1}}\int _{-1}^{1}x^{2}sin(n\pi x)dx$ $b_{n}={\frac {-1}{n\pi }}[cos(n\pi )-cos(-n\pi )]+{\frac {2}{n^{2}\pi ^{2}}}[sin(n\pi )+sin(-n\pi )]+{\frac {2}{n^{3}\pi ^{3}}}[cos(n\pi )-cos(-n\pi )]$ So the Fourier series for $f(x)=x^{2}$ is
${\frac {1}{3}}+\sum _{n=1}^{\infty }cos(nwx)[{\frac {1}{n\pi }}[sin(n\pi )-sin(-n\pi )]+{\frac {2}{n^{2}\pi ^{2}}}[cos(n\pi )+cos(-n\pi )]-{\frac {2}{n^{3}\pi ^{3}}}[sin(n\pi )-sin(-n\pi )]]$ $+sin(nwx)[-{\frac {1}{n\pi }}[cos(n\pi )-cos(-n\pi )]+{\frac {2}{n^{2}\pi ^{2}}}[sin(n\pi )+sin(-n\pi )]+{\frac {2}{n^{3}\pi ^{3}}}[cos(n\pi )-cos(-n\pi )]]$

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 4
#### Problem Statement

1) Develop the Fourier series of$f({\bar {x}})$. Plot$f({\bar {x}})$and develop the truncated Fourier series$f_{n}({\bar {x}})$.
$f_{n}({\bar {x}}):={\bar {a}}_{0}+\sum _{k=1}^{n}[{\bar {a}}_{k}\cos k\omega {\bar {x}}+{\bar {b}}_{k}\sin k\omega {\bar {x}}]$ for n = 0,1,2,4,8. Observe the values of at the points of discontinuities, and the Gibbs phenomenon. Transform the variable so to obtain the Fourier series expansion of . Level 1: n=0,1.
2)Do the same as above, but using$f({\tilde {x}})$to obtain the Fourier series expansion of$f(x)$; compare to the result obtained above. Level 1: n=0,1.

#### Solution
##### Part 1

To begin, the function $f({\bar {x}})$ was determined to be even. Even functions reduce to a cosine Fourier series. Because $f({\bar {x}})$, has a period of 4, the length is 2.
$a_{0}={\frac {1}{L}}\int _{0}^{2}f({\bar {x}})d{\bar {x}}={\frac {A}{2}}$
$a_{k}={\frac {2}{L}}\int _{0}^{2}f({\bar {x}})\cos({\frac {k\pi {\bar {x}}}{2}})d{\bar {x}}$
$a_{k}={\frac {2A}{k\pi }}\sin({\frac {k\pi }{2}})$
$f_{k}({\bar {x}})=a_{0}+\sum _{k=1}^{n}[a_{n}\cos {\frac {n\pi {\bar {x}}}{2}}]$
$f_{k}={\frac {A}{2}}+\sum _{k=1}^{n}[{{\frac {2A}{k\pi }}\sin({\frac {k\pi }{2}})}\cos {\frac {k\pi {\bar {x}}}{2}}]$
For n=0,
$f_{0}({\bar {x}})={\frac {A}{2}}$
For n=1, $f_{1}({\bar {x}})={\frac {A}{2}}+{\frac {2A}{\pi }}\cos({\frac {\pi {\bar {x}}}{2}})$
${\bar {x}}=x-1.25$
$f_{k}(x)={\frac {A}{2}}+{\frac {A}{\pi }}\cos({\frac {\pi (x-1.25)}{2}})$
Plot (A=1)

##### Part 2

To begin, the function $f({\bar {x}})$ was determined to be odd. Even functions reduce to a sine Fourier series. Because $f({\bar {x}})$, has a period of 4, the length is 2.
$a_{0}={\frac {1}{L}}\int _{0}^{2}f({\bar {x}})d{\bar {x}}={\frac {A}{2}}$
$a_{0}={\frac {1}{2L}}\int _{0}^{4}f({\tilde {x}})d{\tilde {x}}={\frac {A}{2}}$
$a_{n}={\frac {1}{2}}\int _{0}^{4}f{\tilde {x}}\cos({\frac {n\pi {\tilde {x}}}{2}}d{\tilde {x}}$
$a_{n}={\frac {1}{2}}f({\tilde {x}})\cos({\frac {n\pi {\tilde {x}}}{2}}$ from 0 to 4
$a_{n}={\frac {A}{n\pi }}\sin(\pi k)$
$b_{n}={\frac {1}{2}}\int _{0}^{4}f{\tilde {x}}\sin({\frac {n\pi {\tilde {x}}}{2}}d{\tilde {x}}$
$b_{n}={\frac {1}{2}}f({\tilde {x}})\sin({\frac {n\pi {\tilde {x}}}{2}})$ from 0 to 4
$b_{n}={\frac {A}{n\pi }}(1-\cos(\pi k))$
$f_{k}({\tilde {x}})={\frac {A}{2}}+\sum _{k=1}^{n}[{\frac {A}{k\pi }}(1-\cos(\pi k))(\sin({\frac {k\pi {\tilde {x}}}{2}}))]$
For n=0,
$f_{0}({\tilde {x}})={\frac {A}{2}}$
For n=1, $f_{1}({\tilde {x}})={\frac {A}{2}}+{\frac {A}{\pi }}\sin({\frac {\pi {\tilde {x}}}{2}})$
${\tilde {x}}=x-.25$
$f_{1}(x)={\frac {A}{2}}+{\frac {A}{\pi }}\sin({\frac {\pi (x-.25)}{2}})$ Plot (A=1)

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 5
#### Problem Statement

Find the separated ODE's for the Heat Equation:
${\frac {\partial ^{2}u}{\partial t^{2}}}=k{\frac {\partial ^{2}u}{\partial x^{2}}}$ (1)
$k=$ heat capacity

#### Solution

Separation of Variables:
Assume: $u(x,t)=F(x)\cdot G(t)$
${\frac {\partial u(x,t)}{\partial x}}=F'(x)\cdot G(t)$ (2)
${\frac {\partial ^{2}u(x,t)}{\partial x^{2}}}=F''(x)\cdot G(t)$ (3)
${\frac {\partial u(x,t)}{\partial t}}=F(x)\cdot {\dot {G}}(t)$ (4)
${\frac {\partial ^{2}u(x,t)}{\partial t^{2}}}=F(x)\cdot {\ddot {G}}(t)$ (5)
Plug (2) and (3) into Heat Equation (1):
$F(x)\cdot {\dot {G}}(t)=kF''(x)\cdot G(t)$ (6)
Rearrange (6) to combine like terms:
${\frac {{\dot {G}}(t)}{kG(t)}}={\frac {F''(x)}{F(x)}}=c{\text{ (constant)}}$
${\frac {{\dot {G}}(t)}{kG(t)}}=c$
${\dot {G}}(t)=k\,c\,G(t)$
${\dot {G}}(t)-k\,c\,G(t)=0$
${\frac {F''(x)}{F(x)}}=c$
$F''(x)=c\,F(x)$
$F''(x)-c\,F(x)=0$
Solution:
Separated ODE's for Heat Equation:
${\dot {G}}(t)-k\,c\,G(t)=0$
$F''(x)-c\,F(x)=0$

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 6
#### Problem Statement

Verify (4)-(5) p.19-9
(4)$<\phi _{i},\phi _{j}>=0$ for $i\neq j$
(5)$<\phi _{i},\phi _{j}>=L/2$ for $i=j$

#### Solution
##### Verification of (4)

Using the integral scalar product calculation,
$\int _{0}^{L}\phi _{i}(x)\phi _{j}(x)dx$
Substituting in sin values, $\int _{0}^{L}sin(\omega _{i}(x))sin(\omega _{j}(x))dx$
Using $z={\frac {\pi x}{L}}$ and $dz={\frac {\pi }{L}}dx$
You can substitute z into the integral instead of x. $\int _{0}^{\pi }sin(iz)sin(jz)dz{\frac {L}{\pi }}$
Integrating, ${\frac {1}{2}}[{\frac {sin(i-j)z}{i-j}}-{\frac {sin(i+j)z}{i+j}}]$ from $z=0$ to $z=\pi$ Since $i\neq j$, the equation with its sin values turns into 0-0=0

##### Verification of (5)

You can use the same equation from the verification of (4) from this point: ${\frac {1}{2}}[{\frac {sin(i-j)z}{i-j}}-{\frac {sin(i+j)z}{i+j}}]$ from $z=0$ to $z=\pi$ Putting those values in and substituting L back in the equation, it turns into ${\frac {L}{2}}$

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.

### Problem 7
#### Problem Statement

$u(x,t)=\sum _{j=1}^{\infty }a_{j}\cos(cw_{j}t)\sin(w_{j}x)$ Plot the truncated series for n=5. $t=\alpha p_{1}={\frac {\alpha 2L}{c}}$
$\alpha =.5,1,1.5,2$

#### Solution

$a_{j}={\frac {2[((-1)^{j})-1]}{\pi ^{3}j^{3}}}$
$w_{j}={\frac {j\pi }{L}}$
C=3 and L=2 Plot $u(x,2/3)$
Plot $u(x,4/3)$
Plot $u(x,2)$
Plot $u(x,8/3)$

#### Honor Pledge

On our honor, we solved this problem on our own, without aid from online solutions or solutions from previous semesters.