Question

C++ Programming Determine the roots of the function with errors of less than 0.1% for x...

C++ Programming

Determine the roots of the function with errors of less than 0.1% for x values between -5 and 5. you MUST NOT utilize the "if" statement in your code. Use the Newton-Raphson method.

f(x) = sin(x)

Homework Answers

Answer #1

SOLUTION:-

PROGRAM

#include<bits/stdc++.h>
using namespace std;

int main()
{
cout<<"Values of sin(x) for x values from -5 to 5\n\n";

cout<<"x"<<"\t"<<"sin(x)\n";
for(double i=-5;i<=5;i=i+0.5)
{
cout<<"\n"<<i<<"\t"<<sin(i);
}

return 0;
}

IMAGE OF PROGRAM

IMAGE OF OUTPUT

THANK YOU, if any queries please leave your valuable comment on comment box..........

If possible please rate the answer as well..........

Know the answer?
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
Similar Questions
WRITE MATLAB CODE TO SOLVE THIS!! YOU NEED TO DETERMINE TWO POSITIVE ROOTS Determine the two...
WRITE MATLAB CODE TO SOLVE THIS!! YOU NEED TO DETERMINE TWO POSITIVE ROOTS Determine the two positive roots of f(x) = 7 sin(x)e-x - 1 : a)Graphically. b)Using the Newton-Raphson method. c)Using the secant method. Initial guesses of x can be decided from the plot and use maximum iterations. Explain your results.
WRITE MATLAB CODE TO SOLVE THIS!! YOU NEED TO DETERMINE TWO POSITIVE ROOTS Determine the two...
WRITE MATLAB CODE TO SOLVE THIS!! YOU NEED TO DETERMINE TWO POSITIVE ROOTS Determine the two positive roots of f(x) = 7 sin(x)e-x - 1 : a)Graphically. b)Using the Newton-Raphson method. c)Using the secant method. Initial guesses of x can be decided from the plot and use maximum iterations. Explain your results.
Determine one of the roots of the non linear equation f (x) = 2x3 - x2...
Determine one of the roots of the non linear equation f (x) = 2x3 - x2 -1 using Newton Raphson Method. If known the initial value x = -3 and accuracy to 3 decimal places!
Determina las raíces reales de f(x) = -0.4x2 + 2.2x + 4.7. Utiliza los valores iniciales...
Determina las raíces reales de f(x) = -0.4x2 + 2.2x + 4.7. Utiliza los valores iniciales de x=0 y x=8. a) Gráficamente b) Por medio de la fórmula general c) Utiliza el método de bisección con tres iteraciones para determinar la raíz más grande. Calcula los errores. d) Utiliza el método de la secante con tres iteraciones para determinar la raíz más grande. Calcula los errores. e) Utiliza el método de Newton-Raphson con tres iteraciones para determinar la raíz más...
Only MATLAB code is required. No handwritten solution is requested. Use the Newton-Raphson method to determine...
Only MATLAB code is required. No handwritten solution is requested. Use the Newton-Raphson method to determine a root of f (x) =− 0.9x2 + 1.7x + 2.5 using x0 = 5 . Perform the computation until ε a is less 0.01%. Verify the results with the plot. ( 25 pts. )
For the following function, determine the highest real root of f(x) = 2x3 – 11.7x2 +...
For the following function, determine the highest real root of f(x) = 2x3 – 11.7x2 + 17.7x - 5 by using (a) graphical methods, (b) fixed point iteration (three iterations, x0 = 3) (Hint: Be certain that you develop a solution that converges on the root), and (c) Newton-Raphson method (three iterations, x0 = 3). Perform an error check on each of your final root approximations (e.g. for the last of the three iterations).
Find the root of the function given below that is greater than zero with the Newton-Raphson...
Find the root of the function given below that is greater than zero with the Newton-Raphson method. First guess value You can get x0 = 0 f (x) = x2 + x - 2
Suppose f(x) is a differentiable function such that f(2)=3 and f'(x) is less than or equal...
Suppose f(x) is a differentiable function such that f(2)=3 and f'(x) is less than or equal to 4 for all x in the interval [0,5]. Which statement below is true about the function f(x)? The Mean Value Theorem implies that f(4)=11. The Mean Value Theorem implies that f(5)=15. None of the other statements is correct. The Intermediate Value Theorem guarantees that there exists a root of the function f(x) between 0 and 5. The Intermediate Value Theorem implies that f(5)...
The cumulative distribution function for a random variable X is F(x)= 0 if x less than...
The cumulative distribution function for a random variable X is F(x)= 0 if x less than or equal 0, or F(x)=sinx if 0 is less than x is less than or equal to pi/2 , or F(x)= 1, if x is greater than pi/2 . (a) find P(0.1 less than X less than 0.2. (b) find E(x)
Determine the degree of the MacLaurin polynomial for the function f(x) = sin x required for...
Determine the degree of the MacLaurin polynomial for the function f(x) = sin x required for the error in the approximation of sin(0.3) to be less than 0.001, and this approximate value for sin(0.3).
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT