Re: How do I get a DSolve'd function

*To*: mathgroup at smc.vnet.net*Subject*: [mg54457] Re: [mg54384] How do I get a DSolve'd function*From*: DrBob <drbob at bigfoot.com>*Date*: Sun, 20 Feb 2005 00:11:22 -0500 (EST)*References*: <200502190733.CAA06184@smc.vnet.net>*Reply-to*: drbob at bigfoot.com*Sender*: owner-wri-mathgroup at wolfram.com

sol = Last@DSolve[{f'[x] == -3f[x], f[0] == 10}, f[x], x] Plot[f[x] /. sol, {x, 0, 10}] or sol = DSolve[{f'[x] == -3f[x], f[0] == 10}, f, x] Plot[f[x] /. sol, {x, 0, 10}] or Clear@f f = f /. Last@DSolve[{f'[x] == -3f[x], f[0] == 10}, f, x] Plot[f@x, {x, 0, 10}] or sol = DSolve[{f'[x] == -3f[x], f[0] == 10}, f, x] Plot[f@x /. First@sol, {x, 0, 10}] The third method may be the one you like best. Bobby On Sat, 19 Feb 2005 02:33:01 -0500 (EST), Skirmantas <skirmantas.janusonis at yale.edu> wrote: > I hope this is the last question for now. > > I can solve a differential equation and plot it by doing something > like this: > > sol=DSolve[{f'[x]==-3f[x],f[0]==10},f,x] > Plot[f/.sol,{x,0,10}] > > But how do I get the function f[x] itself? I want to be able to input > f[x] and get its definition. Or do Plot[f[x],{x,0,10}]. Or define > y[x_]:=f[x]^2. > > f[x]/.sol or f[x_]:=f[x]/.sol or f[x_]:=sol[[n,n,n]] do not work. > > What if the solution is a function with many variables, say u[x,y,z]? > What's the correct way to "get" it? > > > > -- DrBob at bigfoot.com www.eclecticdreams.net

**References**:**How do I get a DSolve'd function***From:*skirmantas.janusonis@yale.edu (Skirmantas)