MathGroup Archive 2008

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90215] Re: [mg90176] Draw two functions in a graph, one of them does also
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 2 Jul 2008 05:32:23 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

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

Plot[{f[x], Table[g[a, x], {a, 0, 3}]}, {x, 0, 7}, Frame -> True, 
 Axes -> False]

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


Bob Hanlon

---- Felipe Mannshardt <vexie.infamous at googlemail.com> 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: Fw : Re: Happy Birthday Mathematica!
  • Next by Date: Re: For loop problem in mathematica
  • Previous by thread: Fw : Re: Happy Birthday Mathematica!
  • Next by thread: Re: Draw two functions in a graph, one of them does also