MathGroup Archive 2008

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

Search the Archive

Re: Draw two functions in a graph, one of them does also have a parameter.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90189] Re: Draw two functions in a graph, one of them does also have a parameter.
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 2 Jul 2008 05:27:27 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <g4d2ut$er8$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,
a) try the correct syntax

f[x_] := -x^2 + 6 x
g[a_][x_] := a x

b)

Manipulate[
  Plot[{f[x], g[a][x]}, {x, 0, 7}],
  {a, 0, 3}
  ]

??

Regards
   Jens


Felipe Mannshardt wrote:
> Is there a way to do a Plot do draw this two functions in the same graph ?
> I am asking because i am having problems due the parameter  "a".
> 
> I have,
> 
> f(x)= -x^2 + 6x
> g(x)= ax
> 
> i want to draw them in the same graphic and with a from 0 to 3 . . .
> 
> Can not think of a way of doing this, due the "a" parameter . . .
> 
> Plot[{f[x],[g[a][x]},{x,0,7},{a,0,3}]
> 
> 
> Can some help me out with this small issue ?
> 
> 
> 
> In Latex,
> 
> 
> 
> \text{Clear}[x,f,g]
> 
> f[\text{x$\_$}]\text{:=}-x^2+6x
> 
> \text{Nullstellen} \text{von} f[x]
> 
> 
> 
> \text{Solve}[f[x]==0,x]
> 
> \{\{x\to 0\},\{x\to 6\}\}
> 
> \text{Fl{\" a}che} \text{von} f[x]
> 
> 
> 
> \int_0^6 f[x] \, dx
> 
> 36
> 
> \text{Clear}[x]
> 
> g[\text{a$\_$}][\text{x$\_$}]\text{:=}a*x
> 
> \text{Graphisch} \text{dargestellt}
> 
> 
> 
> \text{Plot}[f[x],\{x,-0.2,6.2\}]
> 
> 
> 
> \text{Plot}[\text{Table}[g[a][x],\{a,0,3\}],\{x,0,2\}]
> 
> 
> 
> 
> 
> 
> 
> 


  • Prev by Date: Re: On the built-in function "Compile"
  • Next by Date: Re: Draw two functions in a graph, one of them does also have a parameter.
  • Previous by thread: Re: Draw two functions in a graph, one of them does also have a parameter.
  • Next by thread: Re: Draw two functions in a graph, one of them does also have a parameter.