MathGroup Archive 2000

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

Search the Archive

Re: Functions with parameters?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22252] Re: [mg22214] Functions with parameters?
  • From: BobHanlon at aol.com
  • Date: Sat, 19 Feb 2000 01:33:55 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

f[x_, a_] := Log[x/(x - a)]

Off[Plot3D::gval]; Off[Power::infy]; Off[Plot3D::plnc];

The function will have a discontinuity (i.e., not be defined) when x = a.

Plot3D[Abs[f[x, a]], {x, -5, 5}, {a, -5, 5}, PlotPoints -> 20];

Plot3D[Re[f[x, a]], {x, -5, 5}, {a, -5, 5}, PlotPoints -> 20];

Plot3D[Im[f[x, a]], {x, -5, 5}, {a, -5, 5}, PlotPoints -> 20];

For the function to have real values, the argument of the Log must be positive

Needs["Algebra`InequalitySolve`"]

InequalitySolve[x/(x - a) > 0, {x, a}]

x < 0 && a > x || x > 0 && a < x

Since you also specified that a is positive

InequalitySolve[x/(x - a) > 0 &&  a > 0, {x, a}]

x < 0 && a > 0 || x > 0 && 0 < a < x

Plot3D[f[x, a], {x, -5, 5}, {a, 0, 5}, PlotPoints -> 20];

For the derivative

g[x_, a_] := Evaluate[D[f[x, a], x] // Simplify // Factor]

g[x, a]

a/((a - x)*x)

The derivative has discontinuities at x = 0 and x = a. Draw the graphs as 
above for g[x, a].

Bob Hanlon

In a message dated 2/18/2000 4:02:56 AM, tautenhahn at fichtelgebirge.org writes:

>I have Mathematica 4 and I want to discuss a simple function with a
>parameter; The problem, however, is that I neither found some help in
>the online help of Mathematica nor in the book (which is about
>Mathematica 3) by Michael Kofler.
>I don't know if it is possible to do everything I want to do with
>Mathematica and that's why I'm asking here.
>The function I want to discuss is
>
>f(x)=ln(x/(x-a) with a>0
>ok, in Mathematica you type f[x_]=Log[x/(x-a)].
>what I want to do is:
>
>* where is this function defined (I don't know if this is the right
>English word; for example 1/x is *not* defined for x=0; i hope you
>understand what I mean);
>
>* derivatives etc. --> no problem, but again: where is f'(x) defined?
>
>* Plot the function for several values of a
>


  • Prev by Date: Re: Mathematica bug in Graphics3D ??
  • Next by Date: Re: Exporting BMP files in M4
  • Previous by thread: Functions with parameters?
  • Next by thread: Exporting BMP files in M4