Reputation: 83
I defined the derivative of a function in Mathematica without defining the function itself, i.e. I have a function definition that looks like this:
y'[x_] := constant * f'[x].
I can't figure out how to clear it out. If I use Clear[y']
or `ClearAll[y'], I get an error message:
ClearAll::ssym: y'
is not a symbol or a string.
Clear[y]
and ClearAll[y]
do nothing to remove the definition of y'
.
Any ideas on how I can remove the definition of y'
?
Upvotes: 6
Views: 2083
Reputation: 501
This should do what you want:
y'[x_] =.
See Unset
. Also see this question for related information.
Upvotes: 5
Reputation: 8655
You can use Remove[y]
. For a function name f'
is unusual syntax, but it does appear in the documentation for derivative: http://reference.wolfram.com/mathematica/ref/Derivative.html
The derivative name form seems to present a bit of a problem for Information (??)
, which would usually show attribute information.
y'[x_] := constant*f'[x]
y'[4]
??y
constant f'[4]
Global`y
Remove[y]
??y
Information::notfound : Symbol y not found. >>
y'[4]
y'[4]
But oddly, (and nothing to do with the derivative name form):
Information[y]
Global`y
There is some deeper information about Remove
here: https://mathematica.stackexchange.com/questions/4921/what-is-the-story-with-removed-symbols
Upvotes: 1