Jump to content

University of Florida/Egm6341/s10.Team2/HW1

From Wikiversity

Problem 1

[edit | edit source]

Problem Statement

[edit | edit source]

Find and plot graph of the function for

Solution

[edit | edit source]

This limit cannot be performed directly since it yields form. So, the L'Hôpitals Rule technique must be used:

L'Hôpitals Rule States:



as long as f and g are functions that are differentiable on an open interval (a,b) which contains c, except at c itself.

Applying this technique the following is found:

Graph of (on X-axis) versus (on Y-axis)

MATLAB Code:

To generate the graph for vs

for i=1:1000
x=((i-1)/1000);
y=(exp(x)-1)/x;
plot(x,y);
hold on;
end


Solution for problem 1: Guillermo Varela 19:41, 27 January 2010 (UTC) and Srikanth Madala 19:41, 27 January 2010 (UTC)

Proofread problem 1: Guillermo Varela 19:41, 27 January 2010 (UTC) and Srikanth Madala 19:41, 27 January 2010 (UTC)

Problem 2

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 2-3, Find and of

Solution

[edit | edit source]

The Taylor's series expansion for any function f(x) can be expressed as follows:

where





If f(x) is considered to be , then by using the above expansion, becomes:



Let , then:



Similarly, becomes:



Using Integral mean value theorem (IMVT):



where lies in


Solution for problem 2: Srikanth Madala 19:41, 27 January 2010 (UTC)

Proofread problem 2: Egm6341.s10.team2.patodon 04:21, 21 February 2010 (UTC)

Problem 3

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 3-3.

Plot f and g

Find Infinity norm of

i)

ii)

iii)

Solution

[edit | edit source]

The Infinity norm is defined as follows:

Using this definition the following is identified:

i)

ii)

iii)


Solution for problem 3: Guillermo Varela

Problem 4

[edit | edit source]

Problem Statement

[edit | edit source]

Pg 5-1.

Prove the Integral Mean Value Theorem (IMVT) p. 2-3 for w(.) non-negative. i.e

Solution

[edit | edit source]

We have the IMVT as

For a given function Let m be the minimum of the function and M be the maximum of the same function

Then we know that,

multiplying the inequality throughout by and integrating between we get:

writing , we get

It is seen that when w(x) = 0, the result is valid. Consider the case when w(x) > 0

dividing throughout by

From the Intermediate Value Theorem, we know that there exists such that

i.e

Hence Proved


Solution for problem 4: --Egm6341.s10.team2.niki 23:22, 20 February 2010 (UTC)

Proofread problem 4:

Problem 5

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 5-1. Use the integral mean value theorem (IMVT) to show eq. 5 P. 2-2 yields the equation 1 of pg. 2-3.

Solution

[edit | edit source]


Solution for problem 5: Jiang Pengxiang

Proofread problem 5: Srikanth Madala 19:41, 27 January 2010 (UTC)

Problem 6

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 5-3. Repeat integration by parts to reveal

Plus the remainder.

Next, Assume eq. 4 and 5 of Pg. 2-2 are true, do integration by parts once more.

Solution

[edit | edit source]

From Meeting 5 lecture notes:

Integration by parts yields:

Performing integration by parts on the integral in the above result:


Solution for problem 6: Egm6341.s10.team2.patodon 04:15, 21 February 2010 (UTC)

Proofread problem 6: Guillermo Varela

Problem 7

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 6-1

Construct Taylor Series of f(.) around for n=0,1,...,10 and plot for each n.

Solution

[edit | edit source]

The Taylor's series expansion for any function can be expressed as follows:

where





If is considered to be , and , then by using the above expansion, and becomes:



where (Please see the below Matlab code for more elaborate expansion)



where (Please see the below Matlab code for more elaborate expansion)

MATLAB Code:

To generate the equation for

p=0
for n = 0:10
syms x;
syms z;
f=sin(z);
g=diff(f,n);
z=(pi/4);
p=p+(((x-(pi/4))^n)/factorial(n))*g;
end

p=

sin(z)+(x-1/4*pi)*cos(z)-1/2*(x-1/4*pi)^2*sin(z)-1/6*(x-1/4*pi)^3*cos(z)+1/24*(x-1/4*pi)^4*sin(z)+1/120*(x-1/4*pi)^5*cos(z)-1/720*(x-1/4*pi)^6*sin(z)-1/5040*(x-1/4*pi)^7*cos(z)+1/40320*(x-1/4*pi)^8*sin(z)+1/362880*(x-1/4*pi)^9*cos(z)-1/3628800*(x-1/4*pi)^10*sin(z);


To generate the equation for

>> syms t
>> syms x
>> f=sin(x);
>> r= (1/factorial(10))*int(((x-t)^10)*diff(f,11),t,(pi/4),x);
>> r

r =

