The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

f'(x) at a specific "x" on Prime
Message #1 Posted by Richard Berler on 30 Nov 2013, 12:06 a.m.

When using the template in CAS to type in f'(sin x) where x=pi/3, I get the expected 1/2. In home, if 0 is stored in X, the same derivative evaluates as 0. Why doesn't using the "where X=pi/3" temporarily override the 0 that was stored in X to produce the expected 1/2?

      
Re: f'(x) at a specific "x" on Prime
Message #2 Posted by Michael de Estrada on 30 Nov 2013, 12:35 a.m.,
in response to message #1 by Richard Berler

If you use the form SLOPE(SIN(X),pi/3), you get the correct answer.

            
Re: f'(x) at a specific "x" on Prime
Message #3 Posted by Richard Berler on 30 Nov 2013, 1:06 a.m.,
in response to message #2 by Michael de Estrada

Thanks. How do I know when it is appropriate to use the "where X=" template. Is this meant mainly for CAS?

                  
Re: f'(x) at a specific "x" on Prime
Message #4 Posted by Michael de Estrada on 30 Nov 2013, 1:17 a.m.,
in response to message #3 by Richard Berler

Well basically the ' derivative is the CAS function diff, which is primarily a symbolic operation, so you are going to have problems using it outside of CAS. Capital X is a reserved real number variable, whereas small x is just a symbol that can take on a numeric value. SLOPE OTOH is a non-CAS operation that is numeric in nature, hence the format where you assign a numeric value to the point where you want to find the derivative. You can still use SLOPE in CAS if you want to as well as Home. Small letter operations and functions like diff are typically CAS, whereas capital lettered ones like SLOPE are non-CAS.

      
Re: f'(x) at a specific "x" on Prime
Message #5 Posted by James Williams on 30 Nov 2013, 9:59 a.m.,
in response to message #1 by Richard Berler

Richard, by "using the template," I assume you mean you are using the derivative template on the math template key rather than typing "diff" on the entry line. True? If so, I don't see how you are able to add a "where X=pi/3" with the template. What exactly did you mean by that?

I've been evaluating derivatives at specific points in CAS View with

eval(diff(sin(x)),x=pi/3)

Have you found a better way using the templates?

I was getting so many uppercase-lowercase errors that I just stay in CAS now unless I'm just doing simple "scientific calculator" math. If I want to get an approximate answer instead of a symbolic one, I use Shift+Enter instead of Enter rather than going back to Home View.

            
Re: f'(x) at a specific "x" on Prime
Message #6 Posted by Michael de Estrada on 30 Nov 2013, 10:13 a.m.,
in response to message #5 by James Williams

Which is why I will use a non-CAS alternative such as SLOPE if it is available. It works w/o any drama anywhere, including programs, and no worrying about upper case vs lower case, quotes, local vs global variables etc. I find CAS to be most useful when seeking purely symbolic results.

Edited: 30 Nov 2013, 10:14 a.m.

            
Re: f'(x) at a specific "x" on Prime
Message #7 Posted by Richard Berler on 30 Nov 2013, 10:30 a.m.,
in response to message #5 by James Williams

I used the template key and chose where f(x) = choice and filled the template in (choosing template again to enter the function to differentiate) and then filled in the where X= part. This way of doing worked in CAS, but the where x= Option would not override whatever had been stored in X (0, for example) in home view. I could use the template for differentiating an equation in home, and simply store my value of interest in X, and it would work. Seemed strange that the use of the where X= template wouldn't temporarily override the stored X value. If I didn't recognize an answer as wrong, I would be mislead by this procedure not working in home.

                  
Re: f'(x) at a specific "x" on Prime
Message #8 Posted by James Williams on 30 Nov 2013, 10:44 a.m.,
in response to message #7 by Richard Berler

Sorry, I still don't understand. I am in CAS View and have the math template key pressed now (the key with "Units" and "C" on it), and there is no "f(x) = choice" kind of option, nor is there a "where X=" part. Precisely what key are you pressing to get this?

                        
Re: f'(x) at a specific "x" on Prime
Message #9 Posted by Michael de Estrada on 30 Nov 2013, 10:51 a.m.,
in response to message #8 by James Williams

You have to first enter the derivative template (fourth item on first row), make the entries, then enter the where bar |, after which the where options will appear as you enter them.

                        
Re: f'(x) at a specific "x" on Prime
Message #10 Posted by Richard Berler on 30 Nov 2013, 10:51 a.m.,
in response to message #8 by James Williams

You are right there...the where variable equals option is the choice on the template menu immediately left of the differentiate choice. This works fine in CAS, but the where variable equals whatever option will not override whatever had been stored in X in home which I find strange, and misleading to a student that might try this in the home view...an correct answer for whatever had been stored in X will come up in home instead.

                              
Re: f'(x) at a specific "x" on Prime
Message #11 Posted by James Williams on 30 Nov 2013, 11:10 a.m.,
in response to message #10 by Richard Berler

Got it. Thanks.

By the way, I get exactly the same behavior as you do in Home View.

      
Re: f'(x) at a specific "x" on Prime
Message #12 Posted by Han on 30 Nov 2013, 11:34 a.m.,
in response to message #1 by Richard Berler

Quote:
When using the template in CAS to type in f'(sin x) where x=pi/3, I get the expected 1/2. In home, if 0 is stored in X, the same derivative evaluates as 0. Why doesn't using the "where X=pi/3" temporarily override the 0 that was stored in X to produce the expected 1/2?

What exactly did you mean by: f'(sin x) ? I would interpret this as: f(x) is a predefined function, and we wish to evaluate the derivative of f(x) at sin(x). Perhaps you meant simply to take the derivative of f(x) = sin(x), and evaluate the result at x=pi/3?

In CAS view, type:

f(x) := sin(x); g := f' ;

Now, whether you are in HOME or CAS, you can simply type:

g(pi/3)

to get the correct result.

With respect to using they templates:

As you have noticed, the behavior is different in CAS and HOME view. It's just how things were designed on the HP Prime. For symbolic manipulation and exact evaluation, use CAS view.

            
Re: f'(x) at a specific "x" on Prime
Message #13 Posted by Richard Berler on 30 Nov 2013, 2:26 p.m.,
in response to message #12 by Han

Thanks for the discussion and working solution. I do hope for more intuitive consistency between home and CAS. By offering the template option of "where variable equals", it implies that this has been offered to me as a handy tool to accomplish this sort of task. If it won't work in home, it should be grayed out perhaps. In any case, consistency between CAS and home should be a goal for intuitive use of this wonderful creation! I remembering wondering with a friend while a senior in high school...1971-1972...how wonderful it would be for such an instrument to be possible!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall