# Bisection and Newton's Approximation

• arhzz
arhzz
TL;DR Summary: Writing functions for Bisection and Newtons Approximation in Mathematica

Hello! I need to write 2 functions in mathematica, to find the roots of functions. The functions are the Bisection methods and Newtons Approximation.

(b1) Write your own function ApproxBisect[a0_,b0_,n_], which starting from an initial interval [a0, b0] approximates a root of the function in n steps. As a result, output the list of the n interval midpoints and the corresponding function values.

(b2) Test your function for the function f over a suitably chosen range and an appropriate number of approximation steps.

The function f(x) is this ## f(x) = \sinh(x) - 2^x + x^4 - 2x^3 - 26x^2 + 4x + 48 ##

Now this is my attempt at the solution (since I dont know how to post mathematica code formatted nicely I will put a screenshot)

For Newton I tried this

And I printed all the values as a list (I can post a screenshot of the code if necesarry)

Now my main question is this ; Would you say this is correct ? I have never programmed in mathematica before so it is very new to me and I am not the most skilled programmer as it is. And since this is a team project I really dont want to be the reason we get a bad grade or worst case scenario fail the class.

Secondly, as I've stated that I am a beginner in mathematica, all tipps/tricks/suggestions are welcome; (efficiency,readability etc.) Also any good literature (crashcourse would be ideal) in mathematica is also appreciated.

arhzz

• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• Engineering and Comp Sci Homework Help
Replies
4
Views
1K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• General Math
Replies
1
Views
9K
• Calculus
Replies
13
Views
1K
• Engineering and Comp Sci Homework Help
Replies
8
Views
2K
• Differential Equations
Replies
1
Views
1K
• Differential Equations
Replies
6
Views
2K
• Engineering and Comp Sci Homework Help
Replies
2
Views
2K
• Engineering and Comp Sci Homework Help
Replies
4
Views
3K