Answered step by step
Verified Expert Solution
Question
1 Approved Answer
needs to be done in C programming and the last material cover in class was arrays Write a program that can calculate a definite integral
needs to be done in C programming and the last material cover in class was arrays
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: f(x) = F(b)-F (a) al where F is the antiderivative off-ie. f = dF. If the function f is simple, it's possible to find the antiderivative. For example, iff = 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(H), the antiderivative is not obvious. In this case, we can use the following approximation i -1 f(a + iAx) + f(a + (i +1)Ax2 f(x) = Where N =- Your program should take 4 arguments: function a b deltax where function is 1, 2, or 3. If function is 1, f(x)sin (x). If function is 2, f (x)-2. Iffunction is 3,f(x) = sin (x2). So, to calculate .10 sin (x) with Ax 0.0001, your program should do the following $./integral 1 0 3.1415926 0.0001 integral value = 2.000000 To calculate x', your program should do the following: $./integral 2 0 2 0.0001 integral value = 2.666667
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started