6

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'?

braX
  • 11,506
  • 5
  • 20
  • 33
user1676921
  • 83
  • 1
  • 5

2 Answers2

5

This should do what you want:

y'[x_] =.

See Unset. Also see this question for related information.

Community
  • 1
  • 1
image_doctor
  • 501
  • 3
  • 6
1

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

Community
  • 1
  • 1
Chris Degnen
  • 8,443
  • 2
  • 23
  • 40