Mathematica clears the definition of a derived function

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 clean it. If I use Clear[y'] or `ClearAll [y'], I get an error message:

ClearAll::ssym: y' not a character or 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' ?

+4
source share
2 answers

This should do what you want:

 y'[x_] =. 

See Unset . Also see this question for related information.

+3
source

You can use Remove[y] . For the function name, f' is an unusual syntax, but it appears in the documentation for the derivative: http://reference.wolfram.com/mathematica/ref/Derivative.html

The derivative name form seems to be a small issue for Information (??) , which usually displays attribute information.

 y'[x_] := constant*f'[x] y'[4] ??y 

f 'constant [4]

Global`y

 Remove[y] ??y 

Information :: notfound: The symbol y was not found. β†’

 y'[4] 

y '[4]

But strange (and has nothing to do with the derivative name form):

 Information[y] 

Global`y

Find out more about Remove : https://mathematica.stackexchange.com/questions/4921/what-is-the-story-with-removed-symbols

+1
source

Source: https://habr.com/ru/post/1434550/


All Articles