HP Forums
Differentiation Using Template Key - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Differentiation Using Template Key (/thread-20761.html)



Differentiation Using Template Key - ktate749 - 11-02-2023 07:27 PM

I tried an example of differentiation I saw on YouTube, i.e. (COS(e^x)) in CAS mode. Using the template key d()/d() and setting x= to some value in the denominator I get a correct symbolic answer, e.g. for x=2 -e^2*sin(e^2). But if I leave the equal off the x the calculator assumes x=0 and returns -sin(1) as an answer. In the video the calculator returned -e^x*sin(e^x) a general symbolic answer.
If I explicitly enter diff(cos(e^x)) I get the expected general symbolic answer -e^x*sin(e^x).
What gives?


RE: Differentiation Using Template Key - KeithB - 11-09-2023 02:56 PM

You probably need to purge the variable so that it is purely symbolic. A value of 0 is a value of, well 0, not an undefined variable.

In cas mode use purge(x) or whatever your variable is.


RE: Differentiation Using Template Key - KeithB - 11-10-2023 03:57 AM

I don't see a template for symbolic differentiation, just the partial derivative, called numerical derivative.


RE: Differentiation Using Template Key - ktate749 - 11-17-2023 09:54 PM

From a different problem I've had (see Factoring in CAS) it appears that I have a value stored in "x" so any function I try using x as a variable will return a value instead of a general expression. I'll have to find out how to delete stored values.

Thanks,
Kurt Tate


RE: Differentiation Using Template Key - cdmackay - 11-17-2023 11:14 PM

(11-17-2023 09:54 PM)ktate749 Wrote:  From a different problem I've had (see Factoring in CAS) it appears that I have a value stored in "x" so any function I try using x as a variable will return a value instead of a general expression. I'll have to find out how to delete stored values.

KeithB told you, in their post above Smile

in CAS, you can use purge(). You can also:

CAS — Vars — CAS — All — <var> then backspace to delete

memory manager (Shift B) — CAS Vars; select, then delete or backspace.


In Home, viewed with:
Home — Vars — User — User Variables — <var>; backspace to delete

memory manager Shift B — User Variables
scroll down for lower-case variables
select, then Delete or backspace
may also be deleted with function DelHVars()


RE: Differentiation Using Template Key - ktate749 - 11-18-2023 06:00 PM

Thanks a million Keith,
It looks like that last method (Shift B, User Variables, scroll to x, Delete) worked. I can now use x as a variable in symbolic calculations.

Kurt Tate


RE: Differentiation Using Template Key - ktate749 - 11-18-2023 06:08 PM

I think the third method (memory manager (Shift B) — CAS Vars; select, then delete or backspace.) would have also worked.
I tried the first two but they didn't work. In the second method I don't have a CAS soft button available.


RE: Differentiation Using Template Key - ktate749 - 11-18-2023 06:31 PM

Oops, I just noticed it wasn't KeithB who solved my problem. So thank you very much cdmackay.


RE: Differentiation Using Template Key - cdmackay - 11-19-2023 12:48 AM

(11-18-2023 06:00 PM)ktate749 Wrote:  It looks like that last method (Shift B, User Variables, scroll to x, Delete) worked. I can now use x as a variable in symbolic calculations.

If that worked, that indicates that your x was a Home variable, which explains why purge() didn't work, since that is for CAS variables.


RE: Differentiation Using Template Key - ktate749 - 11-19-2023 06:31 PM

OK
Now that I've deleted x it has reverted to a CAS variable, correct? Whenever I'm in Home mode I should refrain from using lower case variables in expressions, or after I'm done with them go into Mem and delete them, is that right?

Thanks again,
Kurt Tate


RE: Differentiation Using Template Key - cdmackay - 11-19-2023 10:21 PM

(11-19-2023 06:31 PM)ktate749 Wrote:  Now that I've deleted x it has reverted to a CAS variable, correct? Whenever I'm in Home mode I should refrain from using lower case variables in expressions, or after I'm done with them go into Mem and delete them, is that right?

Not quite.

Home and CAS modes are entirely separate; other than the possibilities to copy/paste between them, they are not connected. At least, I don't think so.

Each mode has its own global variables. If you have assigned something to a global variable, in either mode, then using that variable letter is going to use the value you have assigned to it.

My notes say, for variables:

created in Home
a := 3
4 Sto▸ b # shift P
viewed with
Home — Vars — User — User Variables — a
backspace to delete
memory manager Shift B — User Variables
scroll down for lower-case variables
select, then Delete or backspace
may also be deleted with function DelHVars()

created in CAS
a = 3
4 Sto▸ b # shift P
viewed with
CAS — Vars — CAS — All — a
backspace to delete
memory manager Shift B — CAS Vars
select, then Delete or backspace
may also be deleted with CAS function purge()
only works on CAS vars
also removes assumptions about vars, as well as value