Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that can calculate a definite integral of a function in C. Hints and additional information is included below. Write a program that

"Write a program that can calculate a definite integral of a function" in C. Hints and additional information is included below.

image text in transcribed

Write a program that can calculate a definite integral of a function. If you haven't taken Calculus 2, a definite integral is defined as follows In C programming language f(x)dx = F(b)-F(a) CL dF where F is the antiderivative off-ief =-If the function f is simple, it's possible to find the antiderivative. For example, if f = 2x then F = x2. However, if the function is more complicated, it's not possible to easily find the antiderivative - this is called a nonelementary antiderivative. For example, if f=sin (r), the antiderivative is not obvious dx In this case, we can use the following approximation f(e+ ian + f(a + (i + 1) i-N-1 f(x)dx = CL b-a This is equivalent to calculating summing up(*Ar) sx goes f(x)+f(x+Ax) Where N = from a to b in steps of Your program should take 4 arguments: function a b deltax where function is1, 2, or 3. If function is 1, f(x)sin (x). If function is 2, f(x)-x2 If function is 3, f(x) sin (2) So, to calculate sin (x) with = 0.0001, your program should do the following: ./integral 1 0 3.1415926 0.0001 integral value 2.000000 To calculate x2. your program should do the following ./integral 2 0 20.0001 integral value2.666667 Write a program that can calculate a definite integral of a function. If you haven't taken Calculus 2, a definite integral is defined as follows In C programming language f(x)dx = F(b)-F(a) CL dF where F is the antiderivative off-ief =-If the function f is simple, it's possible to find the antiderivative. For example, if f = 2x then F = x2. However, if the function is more complicated, it's not possible to easily find the antiderivative - this is called a nonelementary antiderivative. For example, if f=sin (r), the antiderivative is not obvious dx In this case, we can use the following approximation f(e+ ian + f(a + (i + 1) i-N-1 f(x)dx = CL b-a This is equivalent to calculating summing up(*Ar) sx goes f(x)+f(x+Ax) Where N = from a to b in steps of Your program should take 4 arguments: function a b deltax where function is1, 2, or 3. If function is 1, f(x)sin (x). If function is 2, f(x)-x2 If function is 3, f(x) sin (2) So, to calculate sin (x) with = 0.0001, your program should do the following: ./integral 1 0 3.1415926 0.0001 integral value 2.000000 To calculate x2. your program should do the following ./integral 2 0 20.0001 integral value2.666667

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Appropriately analyze and define the problem.

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago