User:Egm6341.s11.team4.kurth/hw1

=Problem 1.4: Infinity Norms=

Refer to lecture slide [[media:nm1.s11.mtg5.djvu|5-3]] for problem statement.

Given

 * $$\displaystyle f(x)=3x-2x^3, \; x \in [0,1]$$


 * $$\displaystyle g(x)=\sinh(x), \; x \in [0,1]$$

Objectives

 * 1. Plot $$\displaystyle f(x)$$ and $$\displaystyle g(x)$$.


 * 2. Find $$||f(x)||_\infty$$, $$||g(x)||_\infty$$ , and $$||f(x)-g(x)||_\infty$$.

Solution
1. Plotting the functions

The following MATLAB code was used to plot f(x) from x=0 to x=1:



Similarly for g(x):



2. Evaluating the Infinity Norms


 * $$||f(x)||_\infty = max(|f(x)|)$$

As seen in Figure 3 above f(x) has a local maxima within the interval $$ x \in [0,1]$$, and will be determined by inspection of the derivative of f(x):


 * $$ \frac{d}{dx}f(x) = 3-6x^2$$

Solving for the x-value for which f(x) attains its local maxima:


 * $$ \frac{d}{dx}f(x) = 3-6x^2=0$$
 * $$\Rightarrow x = \frac{\sqrt{2}}{2}$$

Then solving for the local maximum of f(x):


 * $$\displaystyle f(\frac{\sqrt{2}}{2})=3*\frac{\sqrt{2}}{2}-2*(\frac{\sqrt{2}}{2})^{3} = \sqrt{2}$$


 * {| style="width:70%" border="0" align="center"

$$\displaystyle \Rightarrow ||f(x)||_\infty=\sqrt{2} $$ $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * $$\displaystyle
 * style= |
 * }.
 * }.


 * $$||g(x)||_\infty = max(|g(x)|)$$

As can be seen in figure 4 above, g(x) on the interval $$x \in [0,1]$$ attains its maximum at x=1.


 * $$max(|g(x)|) = g(1) = sinh(1) \approx 1.1752$$


 * {| style="width:70%" border="0" align="center"

$$\displaystyle \Rightarrow ||g(x)||_\infty \approx 1.1752 $$ $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * $$\displaystyle
 * style= |
 * }.
 * }.


 * $$||f(x)-g(x)||_\infty = max(|f(x)-g(x)|)$$

The following MATLAB code was used to calculate this infinity norm:


 * {| style="width:70%" border="0" align="center"

$$\displaystyle \Rightarrow ||f(x)-g(x)||_\infty \approx 0.7392 $$ $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * $$\displaystyle
 * style= |
 * }.
 * }.

Solved by William Kurth.