# How to solve this equation

lxd

## 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.

## Answers and Replies

Homework Helper
I do not think you will be able to solve it as x cannot be isolated.You might have to do successive iterations

Homework Helper
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 no solutions. With more effort, you can work out how many solutions there would be for various ratios of a/b.)

Last edited:
lxd
!

thank you very much!

lxd
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 no solutions. 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!

unplebeian
Newton Raphson first comes to mind. Powerful and quick.

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.

lxd
difference

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

Last edited:
Homework Helper
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, obviously, the same holds for acos(ax)= b.

Homework Helper
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 not be at a place where the derivative of the function is close to zero.

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 derivative". In any case, lxd, it's really unclear how the derivative, a·cos(ax) = -b , is going to help you find solutions to the original equation. Won't that just tell you where the horizontal tangents to the curve are?

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

Homework Helper
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 search method for solutions: you have to have some idea already of where you're looking to use it efficiently. Something you could do 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 you good estimates for where to start your N-R calculations from. [I won't, at present, guarantee that this is an "iron-clad" approach, though...]

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:
unplebeian
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 search method for solutions: you have to have some idea already of where you're looking to use it efficiently. Something you could do 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 you good estimates 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

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

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

Homework Helper
Did YOU actually plot y= sin(ax) and y= -bx? Yes, if b= 0 then there exist an infinite number of solutions. If |b| is small, then there exist many more solutions than just x= 0. For b positive, y= -bx will not be below y= -1 until x> 1/b. Similarly, as soon as x> -1/b, y will be less than 1. How many times the line y= -bx crosses the curve y= sin(ax) depends upon how large a is.

unplebeian
Did YOU actually plot y= sin(ax) and y= -bx? Yes, if b= 0 then there exist an infinite number of solutions. If |b| is small, then there exist many more solutions than just x= 0. For b positive, y= -bx will not be below y= -1 until x> 1/b. Similarly, as soon as x> -1/b, y will be less than 1. How many times the line y= -bx crosses the curve y= sin(ax) depends upon how large a is.

I knew I was missing something!

Homework Helper
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 just about to clear the x-axis...

Last edited:
lxd
It is more clear now. Firstly, there always has one solution x=0. Secondly, when |a|>|b|, there are more than one solutions than just x=0. I tried the N-R method. The problem is how to find the good initial value of x, because it stops at x=0 frequently. As mentioned by "Unplebeian", the N-R method is not a search method for solutions. Especially, when there are many solutions, N-R method can not find all of the solutions directly.

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

lxd
*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).

Homework Helper
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 a solution there. There are many more solutions beyond that when |b| is small, the last one which occurs out where I described, where the rising or falling sine curve is finally above or below the x-axis. (For the function I mentioned in my previous post, sin(10x) + 0.1x, there are zeroes out to +/- 9.8805... and +/-9.9095...)

Last edited:
Sleek
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.

Last edited:
Homework Helper
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.)

Homework Helper
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

Homework Helper
?

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:
Homework Helper
Actually, I think he just forgot to put an 'x' next to the 'b' in his equation. And I was just pointing that out in an amusing (to me) way.

Homework Helper
Actually, I think he just forgot to put an 'x' next to the 'b' in his equation. And I was just pointing that out in an amusing (to me) way.

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.

Homework Helper
okey dokey

Homework Helper
?

x = Arccos(-b/a)/a
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!

unplebeian
Since we now know how the function looks like, (Halls_of_Ivy blatantly pointed it out!)we may employ a brute force method.

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.