-1301357606610903/51946031311566097350656*cos(x)*(x^11-1/4194304*pi^11)+1301357606610903/4722366482869645213696*x*cos(x)*(x^10-1/1048576*pi^10)-6506788033054515/4722366482869645213696*x^2*cos(x)*(x^9-1/262144*pi^9)+19520364099163545/4722366482869645213696*x^3*cos(x)*(x^8-1/65536*pi^8)-19520364099163545/2361183241434822606848*x^4*cos(x)*(x^7-1/16384*pi^7)+27328509738828963/2361183241434822606848*x^5*cos(x)*(x^6-1/4096*pi^6)-27328509738828963/2361183241434822606848*x^6*cos(x)*(x^5-1/1024*pi^5)+19520364099163545/2361183241434822606848*x^7*cos(x)*(x^4-1/256*pi^4)-19520364099163545/4722366482869645213696*x^8*cos(x)*(x^3-1/64*pi^3)+6506788033054515/4722366482869645213696*x^9*cos(x)*(x^2-1/16*pi^2)-1301357606610903/4722366482869645213696*x^10*cos(x)*(x-1/4*pi)


To generate the graph for vs ; where

z=pi/4;
for i= 1:1:1000
x = ((i-1)/1000)*pi;
p=sin(z)+(x-1/4*pi)*cos(z)-1/2*(x-1/4*pi)^2*sin(z)-1/6*(x-1/4*pi)^3*cos(z)+1/24*(x-1/4*pi)^4*sin(z)+1/120*(x-1/4*pi)^5*cos(z)-1/720*(x-1/4*pi)^6*sin(z)-1/5040*(x-1/4*pi)^7*cos(z)+1/40320*(x-1/4*pi)^8*sin(z)+1/362880*(x-1/4*pi)^9*cos(z)-1/3628800*(x-1/4*pi)^10*sin(z);
r=-1301357606610903/51946031311566097350656*cos(x)*(x^11-1/4194304*pi^11)+1301357606610903/4722366482869645213696*x*cos(x)*(x^10-1/1048576*pi^10)-6506788033054515/4722366482869645213696*x^2*cos(x)*(x^9-1/262144*pi^9)+19520364099163545/4722366482869645213696*x^3*cos(x)*(x^8-1/65536*pi^8)-19520364099163545/2361183241434822606848*x^4*cos(x)*(x^7-1/16384*pi^7)+27328509738828963/2361183241434822606848*x^5*cos(x)*(x^6-1/4096*pi^6)-27328509738828963/2361183241434822606848*x^6*cos(x)*(x^5-1/1024*pi^5)+19520364099163545/2361183241434822606848*x^7*cos(x)*(x^4-1/256*pi^4)-19520364099163545/4722366482869645213696*x^8*cos(x)*(x^3-1/64*pi^3)+6506788033054515/4722366482869645213696*x^9*cos(x)*(x^2-1/16*pi^2)-1301357606610903/4722366482869645213696*x^10*cos(x)*(x-1/4*pi)
y=p+r;
plot(x,y);
hold on;
end


Solution for problem 7: Srikanth Madala 19:41, 27 January 2010 (UTC)

Proofread problem 7: Egm6341.s10.team2.patodon 04:22, 21 February 2010 (UTC)

Problem 8

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 6-5

Use 3 methods to find In:

1) Taylor Series Expansion, Fn 2) Composite Trapezoidal Rule 3) Composite Simpson Rule

for n=2,4,8 ... until the error is of order

Solution 1

[edit | edit source]

1)Taylor Series Expansion

The goal is to perform the following integration,

The problem with this is that it is an indefinite integral, which must be rewritten in another way in order to analyze it. The method discussed here will be Taylor Series Expansion or McClaurin Series Expansion. The function can be rewritten as follows:

The Taylor Series Expansion for

Using this new definition for the function one can then integrate it directly as follows:

Integrating this for a value of n=2 yields the following:

For n=4:

The percent difference between the actual value of the integral (1.3179022) and the estimated value is found by:

The following are the results for other values of n until the error is reduced to the power of

Taylor Series
n Estimated Value Percent Difference
n=2 1.2500000 5.152294305
n=4 1.3159722222 0.146443171
n=8 1.3179018152 2.91949E-05
n=16 1.3179021515 3.68355E-06
n=32 1.3179021515 3.68355E-06

Matlab Code used to generate the values for the table:

    function I =taylor(n)
    i=1;
    Itot=0;
    It=0;
    while i<=n
       if i==1
          Itot=1;
       else
            It=1/(factorial(i)*i);
       end
    Itot=Itot+It;
    i=i+1;
    end
    I=Itot;

Solution 2

[edit | edit source]

2)Composite Trapezoidal Rule The formula used to analyze the integral for a function using the composite trapezoidal rule is as follows:

It is also necessary to state the following, using L'Hopitals Rule

For n=2 the integration is approximated as follows:

The error is calculated by comparing it to the results obtained using the Taylor Series expansion, as follows:

