Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: do we need to be moderated? Re: Piecewise Functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4691] Re: [mg4633] do we need to be moderated? Re: Piecewise Functions
  • From: Allan Hayes <hay at haystack>
  • Date: Sun, 25 Aug 1996 18:23:17 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

george at 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 at haystack.demon.co.uk

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Re: Trilinear plots
  • Next by Date: Integer Partitioning
  • Previous by thread: do we need to be moderated? Re: Piecewise Functions
  • Next by thread: Announcing 1996 Undergraduate Computational Science Education Awards