Post Reply 
Plot derivative of a function
05-31-2014, 02:47 PM
Post: #1
Plot derivative of a function
Hi all

I cannot seem to work out the following and would appreciate some help. In the FUNCTION app, I put some function in F1. What I would like to have is in F2 the calculator to work out the numerical derivative of F1 and therefore be able to plot the function and its derivative.

I don't want to put the actual derivative into F2 but something like F2(X)=diff(F1) (but obviously something that works). Then I could get my students to explore functions and slopes without having to be able to differentiate things that are beyond them.

I'm trying to avoid using any CAS because it is not permitted for the exam system I work within.

Many thanks
Find all posts by this user
Quote this message in a reply
05-31-2014, 03:09 PM (This post was last modified: 05-31-2014 03:18 PM by dg1969.)
Post: #2
RE: Plot derivative of a function
(05-31-2014 02:47 PM)swisscow Wrote:  Hi all

I cannot seem to work out the following and would appreciate some help. In the FUNCTION app, I put some function in F1. What I would like to have is in F2 the calculator to work out the numerical derivative of F1 and therefore be able to plot the function and its derivative.

I don't want to put the actual derivative into F2 but something like F2(X)=diff(F1) (but obviously something that works). Then I could get my students to explore functions and slopes without having to be able to differentiate things that are beyond them.

I'm trying to avoid using any CAS because it is not permitted for the exam system I work within.

Many thanks

I try these example and it works...

F1 : SIN(X)/X
F2 : dF1(X)/dX=X

where d../d.. are in fact the pattern (the key just right near catalogue key... 1rst row 4th coll)

Edit: There is an issue... You can't find extrema of F2 if you need with the embedded tools but the root find works...
Find all posts by this user
Quote this message in a reply
05-31-2014, 03:18 PM
Post: #3
RE: Plot derivative of a function
Genius!

Many thanks, got it working
Find all posts by this user
Quote this message in a reply
05-31-2014, 03:22 PM (This post was last modified: 05-31-2014 03:23 PM by CR Haeger.)
Post: #4
RE: Plot derivative of a function
(05-31-2014 02:47 PM)swisscow Wrote:  Hi all

I cannot seem to work out the following and would appreciate some help. In the FUNCTION app, I put some function in F1. What I would like to have is in F2 the calculator to work out the numerical derivative of F1 and therefore be able to plot the function and its derivative.

I don't want to put the actual derivative into F2 but something like F2(X)=diff(F1) (but obviously something that works). Then I could get my students to explore functions and slopes without having to be able to differentiate things that are beyond them.

I'm trying to avoid using any CAS because it is not permitted for the exam system I work within.

Many thanks

This seems to work:

F1(X)= SIN(X)
F2(X)= SLOPE(F1,X)

where SLOPE() is from Toolbox>App>Function>SLOPE (#5) and
F1 is from Vars>App>Function>Symbolic>F1 (#1)
or type SLOPE(), F1 in with Alpha...

** Teachable moment: looks about 57 times different if you are in degrees versus radians...
Find all posts by this user
Quote this message in a reply
05-31-2014, 03:40 PM
Post: #5
RE: Plot derivative of a function
And another round of thanks for that solution.

I have been trying to crack this for a while and now 2 solutions in as many minutes - marvellous stuff.

Thanks
Find all posts by this user
Quote this message in a reply
05-31-2014, 03:53 PM
Post: #6
RE: Plot derivative of a function
(05-31-2014 03:40 PM)swisscow Wrote:  And another round of thanks for that solution.

I have been trying to crack this for a while and now 2 solutions in as many minutes - marvellous stuff.

Thanks

My pleasure - I only recently stumbled on Toolbox>App>Function> which gives cool plots of slope, area, root etc which are dynamic with changes in F1(X).

May I ask specifically how you key in the first solution? dF1/dX=X? No rush.
Find all posts by this user
Quote this message in a reply
05-31-2014, 04:20 PM
Post: #7
RE: Plot derivative of a function
[/quote]
May I ask specifically how you key in the first solution? dF1/dX=X? No rush.
[/quote]

The key just at the right of the catalogue key... will open a pattern menu... the partial derivative is on 1rst row and 4th coll...
Find all posts by this user
Quote this message in a reply
05-31-2014, 05:03 PM
Post: #8
RE: Plot derivative of a function
Its like a fraction with the dF1(X) on the top and dX=X on the bottom
Find all posts by this user
Quote this message in a reply
05-31-2014, 06:23 PM
Post: #9
RE: Plot derivative of a function
Cool thanks that worked! Wonder why the =X is required?
Find all posts by this user
Quote this message in a reply
05-31-2014, 07:10 PM
Post: #10
RE: Plot derivative of a function
(05-31-2014 06:23 PM)CR Haeger Wrote:  Cool thanks that worked! Wonder why the =X is required?

First I was confused about that too, but if you just put the template of the partial derivative into the command line and then press "Help" you will get a nice explanation on that. The use of dX=X in the denominator becomes clear when using the algebraic entry version of the partial d instead of using the textbook entry.
Find all posts by this user
Quote this message in a reply
06-02-2014, 05:59 AM
Post: #11
RE: Plot derivative of a function
Hello,

Quote:Cool thanks that worked! Wonder why the =X is required?

F2(X) needs to be a function that, when evaluated with a given X variable returns a Y.

if F1(X)=SIN(X)
and F2(X)=dF1(X)/dX
note that the X in the F2(X) definition is NOT the same as the X in F2(X)...
What it is (in programing terms), is a local variable, which has the same name, but is different.
dF1(X)/dX is NOT a function that varies with X as you can calculate it regardless of the value of X...
dF1(X)/dX is the same as dF1(A)/dA for example.

If you restate your problem as: F2 is the result of the EVALUATION of the derivative of F1 with respect to a variable at a given value of a variable, then you see that you do indeed have 2 variables to contend with, not one.

the syntaxe: dF1(X)/dX=value is a shorthand for dF1(X)/dX | X=X (|=WHERE)

Cyrille
Find all posts by this user
Quote this message in a reply
06-04-2014, 06:56 AM
Post: #12
RE: Plot derivative of a function
(06-02-2014 05:59 AM)cyrille de brébisson Wrote:  the syntaxe: dF1(X)/dX=value is a shorthand for dF1(X)/dX | X=X (|=WHERE)

The math purist might prefer dF1(T)/dT=X for dF1(T)/dT | T=X. It seems clearer written this way as it shows that you're taking a derivative with respect to a variable, T, then evaluating it at a value, X.

I strongly discourage students from writing things like the above or ∫(F1(x),x,0,x) in which the x has two different meanings. And by "strongly discourage" I mean I take off a token point on a test. :-)

-wes
Find all posts by this user
Quote this message in a reply
06-04-2014, 08:26 AM
Post: #13
RE: Plot derivative of a function
(06-04-2014 06:56 AM)Wes Loewer Wrote:  … I take off a token point on a test. :-)