This table displays the results for similar values:

Composite Trapezoidal Rule
n Estimated Value Percent Difference
n=2 1.3282917278 0.788338301
n=4 1.3205046195 0.197466812
n=8 1.3185530869 0.049388101
n=16 1.3180649052 0.012345774
n=32 1.3179428411 0.003083775
n=64 1.3179123240 0.000768187
n=128 1.3179046946 0.000189284
n=256 1.3179027872 4.45585E-05
n=512 1.3179023104 8.37696E-06
n=1024 1.3179021912 6.68424E-07

Matlab Code used to generate the values for the estimates:

    function I=ctrapz(n)
    i=0;
    Itot=0;
    It=0;
    It2=0;
    h=0;
    while i<=n
       if i==0
          Itot1=1;
       else if i<n
            h=1/n;
            It(i)=2*valu(h*i);
           else
               It2=valu(1);
           end
       end
    Itot=Itot1+sum(It)+It2;
    i=i+1;
    end
    I=Itot/(2*n);
    function F= valu(x);
    F=(exp(x)-1)/x;

Solution 3

[edit | edit source]

The Composite Simpson's Rule

The rule is defined as follows:

Using this definition the following is found:

Composite Simpson's Rule
n Estimated Value Percent Error
n=2 1.318008666 0.00807842
n=4 1.317908917 0.00050965
n=8 1.317902576 2.85304E-05
n=16 1.317902178 1.66813E-06

The Following MATLAB code was used to generate the values:

    function I = simpb(a,b,w)
    q=1;
    i=a;
    n=0;
    Sum=0;
    c=0;
    while n<w
        n=2^q;
        h=(a+b)/n;
    while i<=b
        fx=(exp(i)-1)/(i);
        if i==a
            Sum=1;
        else if i==b
                Sum=Sum+fx;
            else if i==(b-h)
                    Sum=Sum+(4*fx);
                else if rem(c,2)==0
                        Sum=Sum+(2*fx);
                    else
                        Sum=Sum+(4*fx);
                    end
                end
            end
        end
        c=c+1;
        i=i+h;
    end
    n
    In=Sum*(h/3);
    I=In;
    i=a;
    c=0;
    q=q+1;
    Sum=0;
    end

By Comparing all of the methods one is able to conclude that the most efficient method to numerically integrate was the composite Simpson's rule.


Solution for problem 8: Guillermo Varela

Problem 9

[edit | edit source]

Problem Statement

[edit | edit source]

Pg. 7-1

1) Expand in Taylor Series w/ remainder:

2) Find Taylor Series Expansion and Remainder of f(x). eq. 4 of p 6-3.

Solution

[edit | edit source]

Given:

[equation 4 p 2-2]

[equation 1 p 2-3]

Part 1

[edit | edit source]

for the case that , we get,

=

Using equation 1 p 2-3, we get the remainder as

for , we get

finally,

Part 2

[edit | edit source]

dividing both sides by x we get,

and remainder becomes

since , we have

where

Finally,


Solution for problem 9: Egm6341.s10.team2.niki 23:23, 20 February 2010 (UTC)

Proofread problem 9:

Problem 10

[edit | edit source]

Problem Statement

[edit | edit source]

P. 8-2.

Use eq. 2 of pg. 8-2 to obtain eq. 1 of Pg. 7-1.

Solution

[edit | edit source]


Solution for problem 10: Jiang Pengxiang

Proofread problem 10: Srikanth Madala 19:41, 27 January 2010 (UTC)

Problem 11

[edit | edit source]

Problem Statement

[edit | edit source]

P. 8-3

show eq. 4 is equal to eq. 2 by expanding eq. 4.

Solution

[edit | edit source]

Equation 2:

Equation 4:

Performing summation:

Definition of Kronecker delta Meeting 8 Notes :

Therefore,





For , two of the three terms resulting from the summation over index-j are negated. Since two of the terms will have i where and therefore equal to for those two terms and equal to for the remaining one term where .

Thus,


Solution for problem 11:
Egm6341.s10.team2.patodon 04:16, 21 February 2010 (UTC)

Proofread problem 11:

Contributing Authors

[edit | edit source]

--Niki Nachappa Chenanda Ganapathy 16:20, 27 January 2010 (UTC)

--Guillermo Varela 19:23, 27 January 2010 (UTC)

--Srikanth Madala 19:41, 27 January 2010 (UTC)

--Patrick O'Donoughue 20:12, 27 January 2010 (UTC)

--Jiang Pengxiang 21:13, 27 January 2010 (UTC)<br/

Problem Assignments
Problem Solution Proofread
Problem 1 SM GV
Problem 2 SM PO
Problem 3 GV NN
Problem 4 NN JP
Problem 5 JP SM
Problem 6 P0 GV
Problem 7 SM PO
Problem 8 GV NN
Problem 9 NN JP
Problem 10 JP SM
Problem 11 PO GV