Question

o. 1 1+x4 Note the exact value is 0.24375 calculate with excel and python

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Using python it can be done using SciPy library

And quad function can be used for general purpose integration

Code without comments(Python 3.6)

***refer to the attached snapshot for indentation***

DO NOT JUST COPY PASTE THE CODE BELOW

=================================================================

from scipy.integrate import quad
import math

def integrand(x):
return 1/(1+(x**4))

ans,err = quad(integrand,1,math.inf)
print(ans)

=================================================================

Code with comments:

=================================================================

#import quad from scipy.integrate
from scipy.integrate import quad
#import math for using the 'inf' value
import math

#function which will return the integrand
def integrand(x):
return 1/(1+(x**4))
#quad returns 2 values the answer and the error
#and it takes 3 arguments - first is integrand
#second is the lower limit of integration
#and third is upper limit of integration
ans,err = quad(integrand,1,math.inf)
#display the answer
print(ans)

=================================================================

Snapshot

from scipy.integrate import quad import math def integrand (x) return 1/ (1+ (x**4)) ans,err - quad (integrand, 1,math.inf)l

Sample OUTPUT

0.24374774719968054

Excel

for integration we need special functions which are not available by default. You need to download the add ins.

download excel lab calculus add in from the below link if not already installed.

it will ask to create an account, remember your id and password after creating the account as it will be needed at the time of installation.

It gives a free 15 day license, for further use you need to buy it.

you will probably need to download the 32 bit installer

after its downloaded install it. For activating the add in you may need to go to the location where you have installed excel lab and open the file ExcelLab inside bin folder.

LINK=>https://excel-works.com/order/downloadlnk

Once everything is set, you can proceed as follows:

first enter your function after the equals

1/1aX1

here x1 is the variable

after you press enter this value will actually become 1, dont worry about that

now use the function quadf

write =quadf(

QUADF(A2,X1,1,inf)

write the parameters

1st parameter is the function to be integrated

2nd is the variable of integration

third is lower limit

and 4th is upper limit

press enter

0.243747747

Add a comment
Know the answer?
Add Answer to:
O. 1 1+x4 Note the exact value is 0.24375 calculate with excel and python
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT