Mathematica清除函数的派生定义

时间:2012-09-17 07:34:15

标签: function wolfram-mathematica clear derivative

我在Mathematica中定义了函数的导数而没有定义函数本身,即我有一个如下所示的函数定义:

y'[x_] := constant * f'[x].

我无法弄清楚如何清除它。如果我使用Clear[y']或`ClearAll [y'],我会收到一条错误消息:

  

ClearAll::ssym: y'不是符号或字符串。

Clear[y]ClearAll[y]无法删除y'的定义。

有关如何删除y'的定义的任何想法?

2 个答案:

答案 0 :(得分:3)

这应该做你想要的:

y'[x_] =.

Unset。另请参阅this question了解相关信息。

答案 1 :(得分:1)

您可以使用Remove[y]。对于函数名称f'是不寻常的语法,但它确实出现在衍生文档中:http://reference.wolfram.com/mathematica/ref/Derivative.html

衍生品名称表格似乎为Information (??)提出了一些问题,通常会显示属性信息。

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

常数f'[4]

Global`y

Remove[y]
??y

信息:: notfound:未找到符号y。 >>

y'[4]

Y'[4]

但奇怪的是,(与衍生品名称形式无关):

Information[y]

Global`y

这里有一些关于Remove的更深入信息:https://mathematica.stackexchange.com/questions/4921/what-is-the-story-with-removed-symbols