- #1

lxd

- 7

- 0

## Homework Statement

I need to solve an equation of:

## Homework Equations

sin(ax)+bx=0, where x is variable, b, and a are given parameters.

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter lxd
- Start date

- #1

lxd

- 7

- 0

I need to solve an equation of:

sin(ax)+bx=0, where x is variable, b, and a are given parameters.

- #2

rock.freak667

Homework Helper

- 6,223

- 31

- #3

dynamicsolo

Homework Helper

- 1,648

- 4

I need to solve an equation of:

sin(ax)+bx=0, where x is variable, b, and a are given parameters.

I'm afraid this has neither an analytic solution, nor a simple one. The equation

sin(ax) = -bx

is an example of a transcendental equation, which means that it cannot be solving by standard algebraic methods.

You can picture what this situation is like by considering the graphs of the left- and right-hand sides separately. The function sin(ax) will be periodic with a period of 2(pi)/a , while -bx is a straight line. Depending on what the relative values of a and b are, there may be no intersection points or any finite number of them, the x-coordinates of the intersections being the solutions to the equation.

The solutions for specific values of a and b would be found by numerical techniques. (If you've had differential calculus, you can quickly figure out the condition for the case where there are

Last edited:

- #4

lxd

- 7

- 0

thank you very much!

- #5

lxd

- 7

- 0

The solutions for specific values of a and b would be found by numerical techniques. (If you've had differential calculus, you can quickly figure out the condition for the case where there arenosolutions. With more effort, you can work out how many solutions there would be for various ratios of a/b.)

What numerical techniques can be used to get the solution or solutions of the equation ? Could you please give me a example ? Thanks a lot!

- #6

unplebeian

- 154

- 0

Have you also tried to use the power series expansion of sin x? With some aproximations like taking only the first n terms, this can be solvable and then the NR method would work easily. Unless you want a closed form solution. In which case forget the Taylor expansion.

- #7

lxd

- 7

- 0

Thanks! Can I get the solution by using the difference of the equation as acos(ax)=-b when |a|>|b|?

Last edited:

- #8

HallsofIvy

Science Advisor

Homework Helper

- 43,021

- 970

- #9

dynamicsolo

Homework Helper

- 1,648

- 4

Newton Raphson first comes to mind. Powerful and quick.

It is, but only under the right circumstances. You need to have an idea of where the zero(es) of your function are and it's rather important to the method that your initial guess for a solution

A serious problem would develop with our function [sin(ax) + bx] for cases where there are numerous solutions (when |b| is small). Unless your first guess happens to be close enough to one of the zeroes, the next iteration could easily land in the neighborhood of another zero, complicating the convergence to a solution and the search for the complete set of solutions. Worse yet, the iteration could end up at a value where the derivative is nearly zero, which can destroy the ability of the method to converge at all.

There is some amount of literature at this point on the subject of how chaos can erupt in the Newton-Raphson method. It's a nice technique for uncomplicated functions, but the one in question here is not always one of those...

For the purpose of solving the equation under discussion here, it may really be safer in many situations to just look for zeroes of [sin(ax) + bx] graphically.

What do you mean by "the difference of the equation"?

I believe lxd meant "the

Last edited:

- #10

lxd

- 7

- 0

You are right, it can not help us find the solution.Won't that just tell you where the horizontal tangents to the curve are?

- #11

dynamicsolo

Homework Helper

- 1,648

- 4

You are right, it can not help us find the solution.

Well, in walking around some today and thinking about this a bit, I realized you could apply it together with the Newton-Raphson method to pin down solutions. Another problem with N-R is that it is not a

The one limitation with this approach is that the derivative equation, cos(ax) = (-b/a), has an infinite number of solutions for |b|</=|a|, while the function itself has only a finite number of zeroes. So you still have to know when to stop.* One nice feature of the function is that it has odd symmetry, so you only need to calculate the positive zeroes: the negative zeroes just have opposite sign... [Of course, as has been emphasized by multiple posters here now, all of this has to be done numerically.]

*EDIT: D'oh! This is no biggie -- the last solution will be in the vicinity of |b|·x = 1 .

Last edited:

- #12

unplebeian

- 154

- 0

Well, in walking around some today and thinking about this a bit, I realized you could apply it together with the Newton-Raphson method to pin down solutions. Another problem with N-R is that it is not asearchmethod for solutions: you have to have some idea already of where you're looking to use it efficiently. Something youcoulddo is use the derivative equation, starting from x = 0, to find the "turning points" in the function [sin(ax) + bx]. Take averages between the x-coordinates of successive turning points and that will give yougoodestimates for where to start your N-R calculations from. [I won't, at present, guarantee that this is an "iron-clad" approach, though...]

.

Exactly what I wanted to say earlier

- #13

unplebeian

- 154

- 0

I think the roots are at x=0 and that's it! If b=0 then we already know where the roots are: at n x pi (n= 0, 1, 2, 3....) Otherwise for whatever a and b, the roots are at x= 0

Am I right or just missing a BIG piece of the puzzle

- #14

HallsofIvy

Science Advisor

Homework Helper

- 43,021

- 970

- #15

unplebeian

- 154

- 0

I knew I was missing something!

- #16

dynamicsolo

Homework Helper

- 1,648

- 4

Have any of you tried to plot sin(ax) +bx ? It's a sine wave superimposed on y= bx.

Actually, I often plot functions discussed in problems, particularly less familiar ones. In this case, it was thinking about the graph that led me to consider the idea of combining the information from the derivative function with the Newton-Raphson method to avoid the difficulty of accidentally ending up in "bad" N-R locations. (It also made me realize that it's pretty straightforward to figure out how far away from the origin the last zeroes of our function will be...)

I think the roots are at x=0 and that's it! If b=0 then we already know where the roots are: at n x pi (n= 0, 1, 2, 3....) Otherwise for whatever a and b, the roots are at x= 0

I imagine you were thinking of larger values of b. When I was fretting about finding all the solutions and avoiding the pitfalls of N-R, I was looking at a plot of sin(10x) + 0.1x . (The trickiest part seems to be catching the zeroes where the climbing curve is

Last edited:

- #17

lxd

- 7

- 0

I do have some figures, but I don't know how to post them at here.

- #18

lxd

- 7

- 0

*EDIT: D'oh! This is no biggie -- the last solution will be in the vicinity of |b|·x = 1 .

I do not agree that. For example, when b is very small (or b=0), one of the solution is in the vicinity of pi/a (or at pi/a).

- #19

dynamicsolo

Homework Helper

- 1,648

- 4

I do not agree that. For example, when b is very small (or b=0), one of the solution is in the vicinity of pi/a (or at pi/a).

I don't deny there is

Last edited:

- #20

Sleek

- 60

- 0

Unfortunately, I have not yet studied N-R and other stuff (not yet in my syllabus). This problem is quite an interesting one. I plotted some graphs and even the one dynamicsolo suggested, which really shows the big picture.

Ok, from what I see, the sine function now seems to be tilted with an angle equal to line's slope. Lets say if we plot,

y=sin(5x)+0.1x

y=0.1x-1

y=0.1x+1

We'll have the rotated sine function enclosed between both the lines which look similar to a tube.

We know the angle of rotation, so can we define a rotated co-ordinate system where sine function intersects it normally as we see. Can we use these informations to find corresponding intersection in the first co-ordinate system? Also, we'll have to do it only in the domain where the lines intersect +ve and -ve x axis.

Whatever I said is just an idea, I haven't worked up a solution. So it can be technically wrong or impossible that way. I'll try to look into it when I get back home.

Regards,

Sleek.

Ok, from what I see, the sine function now seems to be tilted with an angle equal to line's slope. Lets say if we plot,

y=sin(5x)+0.1x

y=0.1x-1

y=0.1x+1

We'll have the rotated sine function enclosed between both the lines which look similar to a tube.

We know the angle of rotation, so can we define a rotated co-ordinate system where sine function intersects it normally as we see. Can we use these informations to find corresponding intersection in the first co-ordinate system? Also, we'll have to do it only in the domain where the lines intersect +ve and -ve x axis.

Whatever I said is just an idea, I haven't worked up a solution. So it can be technically wrong or impossible that way. I'll try to look into it when I get back home.

Regards,

Sleek.

Last edited:

- #21

dynamicsolo

Homework Helper

- 1,648

- 4

Ok, from what I see, the sine function now seems to be tilted with an angle equal to line's slope...

You want to be a little careful here. The sine curve is not simply rotated, but, because it is "tracking" a rising or falling line, is also distorted asymmetrically. For small values of |b|, the distortion will be rather small and the rotation "model" probably will give fairly good estimates for the zeroes. When |b| is not small relative to |a|

(|b| > 0.01|a| ?), the "waves" of the sine function are sufficiently "warped" that the function can no longer be viewed as just a re-oriented sine function. (Look at sin(10x) + x , for instance.)

- #22

olgranpappy

Homework Helper

- 1,271

- 3

What do you mean by "the difference of the equation"? As said before, there is no "analytic" solution for a cos(ax)+ b= 0 and...

?

x = Arccos(-b/a)/a

- #23

dynamicsolo

Homework Helper

- 1,648

- 4

?

x = Arccos(-b/a)/a

(I see a semantical argument coming...) I think Halls means that there is no simple algebraic way of expressing this solution. What you have is considered a transcendental equation (and I believe HoI knows how to come up with it). Writing the inverse trig expression (we are not merely using the function Arccos(x) here) does not make the infinite number of solutions easier to find. There isn't a straightforward expression for arccos ; you will still need to find the extrema of the function under discussion numerically...

Last edited:

- #24

olgranpappy

Homework Helper

- 1,271

- 3

- #25

dynamicsolo

Homework Helper

- 1,648

- 4

What Halls was writing there was the derivative of the original equation, since lxd had brought it up, originally as something to use in solving that equation.

- #26

olgranpappy

Homework Helper

- 1,271

- 3

okey dokey

- #27

HallsofIvy

Science Advisor

Homework Helper

- 43,021

- 970

Actually there is no "symantical argument", just a typographical error. The equation I was referring to is the original equation, cos(ax)+ bx= 0, not cos(ax)+ b= 0. Olgranpappy got me!?

x = Arccos(-b/a)/a

- #28

unplebeian

- 154

- 0

y= sin(ax) +bx. Increase x in small amounts (1e-6) and find y. If y<= epsilon where epsilon is the matlab operator 1e-15 (you can set this depending on your accuracy) you know that you have found a root of the equation.

It is a brute force method and can get accurate results, but more time consuming than NR. However the time taken to code the NR may be equal to the time required to solve it the above mentioned way.

BTW thanks to Halls_of_Ivy. Good to be shaken once in a while for not thinking straight.

- #29

HallsofIvy

Science Advisor

Homework Helper

- 43,021

- 970

Share:

- Last Post

- Replies
- 7

- Views
- 611

- Last Post

- Replies
- 11

- Views
- 1K

- Last Post

- Replies
- 3

- Views
- 1K

- Last Post

- Replies
- 1

- Views
- 102

- Last Post

- Replies
- 32

- Views
- 550

- Last Post

- Replies
- 22

- Views
- 971

- Last Post

- Replies
- 1

- Views
- 378

- Replies
- 43

- Views
- 1K

- Replies
- 1

- Views
- 170

- Replies
- 1

- Views
- 178