Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

C programming and please write a function for each integral to be called at the start by using 1,2 or 3 Write a program that

C programming and please write a function for each integral to be called at the start by using 1,2 or 3

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: f(x) = F(b)-F (a) dF where F is the antiderivative off-ie. f =If the function f is simple, it's possible to find the antiderivative. For exarmple, 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 (x*), the antiderivative is not obvious. In this case, we can use the following approximation: f(a +iAx) +f(a +(i + 1)Ax) f(x) = Ax 0 where N =- Ax Your program should take 4 arguments: function a b deltax wherefunction is 1, 2, or 3. Iffunction is 1,f(x) = sin (x). Iffunction is 2, f(x)-x. !ffunction is 3,f(x) = sin (x2). So, to calculate lo 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, your program should do the following: s./integral 2 0 2 0.0001 integral value = 2.666667

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions