# HP Forums

Full Version: Differentiation Using Template Key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
I don't see a template for symbolic differentiation, just the partial derivative, called numerical derivative.
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
(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

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()
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
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.
Oops, I just noticed it wasn't KeithB who solved my problem. So thank you very much cdmackay.
(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.
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
(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
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :