Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: derivation of a picewise defined function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46124] Re: derivation of a picewise defined function
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Sat, 7 Feb 2004 04:02:05 -0500 (EST)
  • References: <bvvnam$j4h$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"M.L. Bondar" <mbondar at win.tue.nl> wrote:
> I have the following problem. I need to work with the first derivative
> of a picewise defined function.
>
> A simple example :
>
> h[x_] := x /; 1 <= x
> h[x_] := E^(x - 1) /; x <= 1
>
> I define
> j[x_] := h'[x]
>
> For 1<= x j[x] computes the values, j[x]=1 for all 1<=x, but for
> x<=1 it returnes me j[x]=h'[x].
>
> I need also the values of j for x<=1. How can I do that with
> Mathematica?

I suggest that you rewrite your function using UnitStep as

In[1]:= h[x_] := E^(x - 1) + UnitStep[x - 1](x - E^(x - 1))

Then differentiating and simplifying gives what I think you want

In[2]:= D[h[x], x]

Out[2]= E^(-1 + x) + (-E^(-1 + x) + x)*DiracDelta[-1 + x] +
  (1 - E^(-1 + x))*UnitStep[-1 + x]

In[3]:= Simplify[%]

Out[3]= E^(-1 + x) + (1 - E^(-1 + x))*UnitStep[-1 + x]

David


  • Prev by Date: RE: derivation of a picewise defined function
  • Next by Date: RE: random numbers?
  • Previous by thread: RE: derivation of a picewise defined function
  • Next by thread: RE: derivation of a picewise defined function