I am trying to get Maple to simplify the following trigonometric expressions (for "generic" parameters) as much as possible:
sineExpr(3) := (
sin(a[2] - b[1])*sin(a[3] - b[1]))/(
sin(b[2] - b[1])*sin(b[3] - b[1]))*sin(a[1] - b[1]) + (
sin(a[3] - b[2])*sin(a[1] - b[2]))/(
sin(b[3] - b[2])*sin(b[1] - b[2]))*sin(a[2] - b[2]) + (
sin(a[1] - b[3])*sin(a[2] - b[3]))/(
sin(b[1] - b[3])*sin(b[2] - b[3]))*sin(a[3] - b[3]);
=
sineExpr(4) := (
sin(a[2] - b[1])*sin(a[3] - b[1])*sin(a[4] - b[1]))/(
sin(b[2] - b[1])*sin(b[3] - b[1])*sin(b[4] - b[1]))*
sin(a[1] - b[1]) + (
sin(a[3] - b[2])*sin(a[4] - b[2])*sin(a[1] - b[2]))/(
sin(b[3] - b[2])*sin(b[4] - b[2])*sin(b[1] - b[2]))*
sin(a[2] - b[2]) + (
sin(a[4] - b[3])*sin(a[1] - b[3])*sin(a[2] - b[3]))/(
sin(b[4] - b[3])*sin(b[1] - b[3])*sin(b[2] - b[3]))*
sin(a[3] - b[3]) + (
sin(a[1] - b[4])*sin(a[2] - b[4])*sin(a[3] - b[4]))/(
sin(b[1] - b[4])*sin(b[2] - b[4])*sin(b[3] - b[4]))*
sin(a[4] - b[4]);
=
So far, all of my attempts have failed:

|
(1) |
> |
![sineExpr := proc (m::posint) options operator, arrow; add(mul(ifelse(j <> t, (':-sin')(a[j]-b[t])/(':-sin')(b[j]-b[t]), (':-sin')(a[t]-b[t])), j = 1 .. m), t = 1 .. m) end proc](/view.aspx?sf=238033_question/6bc3a5dc14a00dd9227449bde9ed8361.gif)
|
> |
combine(simplify(normal(sineExpr(1), expanded), trig), trig);
|
![sin(a[1]-b[1])](/view.aspx?sf=238033_question/b72aca7a1fab242f36a2a1fbd0d51cdf.gif)
|
(2) |
> |
combine(simplify(normal(sineExpr(2), expanded), trig), trig); # which can be transformed into sin((a[1]+a[2])-(b[1]+b[2])) only in certain legacy versions!
|
![-(1/2)*(cos(-2*b[2]+a[1]+a[2])-cos(-2*b[1]+a[1]+a[2]))/sin(b[1]-b[2])](/view.aspx?sf=238033_question/c2b31942f29f52a1335877622c515542.gif)
|
(3) |
> |
combine(simplify(normal(sineExpr(3), expanded), trig), trig);
|
![(1/2)*(cos(-b[1]-3*b[2]+b[3]+a[2]+a[3]+a[1])-cos(b[1]-3*b[2]-b[3]+a[2]+a[3]+a[1])-cos(-b[1]-3*b[3]+a[2]+a[3]+a[1]+b[2])+cos(b[1]-3*b[3]-b[2]+a[2]+a[3]+a[1])+cos(-3*b[1]+a[2]+a[3]+a[1]+b[2]-b[3])-cos(-3*b[1]+a[2]+a[3]+a[1]-b[2]+b[3]))/(sin(-2*b[2]+2*b[1])-sin(-2*b[3]+2*b[1])+sin(2*b[2]-2*b[3]))](/view.aspx?sf=238033_question/2b09522171cfaa5ae076029559cecd0e.gif)
|
(4) |
> |
CodeTools:-Usage(combine(simplify(normal(sineExpr(4), expanded), trig), trig));
|
memory used=244.67MiB, alloc change=0 bytes, cpu time=6.17s, real time=5.49s, gc time=1000.00ms
|
|
![(1/2)*(sin(-2*a[3]+4*a[4]+2*a[2]-b[3]-b[4]-b[2]-b[1])-sin(4*a[2]-2*a[4]-b[3]-b[4]-b[2]-b[1]+2*a[1])+sin(-2*a[2]-b[3]-b[4]-b[2]-b[1]+4*a[4]+2*a[1])+sin(-2*a[2]+b[3]+b[4]+b[2]+b[1]-4*a[4]+2*a[1])+sin(-b[3]-b[4]-b[2]-b[1]+4*a[1]-2*a[3]+2*a[4])-sin(4*a[3]-2*a[4]+2*a[2]-b[3]-b[4]-b[2]-b[1])-sin(-4*a[3]-2*a[4]+2*a[2]+b[3]+b[4]+b[2]+b[1])+sin(-2*a[3]-4*a[4]+2*a[2]+b[3]+b[4]+b[2]+b[1])-sin(-2*a[3]+2*a[4]+4*a[2]-b[3]-b[4]-b[2]-b[1])+sin(-4*a[3]+b[3]+b[4]+b[2]+b[1]-2*a[4]+2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(simplify(normal(sineExpr(5), expanded), trig), trig)): # rather lengthy
|
memory used=4.23GiB, alloc change=-32.00MiB, cpu time=2.66m, real time=2.29m, gc time=29.98s
|
|
Can , , and be reduced to , , and respectively by Maple itself (that is, with as little user-intervention as possible) if one is not aware of such reductions in advance?
|
Download sinIdentity.mws
Note that because zero testing is frequently considerably easier, combine
always succeeds in showing that the difference between the simplest possible and the original version is zero.
combine(sin((a[1]+a[2]+a[3])-(b[1]+b[2]+b[3]))-sineExpr(3));
=
0
combine(sin((a[1]+a[2]+a[3]+a[4])-(b[1]+b[2]+b[3]+b[4]))-sineExpr(4));
=
0
However, I wonder if Maple can thoroughly simplify them without knowing those known “simplest possible” form beforehand.
I also tried some other functions like rationalize
, radnormal
, and `convert/trig`
, yet Maple appears to have not been capable of completely simplifying even the sub-simplest case 𝑚=2. Is there any workaround?
Of note, it can be demonstrated inductively that ∀m∈ℕ₊,
where none of the denominators is 0. Nevertheless, as mentioned above, is it possible to transform sineExpr(3) and sineExpr(4) (as well as sineExpr(5), if possible) into potentially more elegant forms (Ideally, sineExpr(3) is rewritten into sin((a1+a2+a3)-(b1+b2+b3)), sineExpr(4) is rewritten into sin((a1+a2+a3+a4)-(b1+b2+b3+b4)), and sineExpr(5) is rewritten into sin((a1+a2+a3+a4+a5)-(b1+b2+b3+b4+b5)).) without any such a priori knowledge?
In Mma, these may be done using TrigReduce
directly (cf.
); unfortunately, I cannot found a Maple equivalent to such functionality.