# Thread: solving the equation tan(x)=1/x

1. ## solving the equation tan(x)=1/x

Hi, again!
a few months ago I post that question , but I need to solve it (numerically, of course, I don't know about analytic way...) by using Maple Or Matlab.

My question:
tan(dx)=h/(k*x)
when d, h and k are constants!

I need to find all the solutions (as close as possible).

Thanks (:
RedFox.

2. Hello, Red!

A few months ago I posted: $\displaystyle \tan x \,=\,\frac{1}{x}$
but I need to solve it (numerically, of course) by using Maple or Matlab.

My question: .$\displaystyle \tan(dx)\:=\:\frac{h}{kx}$ with constants $\displaystyle d,\;h,\;k.$

I need to find all the solutions (as close as possible).

Since $\displaystyle \frac{h}{k}$ is a constant, your equation is: .$\displaystyle \tan(ax) \:=\:\frac{b}{x}$

I would graph: .$\displaystyle y \:=\:\tan(ax)$ and $\displaystyle y \:=\:\frac{b}{x}$
. . and locate their intersections.

3. Originally Posted by Red_Fox
Hi, again!
a few months ago I post that question , but I need to solve it (numerically, of course, I don't know about analytic way...) by using Maple Or Matlab.

My question:
tan(dx)=h/(k*x)
when d, h and k are constants!

I need to find all the solutions (as close as possible).

Thanks (:
RedFox.
Here is a method that would give some of the solutions.
Rewrite Soroban's equation as,
$\displaystyle x\sin (ax)=b\cos (ax)$
Approximate,
$\displaystyle ax^2-\frac{a^3x^4}{3!}+\frac{a^5x^6}{5!}=b-\frac{a^2bx^2}{2!}+\frac{a^4bx^4}{4!}$
This is a polynomial equation.
There should be a polynomial solving program in the software you are using.

4. Originally Posted by Red_Fox
Hi, again!
a few months ago I post that question , but I need to solve it (numerically, of course, I don't know about analytic way...) by using Maple Or Matlab.

My question:
tan(dx)=h/(k*x)
when d, h and k are constants!

I need to find all the solutions (as close as possible).

Thanks (:
RedFox.
Absorb the constants to give:

$\displaystyle \tan(\delta .x)=m/x$,

where $\displaystyle m=h/k$, also put $\displaystyle y=\delta .x$, then we are interested in the solutions of:

$\displaystyle \tan(y)=n/y$,

where now $\displaystyle n=\delta .h/k$.

Now when $\displaystyle n \ne 0$ this obviously (if I have done this right) has a solution
in each of the intervals $\displaystyle (0, \pi/2)$, $\displaystyle (-\pi/2, 0)$, $\displaystyle (((k+1)\pi, (2k+3)\pi /2)$,
$\displaystyle (-(2k+3)\pi/2, -(k+1)\pi)\ k=0,\ 1,\ ..$.

Also for large $\displaystyle k$ the roots approach $\displaystyle (k+1) \pi$
(with the mirror image roots when $\displaystyle k$ is negative).

Now numerical methods can be used to find the root in any particular
interval (since we know the interval that a root lies in I would use binary
search for this, though Newton-Raphson is probably faster)

RonL

5. ## well...

first of all, thank you guys very much!
few things:

1. [ThePerfectHacker] Do you the this approximation can give me solutions that are close enough to the orginal problem? (I will sure try, however).

2. [CaptainBlack] Why I have to check this intervals? and do you think I can do it by myself? (I mean, with newton-raphson method, without matlab/maple)?

Thanks again!

6. Originally Posted by Red_Fox
2. [CaptainBlack] Why I have to check this intervals? and do you think I can do it by myself? (I mean, with newton-raphson method, without matlab/maple)?
Matlab/maple will use NR or something similar. I would not expect you to
find the solutions by hand unless it was set as homework. If you have
matlab/maple then use it/them, you could also use the solver in Excel,
or whatever tool is easiest.

RonL

7. Originally Posted by Red_Fox

1. [ThePerfectHacker] Do you the this approximation can give me solutions that are close enough to the orginal problem? (I will sure try, however).
Based on experience I would say to 2 decimal places.
If you are familiar with Taylor polynomials you can increase their sizes for sine and cosine.

8. Originally Posted by CaptainBlack
Absorb the constants to give:

$\displaystyle \tan(\delta .x)=m/x$,

where $\displaystyle m=h/k$, also put $\displaystyle y=\delta .x$, then we are interested in the solutions of:

$\displaystyle \tan(y)=n/y$,

where now $\displaystyle n=\delta .h/k$.

Now when $\displaystyle n \ne 0$ this obviously (if I have done this right) has a solution
in each of the intervals $\displaystyle (0, \pi/2)$, $\displaystyle (-\pi/2, 0)$, $\displaystyle (((k+1)\pi, (2k+3)\pi /2)$,
$\displaystyle (-(2k+3)\pi/2, -(k+1)\pi)\ k=0,\ 1,\ ..$.

Also for large $\displaystyle k$ the roots approach $\displaystyle (k+1) \pi$
(with the mirror image roots when $\displaystyle k$ is negative).

Now numerical methods can be used to find the root in any particular
interval (since we know the interval that a root lies in I would use binary
search for this, though Newton-Raphson is probably faster)

RonL
We may refine our estimate of the root near $\displaystyle k \pi,\ k \in \mathbb{N}$ for large $\displaystyle k$ (I will assume $\displaystyle k$ is poitive,
the negative roots are all reflections of the poitive roots about $\displaystyle 0$), as near $\displaystyle k \pi;\ \tan(x)\approx x-k\pi$.

So for large $\displaystyle k$ the root near $\displaystyle k \pi$ of:

$\displaystyle \tan(x)=\frac{n}{x}$,

is close to the root of:

$\displaystyle x-k \pi=\frac{n}{x}$,

which on rearrangement is:

$\displaystyle x^2-k \pi x-n=0$,

which has roots:

$\displaystyle x=\frac{k \pi \pm \sqrt{k^2\pi^2+4n}}{2}$

of these roots we need the positive one so:

$\displaystyle x=\frac{k \pi + \sqrt{k^2\pi^2+4n}}{2}$.

or:

$\displaystyle x=\frac{k \pi}{2} (1 + \sqrt{1+4n/(k^2 \pi^2)})$.

Now expanding the square root as a power series and truncating after the
first term gives:

$\displaystyle x \approx k \pi + \frac{n}{k \pi}$

Now for some examples:

$\displaystyle \begin{array}{ccccc} k&n&k \pi & k \pi+n/(k \pi)&root\\ 5&20&15.71&16.98&16.59\\ 5&2&15.71&15.84&15.83\\ 10&2&31.42&31.48&31.48 \end{array}$

RonL

9. Red_Fox, I have an algorithm you will most appreciate. Have you ever heard of the Newton-Raphson method?
If you did, the obvios problem is to get make it produce a solution of some interval. Whenever, you use the newton-raphson method it not always gives you the solutions you are looking for, in order to avoid this look at this post. CaptainBlank did the important work by isolating all the intervals where exactly one solution exists. This is true because, $\displaystyle f(x)=\tan (x)$ and $\displaystyle g(x)=1/x$ intersect at the points shown below. Note the positive solutions exist uniquely in each period of the tangent curve, which justifies CaptainBlank result.

10. Originally Posted by ThePerfectHacker
Red_Fox, I have an algorithm you will most appreciate. Have you ever heard of the Newton-Raphson method?
I should hope so, its been mentioned at least twice already in this thread!

RonL

11. ## Well...

I have nothing left to say!
Yeah, I suppose NR is good enough. I know this method, but I was not sure about using it.
Thank u so much guys! You helped me a lot (:

,
,

,

,

,

,

,

,

,

,

,

,

,

# solution of xtanx =1

Click on a term to search for related topics.