Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

computer science Dev C + + f ( x ) = c o s ( x ) e x p x ( x 4 +

computer science
Dev C++
f(x)=cos(x)expx(x4+x2+1)32, and design programs for finding the derivative of f(x) and integral results of f(x) by using "Function". These functions are needed to use the iteration method. (a)(1.5) The derivative of f(x) is limh0f(x+h)-f(x-h)2h. The method of iteration is letting width h approach 0. The user could enter the x, initial width b, and iteration error to find the f(x).(b)(2.5) Using a trapezoidal method to calculate the integral result of f(x). The Integral results of f(x) is ??f(x)x, and x is sub-interval width. The method of iteration is letting the sub-interval width approach 0. The user could enter the start of interval x1, end of interval x2, and iteration error to find the integral results of f(x) between x1 and x2.
Integral of f(x)
x1x2f(x)dx~~(x2-x1i)[f(x2)+f(x1)2+k=1i-1f(x1+kx2-x1i)]=F
i is iteration number. Iteration error is difference between (i+1)th and ith of F
The output looks like
Enter the variable x
3
Enter initial width for derivative
2
Enter the iteration error for derivative
0.000001
The derivative of function at x=3 is 0.0168597
Enter the start of interval x1
2
Enter the end of interval 2
12
Enter the iteration error for integral
0.000001
The integral of function between 1 and 2 is -0.0454551
Enter the variable x
0.3
Enter initial width for derivative
3
Enter the iteration error for derivative
0.00001
The derivative of function at x=0.3 is -0.309528
Enter the start of interval 1
-5
Enter the end of interval 2
3
Enter the iteration error for integral
0.00001
The integral of function between 1 and 2 is 1.28768
image text in transcribed

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

Students also viewed these Databases questions

Question

3.1 Given A = 3E1, E3, E6, E94 , define A.

Answered: 1 week ago