Solving tan x = x: A Numerical Method

In summary: Well, the quadratic approximation is just one way of finding the next point, it does not have to be used in this case, and if used it should only be used in a region where the gradient does not change too drastically.By the way, the problem statement is "tan x = x" and not "tan x = x+5", so you should be solving the first one.
  • #1
quietrain
655
2

Homework Statement



tan x = x

Homework Equations





The Attempt at a Solution



how do i solve this equation without using graphs?

is there a numerical method ?

thanks a lot!
 
Physics news on Phys.org
  • #2
EDIT:bad steer
 
Last edited:
  • #3
er so how do i go about doing that?

how do i know what to guess?
 
  • #4
quietrain said:
er so how do i go about doing that?
try it and find out...
quietrain said:
how do i know what to guess?
draw a graph of y=tanx & y=x and pick an x value close to where they intersect, preferably on the left side of the intersection. Also notice there will actually be infinite solutions... so the value you start with will determine where you end up
 
Last edited:
  • #5
You can also assume that the equations are y=tanx and y=x, because that is how you find the intersection of lines right? Then, you can solve the equation graphically. However, you will still require some extent of iteration, however, you will have a general estimation of where to start rather than starting from 1 and going all the way to wherever you need to go.
 
  • #6
erm so is this something like Newton-raphson method?

all these are approximation methods right?

so there's no one accurate way of solving it numerically?

just another quick question,

for taylor series expansion, what do we actually mean when we say like the taylor series of tanx -x AT 0 ?

what does the "at 0" actually mean ?

so what are we solving for ?

like i need to find out the solution to tanx = x

so if i taylor expand tanx -x =0 ,what will be my value of a(which is the "AT where" thing) ?

and does it then mean the whole value is 0 ?
 
Last edited:
  • #7
ok so i went to taylor expand the function tanx-x=0 till the power 2 (3rd polynomial ? )

and i got 2 roots 4.4934026 or 4.300538079.

so why is the 2nd root wrong?

so i assume that "a" is my guess value, the whole equation = 0, and x is my value i am finding.

i don't really understand why those assumptions are such though :(
 
  • #8
sorry i think i gave you a very poor steer initially, Newton raphson would be a good idea to find the zeroes of this function

the first zero is relatively easy to find at x=0, the others lie oustsdie the range (-3pi/2, 3/pi/2) as the tan function repeats and will require a numerical method

for the taylor series, "at a" means you evaluate all the derivatives at x = 0, and all the power terms will be (x-0)^n. Effectively you are expanding about this point & the error of the approximation will be smallest at that point.

That said Taylor series are rarely used to find the zeros of a function, so I'm not sure why you're using it unless its to show that tan(x) behaves like x close to zero.

if f(x) = tan(x) the taylor series of about x=0 will be
f(x) = tan(x) , f(0) = 0
f'(x) = 1/(cos(x)) ,f'(0) = 1

so the expansion about zero is
f(x) = 0+1.(x-0) + O((x-0)^2)
f(x) = x + O(x^2)
so tan(x) looks like x near zero

the O mean the order of the further terms are x^2 and greater, for x<<1 they will be very small

when you substitute this into your eqaution
tan(x) - x = ( x + O(x^2))-x ~ O(x^2)

beware due to the behaviour of tan, i think this expansion will only be useful in teh raneg (-pi/2,pi/2)

i'm not too sure what you're doing with the quadratic rooots, can you explain further?
 
  • #9
i am not too sure too

i was following this website http://www.physics.utah.edu/~p373/docs/maple/maple_1/node2.html

it says that we can solve tanx = x through the Newton-raphson method which involves the taylor series expansion.

so i followed their taylor series expansion and i got 2 roots. 1st root is the correct one 4.4934, the 2nd root 4.300 is wrong. but how do i show its wrong? by substituting into the equation tan x = x ?

with regards to what you said about "evaluating all the derivatives at x=0, that means i choose my a = 0 right? that's the maclaurin's series?

so what does it mean when i use the taylor expansion on tan x -x = 0. what is my "a" in here?
 
  • #10
ok now i get it, first have a look at the following picture:
http://www.modeladoysimulacion.com.ar/applets/Newton/img/metodo.png

then i'll explain
 
Last edited by a moderator:
  • #11
The Newton raphson method, works by first choosing a point x0, this will be your best guess close to the zero (probably 4.5 after reading the page), and if the function doesn't change gradient too drastically nearby, the Newton raphson method should converge

Evaluate the function and its derivative at the given point, f(x0) and f'(x0)

then use these to fit a line of gradient f'(x0) through the point f(x0). This is essentially a first order taylor approximation, given by
f(x) ~ f(x0) + f'(x0)(x-x0)) + O(x^2),

it is easy to solve for the next point in our iteration x1, which is where the line crosses the x axis

then repeat the process, expanding about the new point x1
f(x) ~ f(x1) + f'(x1)(x-x1)) + O(x^2),

now find x2 and so on, effectively following the path shown in the previous picture

Unless asked there is no need to use a quadratic appoximation, as it complicates things. The 2 roots you got in this case will both be solutions to approximation, with one closer to the crossing you are trying to find...
 
Last edited:
  • #12
oh i see

so the gradient of the line in the form Y = MX + C ==> f(x0) - f(x1) = (x0 - x1) f '(x0)

so if i set f(x1) = 0, i will end up with the Newton-raphsod equation, which is the 1st order taylor series polynomial.

so is the term f(x1) equals 0 because i define my function tanx -x = 0? which means i am looking at the roots where tan x = x ?

so does it mean if my equation is tanx - x = 5, i must set my f(x1) term as 5? which means i am looking at the roots where tan x = 5+x?

so what the taylor series expansion does is actually like the Newton-raphsod method where you throw in your guess (x0) and it points you closer and closer to the actual value of f(x1)? from the equation f(x) ~ f(x0) + f'(x0)(x-x0)) + O(x^2)
 
  • #13
anyone? is my last post correct?
 
  • #14
quietrain - don't confuse the Newton-Raphson (N-R) method and Taylor Series as methods for solving F(x)=0. The Newton-Raphson method IS an iterative method for solving F(x)=0. One can construct the N-R method by employing a linear Taylor Series approximation to F(x).

Having said that, the Newton-Raphson method is of the form:

[tex]
x_{\nu+1} = x_{\nu} -\frac{F(x_{\nu})}{F'(x_{\nu})}
[/tex]

Here, F(x) is the expression you are trying to solve for zero. It's important to understand that the expression [itex]F(x^*) = 0 [/itex] at the desired root [itex]x = x^*[/itex]. Hence, for example, if your are trying to solve the following equation for x, you need to re-write the expression in terms of F(x) = 0.

Example: Solve for x in the following:

[tex]
\tan(x) - x = A
[/tex]

Re-write that as: Solve for x such that F(x) = 0.

[tex]
F(x) = \tan(x) - x - A = 0
[/tex]

Your iteration scheme would then be as follows:

[tex]
x_{\nu+1} = x_{\nu} - \frac{(\tan(x_{\nu}) - x_{\nu} - A)}{\tan^2(x_{\nu})}
[/tex]

To answer your questions directly:

so the gradient of the line in the form Y = MX + C ==> f(x0) - f(x1) = (x0 - x1) f '(x0)
so if i set f(x1) = 0, i will end up with the Newton-raphsod equation, which is the 1st order taylor series polynomial.
Close - more accuratly, we use a first order Taylor Series to construct the N-R method. For example, let the first order Taylor Series approximation for F(x), expanded about [itex]x_0[/itex], be

[tex]
F(x) \approx F(x_0) + F'(x_0) \cdot (x - x_0)
[/tex]

Using this approximation, what would "x" be if we assumed F(x) = 0. Re-writting the above:

[tex]
\frac{F(x) - F(x_0)}{F'(x_0)} = x - x_0
[/tex]

and since we assumed F(x) = 0, then

[tex]
x = x_0 -\frac{F(x_0)}{F'(x_0)}
[/tex]

We use this value of "x" and repeat the process (iterate) until convergence.

so is the term f(x1) equals 0 because i define my function tanx -x = 0? which means i am looking at the roots where tan x = x ?
Yes! You got it. And yes, your function is [tex]F(x) = tan(x) - x[/itex]

so does it mean if my equation is tanx - x = 5, i must set my f(x1) term as 5? which means i am looking at the roots where tan x = 5+x?

That's one way of looking at it, with F(x) = tan(x)-x. However, its better to consider the search for the zero of a function [itex]F(x)[/itex] so as not to "confuse the masses". See the example above [itex]F(x) = tan(x) - x - A[/itex]. This does not necessarily mean that your initial quess to x, ie [itex]x_0[/itex] is equal to A. But you ARE looking for the x such that [itex] \tan(x) = 5+x[/itex]. So you may want to graph those two curves ([itex]f_1(x) = \tan(x)[/itex] and [itex]f_2(x) = 5+x[/itex]) and find their approximate point of intersection (there will be and infinite number, but maybe your just interested in the first one(?)). The value of "x" at this intersection can be used for an initial estimate (ie, [itex]x_0[/itex]).

so what the taylor series expansion does is actually like the Newton-raphsod method where you throw in your guess (x0) and it points you closer and closer to the actual value of f(x1)? from the equation f(x) ~ f(x0) + f'(x0)(x-x0)) + O(x^2)

Again, N-R is the iteration method. The first order Taylor Series is the construction tool to the iteration method. Do not use the Taylor Series approximation to solve for the root - use the N-R method to iterate to the root.
 
Last edited:
  • #15
TheoMcCloskey said:
[tex]
x = x_0 -\frac{F(x_0)}{F'(x_0)}
[/tex]

We use this value of "x" and repeat the process (iterate) until convergence.
If rather than until it converges. There is no guarantee that Newton-Raphson will converge. Consider the case g(x)=x1/3. Then g/g'=3x, making the Newton-Raphson iterator for finding a solution for g(x)=0 is xn+1=-2xb.

The function f(x)=tan(x)-x exemplifies the strengths and weaknesses of Newton-Raphson. Neither it nor its derivative well-behaved. Both have an infinite number of poles and zeros. The derivative is zero at the trivial solution, x=0. This makes the convergence of Newton-Raphson particularly bad for this particular zero. For sufficiently small [itex]x_n, x_{n+1} = x_n - f(x_n)/f'(x_n) \approx 2/3\,x_n[/itex]. The convergence is linear rather than quadratic.
 
  • #16
ah i see...

thank you everyone very much!
 
  • #17
Hi All,

Can anybody help me to know how can i find the smallest positive root of the equation tanx=x.

I tried by Newtons raphsons method and i got root between [4,4.5] but how to show that it is a least positive root?

Thanks in advance!
 
  • #18
you could show it has a root at zero, is increasing afterwards, and has only one stationary point (turning point) in between
 
  • #19
that is if you consider
f(x) = x-tanx

oppposite but same method if you wanted to use -f(x)
 

Related to Solving tan x = x: A Numerical Method

What is the definition of "tan x = x"?

"Tan x = x" is a mathematical equation that represents the values of the tangent function and the variable x being equal to each other. In other words, it is an equation where the tangent of an angle is equal to the value of the angle itself.

Why is a numerical method used to solve "tan x = x"?

A numerical method is used to solve "tan x = x" because it is a transcendental equation, meaning it cannot be solved algebraically. Therefore, a numerical approach, such as iteration or approximation, is needed to find an approximate solution.

What is the process for solving "tan x = x" using a numerical method?

The process for solving "tan x = x" using a numerical method involves choosing an initial guess for the solution, plugging it into the equation, and using a formula or algorithm to refine the guess until the solution is reached within a desired level of accuracy.

How accurate are the solutions obtained through a numerical method for "tan x = x"?

The accuracy of the solutions obtained through a numerical method for "tan x = x" depends on the chosen initial guess and the algorithm used. With a proper initial guess and a well-designed algorithm, the solutions can be very accurate.

Are there any limitations to using a numerical method to solve "tan x = x"?

Yes, there are limitations to using a numerical method to solve "tan x = x". These methods require a significant amount of computational power and can be time-consuming. Also, they may not always converge to a solution, especially if the equation has multiple solutions or a complex solution.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
806
  • Calculus and Beyond Homework Help
Replies
5
Views
159
  • Calculus and Beyond Homework Help
Replies
9
Views
887
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
903
  • Calculus and Beyond Homework Help
Replies
7
Views
940
  • Calculus and Beyond Homework Help
Replies
3
Views
521
  • Calculus and Beyond Homework Help
Replies
10
Views
655
  • Calculus and Beyond Homework Help
Replies
2
Views
704
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
Back
Top