User:Egm4313.s12.team1.armanious/team1/R7

=Report 7=

Statement
Determine orthogonality of:


 * {| style="width:100%" border="0"

$$ \langle \phi_i, \phi_j \rangle = 0 \ \text{ for } \ i \ne j $$
 * style="width:95%" |
 * style="width:95%" |

$$ \langle \phi_j, \phi_j \rangle = \frac{L}{2} \ \text{ for } \ i=j $$     (1.0)
 * 
 * }

Where: $$\displaystyle \phi_i (x) = \sin(\omega_i x)$$, $$\displaystyle \phi_j (x) = \sin(\omega_j x)$$, $$\displaystyle \omega_i = \frac{i \pi}{L}$$, and $$\displaystyle \omega_j = \frac{j \pi}{L}$$.

Solution
The definition of a scalar product is:


 * {| style="width:100%" border="0"

$$ \langle \bar f, \bar g \rangle := \int_0^L \bar f(x) \ \bar g(x) \, dx $$ (1.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

So, substituting the problem statement values into Eq. (1.0):


 * {| style="width:100%" border="0"

$$ \langle \phi_i, \phi_j \rangle := \int_0^L \sin(\omega_i x) \ \sin(\omega_j x) \, dx $$ (1.2) and:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$ \langle \phi_j, \phi_j \rangle := \int_0^L \sin(\omega_j x) \ \sin(\omega_j x) \, dx $$ (1.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Solving Eq. 1.2 first:
 * {| style="width:100%" border="0"

$$ \langle \phi_i, \phi_j \rangle = \int_0^L \sin(\omega_i x) \ \sin(\omega_j x) \, dx $$
 * style="width:95%" |
 * style="width:95%" |

$$ = \frac {1}{2} \int_0^L \cos((\omega_i - \omega_j)x)-\cos((\omega_i+\omega_j)x) \, dx $$

$$ = \frac {1}{2(\omega_i - \omega_j)}[\sin((\omega_i - \omega_j)L)-\sin(0)]-\frac {1}{2(\omega_i + \omega_j)}[\sin((\omega_i + \omega_j)L)-\sin(0)] $$

$$ = \frac {1}{2L(i \pi - j \pi)}\sin(i \pi - j \pi)-\frac {1}{2L(i \pi + j \pi)}\sin(i \pi + j \pi) $$ Because $$\displaystyle i$$ and $$\displaystyle j$$ are both integers, the sin function will always be a periodic integer varying by $$\displaystyle \pi$$, meaning that $$\sin(i \pi - j \pi)=0$$ and $$\sin(i \pi + j \pi)=0$$. Thus proving:
 * 
 * }
 * {| style="width:100%" border="1"

$$ \langle \phi_i, \phi_j \rangle = 0 \ \text{ for } \ i \ne j $$ (1.0.a)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Now solving for Eq. 1.3:


 * {| style="width:100%" border="0"

$$ \langle \phi_j, \phi_j \rangle = \int_0^L \sin(\omega_j x) \ \sin(\omega_j x) \, dx $$
 * style="width:95%" |
 * style="width:95%" |

$$ = \frac {1}{2} \int_0^L \cos((\omega_j - \omega_j)x)-\cos((\omega_j+\omega_j)x) \, dx $$

$$ = \frac {1}{2} \int_0^L \cos((j \pi - j \pi)\frac{x}{L})-\cos((j \pi+j \pi)\frac {x}{L}) \, dx $$

$$ = \frac {1}{2} \int_0^L \cos(0)-\cos(\frac {2jx \pi}{L}) \, dx $$

$$ = \frac {1}{2} \int_0^L 1-\cos(\frac {2jx \pi}{L}) \, dx $$

$$ = \frac {L}{2}-\frac {L}{2j \pi}\sin(2j \pi) $$
 * 
 * }

Again, because $$\displaystyle j$$ is an integer, the sin function will always be a periodic integer varying by $$\displaystyle 2j \pi$$, meaning that $$\sin(2j \pi)=0$$. Thus proving:


 * {| style="width:100%" border="1"

$$ \langle \phi_j, \phi_j \rangle = \frac{L}{2} \ \text{ for } \ i=j $$     (1.0.b)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Author
Solved and Typed By ---Egm4313.s12.team1.durrance (talk) 16:49, 24 April 2012 (UTC)

Reviewed By - Egm4313.s12.team1.armanious (talk) 23:48, 24 April 2012 (UTC)

Statement
Plot the truncated-series (3) p19-12 with n=5, and for:
 * {| style="width:100%" border="0"

t=\alpha p_1 = \alpha \frac{2\pi}{c \omega_1} = \alpha \frac {2L}{c} $$     (2.0)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }


 * {| style="width:100%" border="0"

\alpha = .5, 1, 1.5, 2 $$     (2.1)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }

Solution
Let it be stated first that (3) p.19-12 is equal to:
 * {| style="width:100%" border="0"

u(x,t) = \sum{j=1}{n} a_j cos(c \omega _j t) sin(\omega _j x) $$ (2.2)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }

And in this series representation, c=3, L=2, and $$ a_j $$. is equaled to this:
 * {| style="width:100%" border="0"

a_j=\left\{\begin{matrix} 0 for j=2m (even)\\ -4/( \pi^3j^3)for j=2m+1 (odd) \end{matrix}\right. $$     (2.3)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }

With this in mind, we are prepared to create these truncated-series. For $$ \alpha =.5$$ 
 * {| style="width:100%" border="0"

u(x,t) = [a_1 cos(c \omega _1 \alpha \frac{2L}{c})sin(\omega _1 x)] $$      (2.4)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }
 * {| style="width:100%" border="0"

+[a_2 cos(c \omega _2 \alpha \frac{2L}{c})sin(\omega _2 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * {| style="width:100%" border="0"
 * {| style="width:100%" border="0"

+[a_3 cos(c \omega _3 \alpha \frac{2L}{c})sin(\omega _3 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * {| style="width:100%" border="0"
 * {| style="width:100%" border="0"

+ [a_4 cos(c \omega _4 \alpha \frac{2L}{c})sin(\omega _4 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * {| style="width:100%" border="0"
 * {| style="width:100%" border="0"

+[a_5 cos(c \omega _5 \alpha \frac{2L}{c})sin(\omega _5 x)] $$ These simplify below as shown, after plugging in 3 for c, 10, for L, .5 for alpha, and the value of $$ a_j $$ as determined from (2.2).
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }
 * {| style="width:100%" border="0"

u(x,t) = [\frac{-4}{\pi ^3} cos(\omega _1 (.5) (2*10))sin(\omega _1 x)] $$      (2.5)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 3^3}cos(\omega _3 (.5)(2*10))sin(\omega _3 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 5^3}cos(\omega _5 (.5)(2*10))sin(\omega _5 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Making $$ \omega $$ equal to $$ 2 \pi $$, the graph appears as shown below.

Alpha = .5

For $$ \alpha =1$$ 

These simplify below as shown, after plugging in 3 for c, 10, for L, 1 for alpha, and the value of $$ a_j $$ as determined from (2.2).
 * {| style="width:100%" border="0"

u(x,t) = [\frac{-4}{\pi ^3} cos(\omega _1 (1) (2*10))sin(\omega _1 x)] $$      (2.6)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 3^3}cos(\omega _3 (1)(2*10))sin(\omega _3 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 5^3}cos(\omega _5 (1)(2*10))sin(\omega _5 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Making $$ \omega $$ equal to $$ 2 \pi $$, the graph appears as shown below.

Alpha = 1

For $$ \alpha =1.5$$ 

These simplify below as shown, after plugging in 3 for c, 10, for L, 1.5 for alpha, and the value of $$ a_j $$ as determined from (2.2).
 * {| style="width:100%" border="0"

u(x,t) = [\frac{-4}{\pi ^3} cos(\omega _1 (1.5) (2*10))sin(\omega _1 x)] $$      (2.7)
 * $$\displaystyle
 * $$\displaystyle
 * 
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 3^3}cos(\omega _3 (1.5)(2*10))sin(\omega _3 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 5^3}cos(\omega _5 (1.5)(2*10))sin(\omega _5 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Making $$ \omega $$ equal to $$ 2 \pi $$, the graph appears as shown below. Alpha = 1.5

For $$ \alpha =2$$ 

These simplify below as shown, after plugging in 3 for c, 10, for L, 2 for alpha, and the value of $$ a_j $$ as determined from (2.2).
 * {| style="width:100%" border="0"

u(x,t) = [\frac{-4}{\pi ^3} cos(\omega _1 (2) (2*10))sin(\omega _1 x)] $$      (2.8)
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 3^3}cos(\omega _3 (2)(2*10))sin(\omega _3 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }


 * {| style="width:100%" border="0"

+[\frac{-4}{\pi ^3 * 5^3}cos(\omega _5 (2)(2*10))sin(\omega _5 x)] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Making $$ \omega $$ equal to $$ 2 \pi $$, the graph appears as shown below.

Alpha = 2

Author
Solved and Typed By - Egm4313.s12.team1.silvestri (talk) 19:01, 23 April 2012 (UTC) Reviewed By - Egm4313.s12.team1.armanious (talk) 19:40, 25 April 2012 (UTC)

Statement
Find the scalar product <f,g>, the magnitude of f and g, and the angle between f and g for (see R7.3 Lect. 11-1 pg. 8): 1) $$f(x)=\cos x, g(x)=x, \text{for} -2\leq x \leq 10\!$$ 2) $$f(x)=\frac12(3x^2-1), g(x)=\frac12(5x^3-3x), \text{for} -1\leq x \leq +1\!$$

Solution
The scalar product, the function equivalent of the vector dot product, of two functions can be found in the following way:
 * {| style="width:100%" border="0"

$$  \displaystyle <f,g>:=\int^b_af(x)g(x)dx $$     (3.0) The magnitude of a function is defined as the square root of the scalar product between the function and itself:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ||f||:=<f,f>^{1/2}=\left [\int^b_af^2(x)dx \right ]^{1/2} $$     (3.1) The cosine of the angle between two functions can be found in the following way:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \cos \theta = \frac{<f,g>}{||f||||g||} $$     (3.2) Note that these equations are very similar to their vector counterparts. Part 1
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\cos x, g(x)=x, \text{for} -2\leq x \leq 10 $$     (3.3) The scalar product of f and g can be found using (3.0):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <f,g>=\int_{-2}^{10}x\cos (x) dx=\left [ x\sin(x)+cos(x) \right ]_{-2}^{10} $$     (3.4) Solving this yields the scalar product:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle (10\sin10+\cos10)-(-2\sin(-2)+\cos(-2))=-7.68 $$     (3.5) To find the magnitude of f, the scalar product of f with itself must first be found:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <f,f>=\int_{-2}^{10}\cos^{2}(x)dx=\int_{-2}^{10}\left (\frac12\cos(2x)+\frac12 \right )dx=\left [ \frac14\sin(2x)+\frac12x \right ]_{-2}^{10} $$     (3.6) Solving this yields:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left [ \frac14\sin(2x)+\frac12x \right ]_{-2}^{10}=\left ( \frac14\sin(20)+5 \right )-\left ( \frac14\sin(-4)-1 \right )=6.04 $$     (3.7) Therefore the magnitude of f is found to be:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle $$     (3.8) A similar approach can be taken for the magnitude of g:
 * style="width:95%" |
 * style="width:95%" |
 * f||=<f,f>^{1/2}=\sqrt{6.04}=2.46
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <g,g>=\int_{-2}^{10}x^2dx=\left [ \frac{x^3}{3} \right ]_{-2}^{10} $$     (3.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left [ \frac{x^3}{3} \right ]_{-2}^{10}=\frac{1000}3-\frac{-8}{3}=\frac{1008}{3}=336 $$     (3.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle $$     (3.11) Using the above information with (3.2), the cosine of the angle between f and g is found to be
 * style="width:95%" |
 * style="width:95%" |
 * g||=<g,g>^{1/2}=\sqrt{336}=18.33
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \cos \theta = \frac{<f,g>}{||f||||g||}=\frac{-7.68}{(2.46)(18.33)}=-0.1705 $$     (3.12) Therefore, the angle between the functions f and g is
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle \theta =\cos^{-1}(-0.1705)=1.74rad=99.8^{\circ} $$     (3.13) Part 2
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\frac12(3x^2-1), g(x)=\frac12(5x^3-3x), \text{for} -1\leq x \leq +1 $$     (3.14) The scalar product of f and g can be found using (3.0):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <f,g>=\int_{-1}^{1}\frac14\left ( 3x^2-1 \right )\left ( 5x^3-3x \right ) dx=\frac14\int_{-1}^{1}\left ( 15x^5-14x^3+3x \right ) dx=\frac14\left [ \frac{15}{6}x^6-\frac{14}{4}x^4+\frac32x^2 \right ]_{-1}^{1} $$     (3.15) Solving this yields the scalar product:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle \frac14\left [ \frac52x^6-\frac72x^4+\frac32x^2 \right ]_{-1}^{1}=\frac14\left ( \frac12-\frac12 \right )=0 $$     (3.16) To find the magnitude of f, the scalar product of f with itself must first be found:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <f,f>=\int_{-1}^{1}\left (\frac12\left (3x^2-1 \right )\right)^2 dx=\frac14\int_{-1}^{1}\left (9x^4-6x^2+1  \right )dx=\frac14\left [ \frac95x^5-2x^3+x \right ]_{-1}^{1} $$     (3.17) Solving this yields:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac14\left [ \left( \frac95-2+1\right )-\left (-\frac95+2-1 \right ) \right ] =\frac14\left ( \frac45+\frac45 \right )=\frac25 $$     (3.18) Therefore the magnitude of f is found to be:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle $$     (3.19) A similar approach can be taken for the magnitude of g:
 * style="width:95%" |
 * style="width:95%" |
 * f||=<f,f>^{1/2}=\sqrt{0.4}=0.632
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle <g,g>=\int_{-1}^{1}\left (\frac12\left (5x^3-3x \right )\right)^2 dx=\frac14\int_{-1}^{1}\left (25x^6-15x^4+9x^2  \right )dx=\frac14\left [ \frac{25}{7}x^7-3x^5+3x^3 \right ]_{-1}^{1} $$     (3.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac12 \left (\frac{25}{7}-3+3 \right ) =\frac{25}{14} $$     (3.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle $$     (3.22) Using the above information with (3.2), the cosine of the angle between f and g is found to be
 * style="width:95%" |
 * style="width:95%" |
 * g||=<g,g>^{1/2}=\sqrt{\frac{25}{14}}=1.336
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \cos \theta = \frac{<f,g>}{||f||||g||}=\frac{0}{(0.632)(1.336)}=0 $$     (3.23) '''Because the scalar product of the two functions is zero, the two functions are orthogonal. That is:'''
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="1"

$$  \displaystyle \theta =\frac{\pi}{2}rad=90^{\circ} $$     (3.24)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Author
Solved and Typed By - Egm4313.s12.team1.armanious (talk) 23:48, 21 April 2012 (UTC) Reviewed By - --Egm4313.s12.team1.stewart (talk) 02:22, 25 April 2012 (UTC)

Statement
From Lecture 11 Pg. 8 Do K 2011 p.482 pb.6,9,12,13. Problems 6 and 12 ask to graph the function and the Fourier series of the function below (4.1).
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\left | x \right | $$     (4.1) Problems 9 and 13 ask to graph the function and Fourier series of the function below (4.2).
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\begin{Bmatrix} x\;\; if \; -\pi <x<0\\ \pi -x\;\; if \; 0<x<\pi \end{Bmatrix} $$     (4.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Solution
For Question number 6, plotted using Wolfram Alpha. The Function 4.1

For Question number 9, plotted using Matlab. The Function 4.2

Question 12 asks for the Fourier series of equation 4.1, $$f(x)=\left | x \right |\!$$ which is an even function because $$f(-x)=+f(x)\!$$, and because it is even $$b_{n}=0\!$$. So the Fourier looks like this:
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=a_0+\sum_{n=1}^{\infty}a_ncos\frac{n\pi x}{L} $$     (4.3) In which $$L= \pi \!$$ and:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle a_0=\frac{1}{2\pi}\int_{-\pi}^{0}-xdx+\frac{1}{2\pi}\int_{0}^{\pi}xdx $$     (4.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_{n}=\frac{1}{\pi }\int_{-\pi}^{\pi}f(x)cos(nx)dx $$     (4.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle b_{n}=\frac{1}{\pi }\int_{-\pi}^{\pi}f(x)sin(nx)dx=0 $$     (4.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

These simplify to:


 * {| style="width:100%" border="0"

$$  \displaystyle a_0=\frac{1}{2\pi}\frac{\pi^{2}}{2}+\frac{1}{2\pi}\frac{\pi^{2}}{2}=\frac{\pi}{2} $$     (4.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_n=\frac{1}{\pi}\int_{-\pi}^{0}-xcos(nx)dx+\frac{1}{\pi}\int_{-\pi}^{0}xcos(nx)dx $$     (4.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_n=\frac{-4}{n^{2}\pi} $$     (4.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\frac{\pi}{2}+\sum_{n-1}^{\infty }\frac{4}{n^{2}\pi}cos\frac{n\pi x}{L} $$     (4.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The final answer:
 * {| style="width:100%" border="1"

$$  \displaystyle f(x)=\frac{\pi}{2}-\frac{4}{\pi}(cosx+\frac{cos3x}{9}+\frac{cos5x}{25}+...) $$     (4.11) Plotted with Wolfram Aplpha Fourier Series of Function 4.1
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Now the Fourier series of equation 4.2, we need to divide the function into two parts. First let's evaluate $$f(x)=x\; if\; - \pi <x<0 \!$$, which is an odd function because $$f(-x)=-f(x)\!$$. For an odd function $$a_{0}=a_{n}=0\!$$ so:
 * {| style="width:100%" border="0"

$$\displaystyle f(x)=\sum\limits_{n=1}^{\infty }{\left[ {{b}_{n}}\sin (\frac{n \pi x}{L}) \right]}=\sum\limits_{n=1}^{\infty }{\left[ {{b}_{n}}\sin (nx) \right]} $$     (4.12)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$\displaystyle b_{n}=\frac{1}{\pi}\int_{-\pi}^{0}xsin(nx)=\frac{1}{\pi}[\frac{sin(nx)-nxcos(nx)}{n^{2}}]=\frac{-cos(-\pi n)}{n}$$ (4.13) Which simplifies to:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle b_{n}=[1,\frac{-1}{2},\frac{1}{3},\frac{-1}{4},\frac{1}{5},\frac{-1}{6}...] $$     (4.14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The Fourier Series for just the top part of equation 4.2
 * {| style="width:100%" border="0"

$$\displaystyle f(x)=sinx-\frac{sin2x}{2}+\frac{sin3x}{3}-\frac{sin4x}{4}+\frac{sin5x}{5}... $$     (4.15)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Now the bottom part of equation 4.2 is neither even nor odd so we must add all the components and at the end combine the solution with the Fourier series for the top part of equation 4.2
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=a_{0}+\sum_{n=1}^{\infty }a_ncos(\frac{n \pi x}{L})+\sum_{n=1}^{\infty }b_nsin(\frac{n \pi x}{L})=a_{0}+\sum_{n=1}^{\infty }a_{n}cos(nx)+\sum_{n=1}^{\infty }b_{n}sin(nx) $$     (4.16)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_{0}=\frac{1}{2 \pi}\int_{0}^{\pi}(\pi-x)dx=\frac{1}{2 \pi }[\pi x-\frac{x^2}{2}]=\frac{\pi}{4} $$     (4.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_{n}=\frac{1}{ \pi}\int_{0}^{\pi}(\pi-x)cos(nx)dx=\frac{1}{ \pi }[\frac{n(\pi-x)sin(nx)-cos(nx)}{n^2}]=\frac{1-cos(\pi n)}{\pi n^2} $$     (4.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle a_{n}=[\frac{2}{\pi},0,\frac{2}{6\pi},0,\frac{2}{25\pi},0,\frac{2}{49 \pi}...] $$     (4.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle b_{n}=\frac{1}{\pi}\int_{0}^{\pi}(\pi-x)sin(nx)dx=\frac{1}{\pi}[\frac{sin(nx)+n(\pi-x)cos(nx)}{n^2}]=\frac{1}{n} $$     (4.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle b_{n}=[1,\frac{1}{2},\frac{1}{3},\frac{1}{4},\frac{1}{5},\frac{1}{6}...] $$     (4.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The Fourier Series of $$f(x)= \pi -x\; if\;  0<x< \pi \!$$.
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=a_{0}+\sum_{n=1}^{\infty }a_{n}cos(nx)+\sum_{n=1}^{\infty }b_{n}sin(nx)=\frac{\pi}{4}+[\frac{2cosx}{\pi}+\frac{2cos3x}{6\pi}+\frac{2cos5x}{25\pi}...]+[1+\frac{sinx}{2}+\frac{sin2x}{3}+\frac{sin3x}{4}+\frac{sin4x}{5}+\frac{sin5x}{6}...] $$     (4.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Combining with the Fourier Series of $$f(x)= x\; if\; -\pi <x<0 \!$$:
 * {| style="width:100%" border="0"

$$  \displaystyle f(x)=\frac{\pi}{4}+[\frac{2cosx}{\pi}+\frac{2cos3x}{6\pi}+\frac{2cos5x}{25\pi}...]+[sinx+\frac{sin2x}{2}+\frac{sin3x}{3}+\frac{sin4x}{4}+\frac{sin5x}{5}+...]+[sinx-\frac{sin2x}{2}+\frac{sin3x}{3}-\frac{sin4x}{4}+\frac{sin5x}{5}...] $$     (4.23)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The total series and final answer:
 * {| style="width:100%" border="1"

$$  \displaystyle f(x)=\frac{\pi}{4}+[\frac{2cosx}{\pi}+\frac{2cos3x}{6\pi}+\frac{2cos5x}{25\pi}...]+[2sinx+\frac{2sin3x}{3}+\frac{2sin5x}{5}...] $$     (4.24) Plotted with Wolfram Alpha Fourier Series of Function 4.2
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Author
Solved and Typed By - --Egm4313.s12.team1.stewart (talk) 02:22, 25 April 2012 (UTC) Reviewed By - Egm4313.s12.team1.essenwein (talk) 16:50, 25 April 2012 (UTC)

Statement
Consider equation (5.0) below:
 * {| style="width:100%" border="0"

$$  \displaystyle <\phi_{2j-1},\phi_{2k-1}> = \int_{0}^{P}\sin{j\omega x}\cdot \sin{k\omega x}dx = 0 $$     (5.0)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

1) Find the exact integration of equation (5.0) with $$ P = 2\pi\!$$, $$ j = 2\!$$, $$ k = 3\!$$.

2) Confirm the result with Matlab's trapz command for the trapezoidal rule.

Solution
1) Substituting the given values, we get equation (5.1) below:
 * {| style="width:100%" border="0"

$$  \displaystyle <\phi_{3},\phi_{5}> = \int_{0}^{2\pi}\sin{2\omega x}\cdot \sin{3\omega x}dx = 0 $$     (5.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using the product and sum trigonometry identities, we can evaluate the definite integral:
 * {| style="width:100%" border="0"

$$  \displaystyle \int_{0}^{2\pi}\sin{2\omega x}\cdot \sin{3\omega x}dx = \frac{1}{2}\int_{0}^{2\pi}(\cos{\omega x}-\cos{5\omega x})dx = 0 $$     (5.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \rightarrow [\frac{1}{2\omega}{\sin{\omega x} - \frac{1}{5}\sin{5\omega x}}]_0^{2\pi} = 0 $$     (5.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Also, $$ \omega = \frac{2\pi}{P} = 1\!$$, and substituting this into equation (5.3) allows the definite integral to be solved:
 * {| style="width:100%" border="1"

$$  \displaystyle [\frac{1}{2}{\sin{x} - \frac{1}{5}\sin{5x}}]_0^{2\pi} = 0 $$     (5.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

2) The following is the code for evaluating the definite integral in equation (5.1) in Matlab:

EDU>> X = 0:pi/100:2*pi;

EDU>> Y = sin(2*X).*sin(3*X);

EDU>> Z = trapz(X,Y)

Z =

-2.2633e-17

EDU>> plot(X,Y)



The returned value of the evaluated integral in Matlab is essentially equal to zero, and it can be seen in the graph that the areas under the curve cancel each other out.

Author
Solved and Typed By - Egm4313.s12.team1.wyattling

Reviewed By - Egm4313.s12.team1.rosenberg