Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: [mg4633] do we need to be moderated? Re: Piecewise Functions
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Allan Hayes

Posts: 1,508
Registered: 12/6/04
Re: [mg4633] do we need to be moderated? Re: Piecewise Functions
Posted: Aug 25, 1996 6:03 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

george@mech.seas.upenn.edu ( George Jefferson )
[mg4633] do we need to be moderated? Re: Piecewise Functions
Is concerned that
>>>>>
for a piecewise function:

f[x_ /; x> 0] := g[x]
f[x_ /; x<=0] := h[x]

differentiation doesn't work correctly even where we specify
the point x:

D[f[x],x] /. x-> -1

f'[-1]

<<<<<<<<

George:
You can use If. Thus

f[x_]:= If[x<4,g[x],h[x]]


f'[x]

If[x < 4, g'[x], h'[x]]

f'[3]
g'[3]


f'[5]
h'[5]

Allan Hayes
hay@haystack.demon.co.uk







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.