Topic: Piecewise Linear Function - Help Needed

Hi,

First off, thanks for the fantastic program!  I'm currently a college student and this tool has been a tremendous help.

I'm running into trouble graphing piecewise linear functions using the "if" command.

Example:
f(x)=-2x+5 if x<2
        x-4     if x>=2

I'm not sure how to type this correctly in the function box. 

When I type -2x+5 if x<2, I get Error 56: Invalid number of arguments supplied for function "if".

I have tried typing it different ways, but I yield the same result...either an error message or an incorrect graph all together. 

Would you happen to know what I'm doing wrong?

Thank you very much for your time.  It is very much appreciated.

-Scott

Re: Piecewise Linear Function - Help Needed

You need to type it as this:

f(x)=if(x<2, -2x+5, x-4)

Re: Piecewise Linear Function - Help Needed

Perfect!

Thank you very much.