just one token point for something which is wrong? … You are really generous!
Find all posts by this user
Quote this message in a reply
06-04-2014, 02:38 PM
Post: #14
RE: Plot derivative of a function
(06-04-2014 08:26 AM)Maro Wrote:  
(06-04-2014 06:56 AM)Wes Loewer Wrote:  … I take off a token point on a test. :-)

just one token point for something which is wrong? … You are really generous!

It depends on the context. Suppose a 10 point problem asked students to find some quantity which required the signed area under a function, f(x), from 0 to some value x, and they wrote ∫ f(x) dx from 0 to x, but correctly found the anti-derivative, correctly evaluated it at the endpoints, subtracted, and gave a correct interpretation. Yeah, I'd probably take off only one point. Call me a push-over, but I'd say they got about 90% of the math correct. :-)
Find all posts by this user
Quote this message in a reply
06-04-2014, 03:04 PM
Post: #15
RE: Plot derivative of a function
Hi Wes
sure! you are right

(06-04-2014 02:38 PM)Wes Loewer Wrote:  ... Call me a push-over, but …

oh no, I will never do that
Find all posts by this user
Quote this message in a reply
06-05-2014, 04:25 AM
Post: #16
RE: Plot derivative of a function
Hello,

Quote:just one token point for something which is wrong? … You are really generous!

Problem is, it is not wrong!
What you have is 2 variables, with the same name but a different scope.
This is not a problem in computer sciences where such a construct
{
int i=0;
{
int i=1;
}
}
happends often, and where we know what to look for (but still causes bugs every once in a while)...

In math, the ground is much murkier as math is WAY less formal than most people think...

regardless, int(f(x),x,0,x) is not 'wrong', it is just VERY confusing to someone who is not paying attention/used to such concepts...

Cyrille
Find all posts by this user
Quote this message in a reply
06-05-2014, 08:00 AM (This post was last modified: 06-05-2014 08:04 AM by Maro.)
Post: #17
RE: Plot derivative of a function
(06-05-2014 04:25 AM)cyrille de brébisson Wrote:  Hello,

Quote:just one token point for something which is wrong? … You are really generous!

Problem is, it is not wrong! ….

Sorry, it is!

(06-05-2014 04:25 AM)cyrille de brébisson Wrote:  
regardless, int(f(x),x,0,x) is not 'wrong', it is just VERY confusing to someone who is not paying attention/used to such concepts...

Cyrille

It may not be "wrong" for someone who is not paying attention to formal math, but for those who do care about math it is wrong! (Math will never be confusing) IMHO, if programmers in general were more correct in math a lot of bugs could be avoided … and customers be satisfied.
Find all posts by this user
Quote this message in a reply
06-05-2014, 08:59 AM
Post: #18
RE: Plot derivative of a function
http://www.hpmuseum.org/forum/thread-1385.html
Find all posts by this user
Quote this message in a reply
06-05-2014, 10:24 AM
Post: #19
RE: Plot derivative of a function
(06-05-2014 08:00 AM)Maro Wrote:  
(06-05-2014 04:25 AM)cyrille de brébisson Wrote:  Hello,


Problem is, it is not wrong! ….

Sorry, it is!

(06-05-2014 04:25 AM)cyrille de brébisson Wrote:  
regardless, int(f(x),x,0,x) is not 'wrong', it is just VERY confusing to someone who is not paying attention/used to such concepts...

Cyrille

It may not be "wrong" for someone who is not paying attention to formal math, but for those who do care about math it is wrong! (Math will never be confusing) IMHO, if programmers in general were more correct in math a lot of bugs could be avoided … and customers be satisfied.

Math check in addition to spell check, and grammar check!
Find all posts by this user
Quote this message in a reply
06-05-2014, 10:39 AM
Post: #20
RE: Plot derivative of a function
Maro, you should have added humor tags about bugs that could possibly be avoided... Just to match cyrille's humor. Though things are about to become off-topic.
But we should focus on the important things like bugs and requests for help. We are the community let's work together. Althogh some are disappointed.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 11 Guest(s)