Question: New to Maple: How do I define a function with a restricted domain?

Hi,

I want to plot a function with a restricted domain, specifically f(x) = |x| if -Pi <= x < Pi.

I want to first define the function, then use it in the plot command.

I know to define the function f(x) = |x|, I do

f := x -> |x|

...but how do I tell Maple to include the domain, -Pi <= x < Pi?

Thank you.

Please Wait...