Question

For each equation, write a brief program to compute and print eight steps of Newton's method...

For each equation, write a brief program to compute and print eight steps of Newton's method for finding a positive root (Preferably in Matlab or Python).

a. x=2sinx

b. x^3=sinx+7

c. sinx=1-x

d. x^5+x^2=1+7x^3 for x>=2

Homework Answers

Answer #1

A)

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= x(i)-2*sin(x(i));

der_f(i)=1-2*cos(x(i));

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

B)

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= x(i).^3-sin(x(i))-7;

der_f(i)=3*x(i).^2-cos(x(i));

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

C).

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= sin(x(i))-1-x(i);

der_f(i)=cos(x(i))-1;

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

D).

clc

clear all

x(1)=2;

iter(1)=0;

for i=1:7

f(i)= x(i).^5+x(i).^2-1-7*x(i).^3;

der_f(i)=5*x(i).^4+2*x(i)-21*x(i).^2

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

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
Each equation has one root. Use Newton’s Method to approximate the root to eight correct decimal...
Each equation has one root. Use Newton’s Method to approximate the root to eight correct decimal places. (a) x3 = 2x + 2 (b) ex + x = 7 (c) ex + sin x = 4 **MUST BE DONE IN MATLAB AND NEED CODE
Python Practice Sample: Question 1. Math Write a program that runs these steps three times: ...
Python Practice Sample: Question 1. Math Write a program that runs these steps three times:  Ask the user to enter a non-zero number (can be positive or negative).  Find the cube of the number and subtracts 100.0 from the cube.  Calculate the square root of the result above. If the result is negative, multiply the result by -1 so it is positive before calculating the square root.  Print the result with two decimal places.
Use Newton's method to approximate the root of the equation to four decimal places. Start with...
Use Newton's method to approximate the root of the equation to four decimal places. Start with x 0 =-1 , and show all work f(x) = x ^ 5 + 10x + 3 Sketch a picture to illustrate one situation where Newton's method would fail . Assume the function is non-constant differentiable , and defined for all real numbers
solve cos(x)=x^2 using Newton's Method accurate to eight decimal places. Show all steps in solution. How...
solve cos(x)=x^2 using Newton's Method accurate to eight decimal places. Show all steps in solution. How many roots are there?
Use Newton's method to find all solutions of the equation correct to eight decimal places. Start...
Use Newton's method to find all solutions of the equation correct to eight decimal places. Start by drawing a graph to find initial approximations. (Enter your answers as a comma-separated list.) x x2 + 1 = 1 − x
Each equation has one real root. Use Newton’s Method to approximate the root to eight correct...
Each equation has one real root. Use Newton’s Method to approximate the root to eight correct decimal places. (a) x5 + x = 1 (b) sin x = 6x + 5 (c) ln x + x2 = 3 **MUST BE DONE IN MATLABE AND SHOW CODE
IN JAVA 1. Write up a small program that accepts two integers from the user. Print...
IN JAVA 1. Write up a small program that accepts two integers from the user. Print which of the two values is bigger. If they are the same, print that they are the same. 2. Write a method that accepts three doubles. Calculate and return the average of the three passed double values. 3. Write up a method that accepts a score between 0-10. Print out a message according to the following table. You ay personally decide the boundaries. i.e.,...
Use Newton's method with the specified initial approximation x1 to find x3, the third approximation to...
Use Newton's method with the specified initial approximation x1 to find x3, the third approximation to the root of the given equation. x3 + 5x − 2 = 0,    x1 = 2 Step 1 If f(x) = x3 + 5x − 2, then f'(x) = _____ x^2 + _____ 2- Use Newton's method to find all roots of the equation correct to six decimal places. (Enter your answers as a comma-separated list.) x4 = 5 + x .
A graphing calculator is recommended. Use Newton's method to find all solutions of the equation correct...
A graphing calculator is recommended. Use Newton's method to find all solutions of the equation correct to eight decimal places. Start by drawing a graph to find initial approximations. (Enter your answers as a comma-separated list.) -2x^7-4x^4+9x^3+2=0
(Python Programming) Write a program that prompts a user for a positive integer and then uses...
(Python Programming) Write a program that prompts a user for a positive integer and then uses a loop to calculate and display the sum of specific fractions as follows: Let's say the user enters 5, then your program will compute: 1/5 + 2/4 + 3/3 + 4/2 + 5/1 which is 8.7.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT