Finding 10 Positive Solutions for Tan x = 1/x Numerically

  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Tan
Click For Summary

Homework Help Overview

The discussion revolves around finding the first 10 positive solutions to the equation $$\tan x = \frac{1}{x}$$ numerically. This is identified as a transcendental equation, which complicates finding exact solutions.

Discussion Character

  • Exploratory, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss various numerical methods, including the use of Mathematica and Matlab, and express challenges with specific functions like NSolve and FindRoot. There are suggestions to graph the functions involved and to consider the reciprocal of the equation.

Discussion Status

Several participants have shared their attempts and frustrations with different software tools. Some have provided hints and alternative methods, while others express uncertainty about their numerical analysis skills. There is a mix of exploration of methods and sharing of experiences with software capabilities.

Contextual Notes

Some participants mention their lack of experience with numerical analysis and specific software, indicating a learning context. There are references to forum rules about not asking for direct solutions, which shapes the nature of the discussion.

Dustinsfl
Messages
2,217
Reaction score
5
How do I find the first 10 positive solutions numerically?
$$
\tan x = \frac{1}{x}
$$
 
Physics news on Phys.org
I tried using NSolve in Mathematica but that didn't work.

I also tried
syms x
solve(tan(x)==1/x)
in Matlab and that just gave -263.

How can I do this in one of these programs?
 
Last edited:
Dustinsfl said:
How do I find the first 10 positive solutions numerically?
$$
\tan x = \frac{1}{x}
$$

How do you find the first positive solution? You tell US; do not ask us to tell you: read the forum rules.

RGV
 
Last edited:
Dustinsfl said:
How do I find the first 10 positive solutions numerically?
$$
\tan x = \frac{1}{x}
$$
Where are you stuck?

What have you tried?

After 490 posts, you should know the drill here at PF .

But here's one hint: One thing I would try is to take the reciprocal of both sides of that equation, giving you:
[itex]\displaystyle \cot(x)=x[/itex]​

Graph each side.
 
Ray Vickson said:
How do you find the first positive solution? You tell US; do not ask us to tell you: read the forum rules.

RGV

I am not good at numerical analysis. I haven't taken a course in it yet as well as in Matlab. I will be taking Matlab this spring and Numerical Analysis next fall. So when I know how to do it and use Matlab efficiently, I won't even ask you.
 
SammyS said:
Where are you stuck?

What have you tried?

After 490 posts, you should know the drill here at PF .

But here's one hint: One thing I would try is to take the reciprocal of both sides of that equation, giving you:
[itex]\displaystyle \cot(x)=x[/itex]​

Graph each side.

Read post 3.
 
dextercioby said:
Numerically means approximately since this is a transcendental equation. Only some computer software would give you the results, I think.

http://www.wolframalpha.com/input/?i=Plot+y(x)+=+tan+x+-+1/x

I have a graph of it. I don't know if the forum can handle tikz but here it is
$$
\begin{tikzpicture}[>=stealth',x = .5cm,y = .5cm,scale = .60]
\def\npi{3.1416}
\def\periods{4}
\draw[->] (-\npi/2,0) -- ({(\periods + .5)*\npi},0) node[above] {$\lambda_n$};
\draw[->] (0,-10) -- (0,10) node
{$f(\lambda_n)$};
\clip (-\npi/2,-9.8) rectangle ({(\periods + .5)*\npi},9.8);
\draw[thick, domain = 0.05:{(\periods + .4)*\npi},samples = 300,smooth,color = red] plot (\x,1/\x);
\foreach \n in {0,...,4}
\draw[thick,shift = {(\npi*\n,0)},domain = -\npi/2+.1:\npi/2-.1,samples = 100,smooth] plot (\x,{tan(\x r)});
%draw the ticks
\foreach \x in {1,...,10} \draw (\x*\npi/2,2pt) -- (\x*\npi/2,-2pt);
%draw labels n\pi/2 for odd n >= 3
\foreach \x in {3,5,...,7} \node[below] at (\x*\npi/2,0) {$\frac{\x\pi}{2}$};
%draw labels n\pi for n >= 2
\foreach \x in {2,...,4} \node[below] at (\x*\npi,0) {$\x\pi$};
\node[below] at (\npi/2,0) {$\frac{\pi}{2}$};
\node[below] at (\npi,0) {$\pi$};
\end{tikzpicture}
$$​
 
Dustinsfl said:
I am not good at numerical analysis. I haven't taken a course in it yet as well as in Matlab. I will be taking Matlab this spring and Numerical Analysis next fall. So when I know how to do it and use Matlab efficiently, I won't even ask you.

You don't need to know how to use Matlab, etc. Just apply Newton's method, which you can do using a hand-held scientific calculator. If you have not ever seen Newton's method before, I would be very surprised.

RGV
 
  • #10
Here are the graphs of y=x and y=cot(x), superimposed. (from WolframAlpha)

attachment.php?attachmentid=51374&stc=1&d=1349045971.gif
 

Attachments

  • WA_cot_vs_x.gif
    WA_cot_vs_x.gif
    5 KB · Views: 2,931
  • #11
SammyS said:
Here are the graphs of y=x and y=cot(x), superimposed. (from WolframAlpha)

attachment.php?attachmentid=51374&stc=1&d=1349045971.gif

I tried using NSolve in Mathematica but that didn't work.

I also tried
syms x
solve(tan(x)==1/x)
in Matlab and that just gave -263.

How can I do this in one of these programs?
This is what I wrote in post 3.
I can make graphs of this with the Tikz package and in Mathematica (that isn't the challenge here). How can I use Mathematica or Matlab to generate the first 10 positive solution?
 
  • #12
Dustinsfl said:
I tried using NSolve in Mathematica but that didn't work.

I also tried
syms x
solve(tan(x)==1/x)
in Matlab and that just gave -263.

How can I do this in one of these programs?
This is what I wrote in post 3.
I can make graphs of this with the Tikz package and in Mathematica (that isn't the challenge here). How can I use Mathematica or Matlab to generate the first 10 positive solution?

I don't have access to Mathematica (except through Wolfram Alpha) or to Matlab, but in Maple it is easy:
S:=fsolve(tan(x)=1/x,x=0..Pi/2),seq(fsolve(tan(x)=1/x,x=Pi/2+(i-1)*Pi..Pi/2+i*Pi),i=1..9);
S := 0.8603335890, 3.425618459, 6.437298179, 9.529334405,

12.64528722, 15.77128487, 18.90240996, 22.03649673,

25.17244633, 28.30964285
I'm sure it must be possible, even easy, to do the same thing in Mathematica.

RGV
 
Last edited:
  • #13
Ray Vickson said:
I don't have access to Mathematica (except through Wolfram Alpha) or to Matlab, but in Maple it is easy:
S:=fsolve(tan(x)=1/x,x=0..Pi/2),seq(fsolve(tan(x)=1/x,x=Pi/2+(i-1)*Pi..Pi/2+i*Pi),i=1..9);
S := 0.8603335890, 3.425618459, 6.437298179, 9.529334405,

12.64528722, 15.77128487, 18.90240996, 22.03649673,

25.17244633, 28.30964285
I'm sure it must be possible, even easy, to do the same thing in Mathematica.

RGV
Thanks. Hopefully in the spring when I take programming in Matlab I will be better at this.
 
  • #14
Dustinsfl said:
I tried using NSolve in Mathematica but that didn't work.
Try using FindRoot instead.
 
  • #15
Dustinsfl said:
I tried using NSolve in Mathematica but that didn't work.
...
How can I do this in one of these programs?

In[7]:= Plot[Tan[x]-1/x,{x,.01,30}]

Out[7]= <snip graphic showing approximate positions of solutions>

In[8]:= FindRoot[Tan[x]-1/x,{x,.9}]

Out[8]= {x->0.860334}

In[9]:= FindRoot[Tan[x]-1/x,{x,3.5}]

Out[9]= {x->3.42562}

etc,etc,etc
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 40 ·
2
Replies
40
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 19 ·
Replies
19
Views
5K