# Symbolic solution trigonometric equation

7 ビュー (過去 30 日間)
Selcuk Sakar 2020 年 1 月 21 日
コメント済み: John D'Errico 2020 年 1 月 21 日
Hi, I need to solve the equation below
a * sin(bx) + sin(cx) = 0
is there any solution in matlab ?

#### 1 件のコメント

Star Strider 2020 年 1 月 21 日
There are infinitely many of them!

サインイン to comment.

### 回答 (1 件)

John D'Errico 2020 年 1 月 21 日

Why not try it?
syms a b c x
>> xsol = solve(a*sin(b*x) + sin(c*x) == 0,x)
Warning: Unable to find explicit solution. For options, see help.
> In solve (line 317)
xsol =
Empty sym: 0-by-1
So no explicit solution, something that leaves me completely un-amazed. We know there is a trivial solution at x==0. And we should expect there are infinitely many solutions. But for completely general a, b, and c, I fully expect there to be no analytical solutions. It is trivially easy to write problems that have no analytical solutions.
However, if you pick some specific values of a, b and c, then you can find some of the infintiely many solutions. There will still probably be no analytical solution for most values of a, b, and c however.
xsol = vpasolve(subs(a*sin(b*x) + sin(c*x) == 0,[a b c],[5 2 3]),x)
xsol =
0
xsol = vpasolve(subs(a*sin(b*x) + sin(c*x) == 0,[a b c],[5 2 3]),x,2)
xsol =
1.4743556987697957311362366207334
xsol = vpasolve(subs(a*sin(b*x) + sin(c*x) == 0,[a b c],[5 2 3]),x,3)
xsol =
3.1415926535897932384626433832795
Change the start point for the search, and vpasolve will (sometimes) find a different solution.
Of course, I could have done the same using fzero. But in no case could I solve the problem for a fully general set of unknown parameters a, b, c. You can always hope for magic to happen, but usually all you get is your computer stifling a computational chuckle, as you give it some impossible problem to solve.
If b anc c are reasonably chosen small integers, then you can sometimes get lucky...
xsol = solve(subs(a*sin(b*x) + sin(c*x) == 0,[b c],[2 3]),x)
xsol =
0
-acos(- a/4 - (a^2 + 4)^(1/2)/4)
-acos((a^2 + 4)^(1/2)/4 - a/4)
acos(- a/4 - (a^2 + 4)^(1/2)/4)
acos((a^2 + 4)^(1/2)/4 - a/4)
So here we see a set of solutions for fixed, known values of b and c, but unknown parametric a. Expect that to get fairly nasty looking even if a solution exists for larger integer values of b and c. If b and c are fully general floating point values, then you should probably give up hope.
xsol = solve(subs(a*sin(b*x) + sin(c*x) == 0,[b c],rand(1,2)),x)
Warning: Unable to find explicit solution. For options, see help.
> In solve (line 317)
xsol =
Empty sym: 0-by-1

#### 2 件のコメント

John D'Errico 2020 年 1 月 21 日
By the way, please don't use an answer just to make a comment.
Answer by @Selcuk Sakar moved to a comment:
"Hmmm, i see.. it is not straight forward. Thanks for your valuable constribution."
John D'Errico 2020 年 1 月 21 日
Here is another way to view it. Suppose you knew that b==1, and c==2? How would you go about solving it on paper?
If b and c are small integers, then you can substitute:
u = sin(x)
But what is sin(2*x), in terms of sin(x)? That is, can you now re-write sin(2*x) in terms of u? Yes.
sin(2*x) = 2*sin(x)*cos(x)
therefore we could rewrite the original problem in terms of u, as
a*u + 2*u*sqrt(1-u^2) == 0
by some judicious algebra, we could now solve for all roots of what is now essentially a polynomial equation for u, even though a is unknown. Once you knopw the possible values for u, now you could recover x.
So all would be good in the world if b and c are known and small integers, because you can always do a similar substitution. But even for moderately larger integer values of u, the result will be equivalent to a polynomial equation of degree at least 5. at that point, Abel-Ruffini takes over, preventing us from solving the polynomial equation for u, in any algebraic form. At best, you could use a tool like fzero or vpasolve, as I did.
Worse, when b and/or c are general floating point numbers, all gets far worse. Now you can no longer even easily convert this to a polynomial equation, even if a very high order one.
So, what happens when b and c are completely unknown? All must fail now. No solution will ever be possible. At best you can find numerical solutions for fixed values of the parameters.

サインイン to comment.

サインイン してこの質問に回答します。

Translated by