User:Egm4313.s12.team1.wyattling/r7

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%" |
 * 
 * }

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%" |
 * 
 * }

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%" |
 * 
 * }


 * {| 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%" |
 * 
 * }

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%" |
 * 
 * }

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 -

Reviewed By -