Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1631 > unrolled thread

Re: How to plot derivative directly?

Started byBob Hanlon <hanlonr@cox.net>
First post2011-04-12 09:57 +0000
Last post2011-04-12 09:57 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: How to plot derivative directly? Bob Hanlon <hanlonr@cox.net> - 2011-04-12 09:57 +0000

#1631 — Re: How to plot derivative directly?

FromBob Hanlon <hanlonr@cox.net>
Date2011-04-12 09:57 +0000
SubjectRe: How to plot derivative directly?
Message-ID<io17mp$ib7$1@smc.vnet.net>
f[x_] = x^3 - 6 (x + 1)^2 + x - 7;

Plot[f'[x], {x, -3, 8}]

Attributes[Plot]

{HoldAll, Protected}

Plot[Evaluate[D[f[x], x]], {x, -3, 8}]


Bob Hanlon

---- "=C5 er=C3=BDch Jakub" <Serych@panska.cz> wrote:

==========================

Dear mathgroup,

it seems to me, that response to my question shall be very simple,
but I cannot find it. :-(

I want to plot the derivative of the function. I would like to do it
directly, something like:

Plot[D[x^3 - 6 (x + 1)^2 + x - 7, x],{x,-3,8}]

It returns: General::ivar: "-2.99978 is not a valid variable."

I can understand that it is because local variable x from Plot command
interferes with the x variable from the D[].

Yes I can bypass the problem by:
deriv = D[x^3 - 6 (x + 1)^2 + x - 7, x]
Plot[deriv, {x, -3, 8}]

which is fully functional, but as far as I know Mathematica, there must
be some simple solution how to do it directly inside the Plot[].

Thanks in advance for kick-off

Jakub

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web