# How can I solve this system with Newton's method?

Tags:
1. Dec 20, 2016

### lucasLima

1. The problem statement, all variables and given/known data
I'll try to be as clear as possible but this exercise is in portuguese and this is a free translation from me
"The sum of two numbers is 3.4 .If we take each of them and summed with they square, the product of it would be 18.5856. The lowest of those number is in the interval [1,1.5]Solve it using the Newthon Methot for an error lesser than 10^-2"

2. Relevant equations
(deduced by me from the problem)
x+y=3.4
(x+x2)*(y+y2)=18.5856

3. The attempt at a solution

y=x-3.4

(x+x2)*(x+x2+x2+2*x3+x4)=18.5856

x6+3*x5+4*x4+3*x3+x2-18.5865=f(x)

6*x5+15*x4+16*x3+9*x2+2*x=f'(x)

iterative function = x - f(x)/f'(x)
Am I in the right way? Because if i continue with this I will come to
a really big equation and this exercise looks way simpler than this.

My main concerns are:
1- Are the equation that I provided right for what the problem is asking?
2-Should I have stayed with x and y and solved as a non-linear system? I've made this way because the problem is in a list made for the linear chapter, but it could be an error.
3-If i'm in the right direction, is there a way to simplify this equation in a product of sums ?

2. Dec 20, 2016

### BvU

Hi,
It doesn't get any bigger than that:
You make an inital guess $x_0$ and apply $x_1 = x_0 - {f(x_0)\over f'(x_0)}$ as your first iteration, then $x_2 = ...x_1$ etc

3. Dec 20, 2016

### lucasLima

It just seems really odd to me, because in all the other exercises in this list there was a maximum of 4 instances of x in a equation iteration, and this one has 11. I was wondering if I wasn't missing anything.

4. Dec 20, 2016

### BvU

1 they work like a dream. Perfect. (*)
2 No, you did just fine. There is only one degree of freedom. The Newton method is used for solving non-linear equations of the type f(x) = 0.
3. Not only the right direction: you are where you want to be. However, now it's time to switch over to numerical work: pick a starting value, calculate f and f' for that value and do an iteration. Then another one. Maximum you need is 4 iterations (*).

(*) I copy-pasted your formulas for f and f' to a spreadsheet and saw it worked OK.

No, really, you're fine.

5. Dec 20, 2016

### BvU

Ah, wait. I (we) solved (x+x2)*(x+x2+x2+2*x3+x4)=18.5856 to find 1.113705
But according to the problem statement, 3.4 - 1.113705 should also solve this, and it doesn't. So there is a hitch between (x+x2)*(y+y2)=18.5856 and (x+x2)*(x+x2+x2+2*x3+x4)=18.5856. This last one doesn't look as if you substituted y = 3.4 - x !?!

6. Dec 20, 2016

### Ray Vickson

You made an algebra error: for $y = 3.4-x$ we have $y+y^2 = (3.4-x) + (3.4-x)^2$. When you expand this out it will not be equal to the $x + x^2 + x^2 + 2x^3 + x^4$ that you wrote.

Last edited: Dec 20, 2016
7. Dec 20, 2016

### lucasLima

Hello everyone! Sorry for the silly mistake and thank you for the quick answers!
I'll try my best to not let any algebraic errors pass.

So, now I have

(x+x2)(3.4-x+11.56-6.8x+x2)-18.5856=0

f(x) = (x+x2)(x2-7.8x+14.96)-18.5856

f(x) = (x+x2)(x+3.8676)2)-18.5856
f'(x) = (1+2x)(x+3.8676)2+(x+x2)(2x-7.8)

i(x)= x - f(x)/f'(x)

i(1.25)=0.5325 (what is wrong, because the problem tell me that the lowest number is in [1,1,5]

i(0.5325)=0.61324

i(0.61324)=0.64672 ... and it's converging for something that it's wrong. Any Idea where I might have messed up?

8. Dec 20, 2016

### Ray Vickson

You write $3.4-x + 11.56-6.8 + x^2 = (x+3.867)^2$. That is false: $(3.4-x) + (3.4-x)^2 = (3.4 - x)(4.4-x)$.

9. Dec 22, 2016

### BvU

So did you manage to conclude this exercise, Lucas ?

10. Dec 22, 2016

### lucasLima

Yes I did! Thanks everyone for the help.

11. Dec 22, 2016

### BvU

I agree with the 1.17
For the 1.19 I get 1.1992 and the residu is then -0.007 which is < 0.01 -- you should use one more digit (or a calculator or a spreadsheet).
Your residu is > 0.01 so you are not done yet !

Note that the 'error' for $x_n$ is $f(x)$ and not $|x_n - x_{n-1}|\over |x_n|$