# how to override the derivative of a function ?

i have the following equation :

R = y \[Function]
Evaluate[
Simplify@
Piecewise[{{1.31446 Tan[1.58986 y] + 0.91209 y,
Abs[y] < 0.84136}, {1./(sign[y] - y),
0.841360 <= Abs[y] < 1.}}]];


how can i override the derivative of the function to be (R'[y_]:=) :

1./(1./R[y]^2 - 1./Sinh[R[y]]^2)

• How about defining it as a new function (say rd1[y_]=1./(1./R[y]^2 - 1./Sinh[R[y]]^2)) and using it in your expression instead of R'[y]? – Sumit Jan 3 '18 at 11:36
• i know that it is possible with defining another function i just wanted to ask out of curiosity if it is possible to override the derivative with the same function ? – user49047 Jan 3 '18 at 11:40
• You can define the derivative (see here) without defining the function. But once you define the function it would be overridden. – Sumit Jan 3 '18 at 11:53