Question: If cannot do cos(x)>0 and sin(x)>0

Heck Example 15.5 must have worked for an old version of maple.

## plot two functions and color the region between
sine :=   plot(sin(x), x=0..4*Pi, color=black,thickness=3):
s    :=   plot(sin(x), x=0..4*Pi, color=red, filled=true):
cosine := plot(cos(x), x=0..4*Pi, color=black,thickness=3):
c      := plot(cos(x), x=0..4*Pi, color=red, filled=true):
f := x -> if cos(x)>0 and sin(x)>0 then
          elif cos(x)<0 and sin(x)<0 then
          else 0
          end if;
b := plot(f(x), x=0..4*Pi, filled=true, color=green):

display([sine, cosine, b, s, c]):

Gives the error.

Error, (in f) cannot determine if this expression is true or false: 0 < cos(x)
and 0 < sin(x)

I tried verify(cos(x),0,less_than) and verify(sin(x),0,less_than), etc., but that makes f(x) always return 0.

f := sin(x);
g := cos(x);
plottools:-transform(unapply([x,y+g],x,y))(plot(f-g,x=0 .. 4*Pi,filled=true));
Works, but, I can not remember how that works.

Is it possible to use if in maple 2020.

Please Wait...