Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.maple > #1105 > unrolled thread
| Started by | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| First post | 2015-03-08 20:25 +0100 |
| Last post | 2015-03-10 01:12 +0100 |
| Articles | 10 — 2 participants |
Back to article view | Back to comp.soft-sys.math.maple
How to simplify certain solutions of trigonometric equation? Rainer Rosenthal <r.rosenthal@web.de> - 2015-03-08 20:25 +0100
Re: How to simplify certain solutions of trigonometric equation? acer <maple@rogers.com> - 2015-03-08 18:48 -0700
Re: How to simplify certain solutions of trigonometric equation? Rainer Rosenthal <r.rosenthal@web.de> - 2015-03-09 11:05 +0100
Re: How to simplify certain solutions of trigonometric equation? acer <maple@rogers.com> - 2015-03-09 06:09 -0700
Re: How to simplify certain solutions of trigonometric equation? Rainer Rosenthal <r.rosenthal@web.de> - 2015-03-09 14:40 +0100
Re: How to simplify certain solutions of trigonometric equation? acer <maple@rogers.com> - 2015-03-09 07:36 -0700
Re: How to simplify certain solutions of trigonometric equation? acer <maple@rogers.com> - 2015-03-09 07:48 -0700
Re: How to simplify certain solutions of trigonometric equation? Rainer Rosenthal <r.rosenthal@web.de> - 2015-03-09 17:56 +0100
Re: How to simplify certain solutions of trigonometric equation? acer <maple@rogers.com> - 2015-03-09 10:15 -0700
Re: How to simplify certain solutions of trigonometric equation? Rainer Rosenthal <r.rosenthal@web.de> - 2015-03-10 01:12 +0100
| From | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| Date | 2015-03-08 20:25 +0100 |
| Subject | How to simplify certain solutions of trigonometric equation? |
| Message-ID | <cm3lseFejjsU1@mid.individual.net> |
I was searching for solutions of the following equation:
sin(x) + sin(2x) + sin(3x) = cos(x) + cos(2x) + cos(3x)
So I defined funtion f:
f := x -> sin(x) + sin(2*x) + sin(3*x) - (cos(x) + cos(2*x) + cos(3*x));
and solved as follows:
p := [solve(f(x)=0,x)];
I got six different solutions:
p[1] = 2/3*Pi
p[2] = -2/3*Pi
p[3] = arctan(2*(1/2*(2+sqrt(2))^(3/2)-3/2*sqrt(2+sqrt(2)))/(sqrt(2+sqrt(2))))
p[4] = -arctan(2*(-1/2*(2+sqrt(2))^(3/2)+3/2*sqrt(2+sqrt(2)))/(sqrt(2+sqrt(2))))-Pi
p[5] = arctan(2*(1/2*(2-sqrt(2))^(3/2)-3/2*sqrt(2-sqrt(2)))/(sqrt(2-sqrt(2))))
p[6] = -arctan(2*(-1/2*(2-sqrt(2))^(3/2)+3/2*sqrt(2-sqrt(2)))/(sqrt(2-sqrt(2))))+Pi]
I hoped for a simple zero for each f(p[i]), but most of the time I got
difficult expressions, which were only simplified by "simplify":
I usd these Maple-lines:
for i to nops(p) do print(Check_Solution_Number_,i);
simplify(f(p[i]));
od;
and received the following output:
Check_Solution_Number_, 1
0
Check_Solution_Number_, 2
0
Check_Solution_Number_, 3
(-2 + sqrt(2) + sin(3/8 Pi) sqrt(4 - 2 sqrt(2))
- cos(3/8 Pi) sqrt(4 - 2 sqrt(2)))/sqrt(4 - 2 sqrt(2))
Check_Solution_Number_, 4
(2 - sqrt(2) - sin(2 %2) %1 + sin(3 %2) %1 - cos(2 %2) %1
+ cos(3 %2) %1)/sqrt(4 - 2 sqrt(2))
%1 := sqrt(4 - 2 sqrt(2))
%2 := arctan(-sqrt(2) + 1)
Check_Solution_Number_, 5
- (2 + sqrt(2) - sin(2 %2) %1 - sin(3 %2) %1 + cos(2 %2) %1
+ cos(3 %2) %1)/sqrt(4 + 2 sqrt(2))
%1 := sqrt(4 + 2 sqrt(2))
%2 := arctan(-1 - sqrt(2))
Check_Solution_Number_, 6
(2 + sqrt(2) - sin(1/8 Pi) sqrt(4 + 2 sqrt(2))
- cos(1/8 Pi) sqrt(4 + 2 sqrt(2)))/sqrt(4 + 2 sqrt(2))
Which options of "simplify" could do better?
(I still use Maple V).
Cheers,
Rainer
[toc] | [next] | [standalone]
| From | acer <maple@rogers.com> |
|---|---|
| Date | 2015-03-08 18:48 -0700 |
| Message-ID | <fe5f8fd2-5868-4bee-beb3-92335fd0b585@googlegroups.com> |
| In reply to | #1105 |
Le dimanche 8 mars 2015 15:22:56 UTC-4, Rainer Rosenthal a écrit : > I was searching for solutions of the following equation: > > sin(x) + sin(2x) + sin(3x) = cos(x) + cos(2x) + cos(3x) > > So I defined funtion f: > f := x -> sin(x) + sin(2*x) + sin(3*x) - (cos(x) + cos(2*x) + cos(3*x)); > > and solved as follows: > p := [solve(f(x)=0,x)]; > > I got six different solutions: > > p[1] = 2/3*Pi > p[2] = -2/3*Pi > p[3] = arctan(2*(1/2*(2+sqrt(2))^(3/2)-3/2*sqrt(2+sqrt(2)))/(sqrt(2+sqrt(2)))) > p[4] = -arctan(2*(-1/2*(2+sqrt(2))^(3/2)+3/2*sqrt(2+sqrt(2)))/(sqrt(2+sqrt(2))))-Pi > p[5] = arctan(2*(1/2*(2-sqrt(2))^(3/2)-3/2*sqrt(2-sqrt(2)))/(sqrt(2-sqrt(2)))) > p[6] = -arctan(2*(-1/2*(2-sqrt(2))^(3/2)+3/2*sqrt(2-sqrt(2)))/(sqrt(2-sqrt(2))))+Pi] > > I hoped for a simple zero for each f(p[i]), but most of the time I got > difficult expressions, which were only simplified by "simplify": > > I usd these Maple-lines: > for i to nops(p) do print(Check_Solution_Number_,i); > simplify(f(p[i])); > od; > > and received the following output: > > > Check_Solution_Number_, 1 > > > 0 > > > Check_Solution_Number_, 2 > > > 0 > > > Check_Solution_Number_, 3 > > > (-2 + sqrt(2) + sin(3/8 Pi) sqrt(4 - 2 sqrt(2)) > > - cos(3/8 Pi) sqrt(4 - 2 sqrt(2)))/sqrt(4 - 2 sqrt(2)) > > > Check_Solution_Number_, 4 > > > (2 - sqrt(2) - sin(2 %2) %1 + sin(3 %2) %1 - cos(2 %2) %1 > > + cos(3 %2) %1)/sqrt(4 - 2 sqrt(2)) > > %1 := sqrt(4 - 2 sqrt(2)) > > %2 := arctan(-sqrt(2) + 1) > > > Check_Solution_Number_, 5 > > > - (2 + sqrt(2) - sin(2 %2) %1 - sin(3 %2) %1 + cos(2 %2) %1 > > + cos(3 %2) %1)/sqrt(4 + 2 sqrt(2)) > > %1 := sqrt(4 + 2 sqrt(2)) > > %2 := arctan(-1 - sqrt(2)) > > > Check_Solution_Number_, 6 > > > (2 + sqrt(2) - sin(1/8 Pi) sqrt(4 + 2 sqrt(2)) > > - cos(1/8 Pi) sqrt(4 + 2 sqrt(2)))/sqrt(4 + 2 sqrt(2)) > > > Which options of "simplify" could do better? > (I still use Maple V). > > Cheers, > Rainer Try something like this, seq( radnormal(convert(radnormal(f(t)),radical)), t=p ); or seq( simplify(convert(simplify(f(t)),radical)), t=p ); because it looks like your MapleV is missing the step of turning certain trig constants into their radical equivalents.
[toc] | [prev] | [next] | [standalone]
| From | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| Date | 2015-03-09 11:05 +0100 |
| Message-ID | <cm59dtFqqh2U1@mid.individual.net> |
| In reply to | #1106 |
Am 09.03.2015 um 02:48 schrieb acer: > > Try something like this, > > seq( radnormal(convert(radnormal(f(t)),radical)), t=p ); > > or > > seq( simplify(convert(simplify(f(t)),radical)), t=p ); > > because it looks like your MapleV is missing the step of turning certain trig constants into their radical equivalents. > Thank you. There was partial success as the expressions became slightly simpler. Let me tell you what I got for solution #3, i.e. for the expression S3 := (-2+sqrt(2)+sin(3/8*Pi)*sqrt(4-2*sqrt(2))-cos(3/8*Pi)*sqrt(4-2*sqrt(2)))/(sqrt(4-2*sqrt(2))); With "radnormal(convert(radnormal(f(t)),radical))" this becomes S31 := -1/2*sqrt(4-2*sqrt(2))-cos(3/8*Pi)+sin(3/8*Pi); # quite nice, but still not 0 With "simplify(convert(simplify(f(t)),radical))" this becomes S32 := 1/4*(-2+sqrt(2+sqrt(2))*sqrt(2)*sqrt(2-sqrt(2)))*sqrt(2)/(sqrt(2-sqrt(2))); # not 0, but no trig The last one is without trig (nice) and can be seen to be 0 as follows: S32 is equal to S32a := 1/4*(-2+T)*sqrt(2)/(sqrt(2-sqrt(2))); where T := sqrt(2+sqrt(2))*sqrt(2)*sqrt(2-sqrt(2)); My Maple V refused to show me that this is 0. I had to square it for that purpose: expand(T^2) gived 4, so T must be 2 as T > 0. From that we can see S32a = 0, since factor (-2+T) = 0. Well, so far this helped quite well, but I would be glad to see a handsome formula F such that F(S3) = 0 will be stated by Maple (V). Cheers, Rainer
[toc] | [prev] | [next] | [standalone]
| From | acer <maple@rogers.com> |
|---|---|
| Date | 2015-03-09 06:09 -0700 |
| Message-ID | <110212e8-6429-46db-83a5-703955762a40@googlegroups.com> |
| In reply to | #1107 |
On Monday, March 9, 2015 at 6:02:39 AM UTC-4, Rainer Rosenthal wrote: > Am 09.03.2015 um 02:48 schrieb acer: > > > > Try something like this, > > > > seq( radnormal(convert(radnormal(f(t)),radical)), t=p ); > > > > or > > > > seq( simplify(convert(simplify(f(t)),radical)), t=p ); > > > > because it looks like your MapleV is missing the step of turning certain trig constants into their radical equivalents. > > > > Thank you. There was partial success as the expressions became > slightly simpler. > > Let me tell you what I got for solution #3, i.e. for the expression > > S3 := (-2+sqrt(2)+sin(3/8*Pi)*sqrt(4-2*sqrt(2))-cos(3/8*Pi)*sqrt(4-2*sqrt(2)))/(sqrt(4-2*sqrt(2))); > > With "radnormal(convert(radnormal(f(t)),radical))" this becomes > S31 := -1/2*sqrt(4-2*sqrt(2))-cos(3/8*Pi)+sin(3/8*Pi); # quite nice, but still not 0 > > With "simplify(convert(simplify(f(t)),radical))" this becomes > S32 := 1/4*(-2+sqrt(2+sqrt(2))*sqrt(2)*sqrt(2-sqrt(2)))*sqrt(2)/(sqrt(2-sqrt(2))); # not 0, but no trig > > The last one is without trig (nice) and can be seen to be 0 as follows: > > S32 is equal to > S32a := 1/4*(-2+T)*sqrt(2)/(sqrt(2-sqrt(2))); > where > T := sqrt(2+sqrt(2))*sqrt(2)*sqrt(2-sqrt(2)); > > My Maple V refused to show me that this is 0. I had to square it for that purpose: > expand(T^2) gived 4, so T must be 2 as T > 0. > From that we can see S32a = 0, since factor (-2+T) = 0. > > Well, so far this helped quite well, but I would be glad to see a handsome > formula F such that F(S3) = 0 will be stated by Maple (V). > > Cheers, > Rainer It could be that in MapleV evala/Normal might get it when radnormal or simplify(...,radical) fail. That is, something like, map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p);
[toc] | [prev] | [next] | [standalone]
| From | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| Date | 2015-03-09 14:40 +0100 |
| Message-ID | <cm5m0pFu4h2U1@mid.individual.net> |
| In reply to | #1108 |
Am 09.03.2015 um 14:09 schrieb acer: > It could be that in MapleV evala/Normal might get it when radnormal or simplify(...,radical) fail. > That is, something like, > > map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); > Wow, solutions #3 and #6 are verified by a clear "0" now, nice! map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); gives the following list: [0, # Check solution #1 0, # Check solution #2 0, # Check solution #3 not so easy, # Check solution #4 not so easy, # Check solution #5 0] # Check solution #6 Many thanks! I'd love to find something for the last two checks for #4 and #5. For example, check #4 results in this difficult expression: 1/2*sqrt(4-2*sqrt(2))-cos(2*arctan(-sqrt(2)+1))+sin(3*arctan(-sqrt(2)+1))-sin(2*arctan(-sqrt(2)+1))+cos(3*arctan(-sqrt(2)+1)) Cheers, Rainer
[toc] | [prev] | [next] | [standalone]
| From | acer <maple@rogers.com> |
|---|---|
| Date | 2015-03-09 07:36 -0700 |
| Message-ID | <58932a2e-122c-4dcd-8304-3bdcb5913803@googlegroups.com> |
| In reply to | #1109 |
On Monday, March 9, 2015 at 9:37:30 AM UTC-4, Rainer Rosenthal wrote: > Am 09.03.2015 um 14:09 schrieb acer: > > It could be that in MapleV evala/Normal might get it when radnormal or simplify(...,radical) fail. > > That is, something like, > > > > map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); > > > Wow, solutions #3 and #6 are verified by a clear "0" now, nice! > > map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); > gives the following list: > > [0, # Check solution #1 > 0, # Check solution #2 > 0, # Check solution #3 > not so easy, # Check solution #4 > not so easy, # Check solution #5 > 0] # Check solution #6 > > Many thanks! > I'd love to find something for the last two checks for #4 and #5. > > For example, check #4 results in this difficult expression: > 1/2*sqrt(4-2*sqrt(2))-cos(2*arctan(-sqrt(2)+1))+sin(3*arctan(-sqrt(2)+1))-sin(2*arctan(-sqrt(2)+1))+cos(3*arctan(-sqrt(2)+1)) > > Cheers, > Rainer Another possibility, is to convert to expln. (Again, for those coming late to the party, the problem here is to use MapleV. The earliest I have access to right now is MapleV R5. I'm not sure which Rainer is using.) Also, it might help to simplify the values of list p before applying f. map(z->radnormal(expand(convert(f(simplify(z)),expln))),p); In my MapleV R5 just this is enough, map(z->radnormal(expand(f(simplify(z)))),p);
[toc] | [prev] | [next] | [standalone]
| From | acer <maple@rogers.com> |
|---|---|
| Date | 2015-03-09 07:48 -0700 |
| Message-ID | <2ae20fbe-d745-474d-b049-7444706395ab@googlegroups.com> |
| In reply to | #1110 |
On Monday, March 9, 2015 at 10:36:12 AM UTC-4, acer wrote: > On Monday, March 9, 2015 at 9:37:30 AM UTC-4, Rainer Rosenthal wrote: > > Am 09.03.2015 um 14:09 schrieb acer: > > > It could be that in MapleV evala/Normal might get it when radnormal or simplify(...,radical) fail. > > > That is, something like, > > > > > > map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); > > > > > Wow, solutions #3 and #6 are verified by a clear "0" now, nice! > > > > map(u->evala(Normal(simplify(convert(simplify(f(u)),radical)))),p); > > gives the following list: > > > > [0, # Check solution #1 > > 0, # Check solution #2 > > 0, # Check solution #3 > > not so easy, # Check solution #4 > > not so easy, # Check solution #5 > > 0] # Check solution #6 > > > > Many thanks! > > I'd love to find something for the last two checks for #4 and #5. > > > > For example, check #4 results in this difficult expression: > > 1/2*sqrt(4-2*sqrt(2))-cos(2*arctan(-sqrt(2)+1))+sin(3*arctan(-sqrt(2)+1))-sin(2*arctan(-sqrt(2)+1))+cos(3*arctan(-sqrt(2)+1)) > > > > Cheers, > > Rainer > > Another possibility, is to convert to expln. (Again, for those coming late to the party, the problem here is to use MapleV. The earliest I have access to right now is MapleV R5. I'm not sure which Rainer is using.) > > Also, it might help to simplify the values of list p before applying f. > > map(z->radnormal(expand(convert(f(simplify(z)),expln))),p); > > In my MapleV R5 just this is enough, > > map(z->radnormal(expand(f(simplify(z)))),p); Actually, in my MapleV R5 it is enough to just do, map(z->simplify(expand(f(z))),p); Without access to the particular MapleV version Rainer is using it's tricky to figure out the best way to get cos(3*arctan(-2^(1/2)+1)) converted to just radicals.
[toc] | [prev] | [next] | [standalone]
| From | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| Date | 2015-03-09 17:56 +0100 |
| Message-ID | <cm61fsF2o63U1@mid.individual.net> |
| In reply to | #1110 |
Am 09.03.2015 um 15:36 schrieb acer:
> In my MapleV R5 just this is enough,
>
> map(z->radnormal(expand(f(simplify(z)))),p);
>
Well, that wasn't enough for my Maple Version
Maple 6
Jan 31 2000
(Hmm, I thought it was Maple V. And maybe it's just Maple V, R6?).
It gave a clear 0 for check #4 and #5 (great! thanks!), but
it failed for #3 and #6. Following the advice of my nephew
Frithjof I combined all the tricks:
convrad := x -> convert(x,radical);
squeeze := radnormal@expand@evala@Normal@simplify@convrad@simplify@f@simplify;
And, alas! There we are:
map(squeeze,p);
[0, 0, 0, 0, 0, 0]
What a neat result! Many thanks for your help. That was fun!
Cheers,
Rainer
[toc] | [prev] | [next] | [standalone]
| From | acer <maple@rogers.com> |
|---|---|
| Date | 2015-03-09 10:15 -0700 |
| Message-ID | <ba41d2e8-fc39-4440-8906-4b403d748c4d@googlegroups.com> |
| In reply to | #1112 |
On Monday, March 9, 2015 at 12:53:19 PM UTC-4, Rainer Rosenthal wrote:
> Am 09.03.2015 um 15:36 schrieb acer:
> > In my MapleV R5 just this is enough,
> >
> > map(z->radnormal(expand(f(simplify(z)))),p);
> >
>
> Well, that wasn't enough for my Maple Version
>
> Maple 6
> Jan 31 2000
>
> (Hmm, I thought it was Maple V. And maybe it's just Maple V, R6?).
>
> It gave a clear 0 for check #4 and #5 (great! thanks!), but
> it failed for #3 and #6. Following the advice of my nephew
> Frithjof I combined all the tricks:
>
> convrad := x -> convert(x,radical);
> squeeze := radnormal@expand@evala@Normal@simplify@convrad@simplify@f@simplify;
>
> And, alas! There we are:
>
> map(squeeze,p);
> [0, 0, 0, 0, 0, 0]
>
> What a neat result! Many thanks for your help. That was fun!
>
> Cheers,
> Rainer
There is no version MapleV R6. After MapleV R5 came Maple 6.
And in Maple 6 I can get all size to become zero without having to use evala/Normal.
kernelopts(version);
Maple 6.01, SUN SPARC SOLARIS, June 9 2000 Build ID 79514
f := x -> sin(x) + sin(2*x) + sin(3*x) - (cos(x) + cos(2*x) + cos(3*x)):
p := [solve(f(x)=0,x)]:
map(z->simplify(expand(convert(f(z),radical))),p); # quick
[0, 0, 0, 0, 0, 0]
map(z->radnormal(expand(convert(f(z),expln))),p); # slower
[0, 0, 0, 0, 0, 0]
Applying simplify to z in p before applying f is not necessary. But it seems nice to notice that p's entries can themselves be simplified.
map(simplify,p);
1/2 1/2
[2/3 Pi, - 2/3 Pi, 1/8 Pi, -arctan(-2 + 1) - Pi, arctan(-1 - 2 ), 5/8 Pi]
So,
P := map(simplify,p):
map(z->simplify(expand(convert(f(z),radical))),P); # quick
[0, 0, 0, 0, 0, 0]
map(z->radnormal(expand(convert(f(z),expln))),P); # slower
[0, 0, 0, 0, 0, 0]
Have a great day.
[toc] | [prev] | [next] | [standalone]
| From | Rainer Rosenthal <r.rosenthal@web.de> |
|---|---|
| Date | 2015-03-10 01:12 +0100 |
| Message-ID | <cm6r04F9hnlU1@mid.individual.net> |
| In reply to | #1113 |
Am 09.03.2015 um 18:15 schrieb acer:
> kernelopts(version);
> Maple 6.01, SUN SPARC SOLARIS, June 9 2000 Build ID 79514
>
> f := x -> sin(x) + sin(2*x) + sin(3*x) - (cos(x) + cos(2*x) + cos(3*x)):
> p := [solve(f(x)=0,x)]:
>
#### Me:
kernelopts(version);
Maple 6, IBM INTEL NT, Jan 31 2000 Build ID 16401
> map(z->simplify(expand(convert(f(z),radical))),p); # quick
>
> [0, 0, 0, 0, 0, 0]
#### Me (oh, same, great!):
[0, 0, 0, 0, 0, 0]
> map(z->radnormal(expand(convert(f(z),expln))),p); # slower
>
> [0, 0, 0, 0, 0, 0]
#### Me (oh, same, great!):
[0, 0, 0, 0, 0, 0]
> Applying simplify to z in p before applying f is not necessary. But it seems nice to notice that p's entries can themselves be simplified.
>
> map(simplify,p);
>
> 1/2 1/2
> [2/3 Pi, - 2/3 Pi, 1/8 Pi, -arctan(-2 + 1) - Pi, arctan(-1 - 2 ), 5/8 Pi]
>
#### Me (nearly same):
[2/3 Pi, - 2/3 Pi, 1/8 Pi, -arctan(-sqrt(2) + 1) - Pi, arctan(-1 - sqrt(2)), 5/8 Pi]
> So,
>
> P := map(simplify,p):
>
> map(z->simplify(expand(convert(f(z),radical))),P); # quick
>
> [0, 0, 0, 0, 0, 0]
>
> map(z->radnormal(expand(convert(f(z),expln))),P); # slower
>
> [0, 0, 0, 0, 0, 0]
>
Again, same for me.
> Have a great day.
Oops, already had one today :-)
Have a nice week!
Cheers,
Rainer
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.maple
csiph-web