# How to continually simplify derivatives of function defined in a system? [closed]

For example, if I input something like

b'[t_] = a[t];
a'[t_] = -Sin[b[t]];

a''[t]


it outputs just a''[t].

Is there a way to get Mathematica to always simplify any derivatives of a and b to expressions only involving a and b (with no derivatives), so that whenever I type in something like a''[t] it outputs -Cos[b[t]]a[t]?

• use := instead of =? – AccidentalFourierTransform Feb 8 at 0:42
• That doesn't work for me – keagan_callis Feb 8 at 0:44
• Did you Clear your variables? – AccidentalFourierTransform Feb 8 at 0:44
• a[t_] := -Sin[f[t]];a''[t] – cvgmt Feb 8 at 0:59
• To evaluate a''[t] requires a[t] to be defined. Since only a'[t] is defined, you would need to enter a''[t]as D[a'[t], t] – Bob Hanlon Feb 8 at 2:23

You could try the following:

b' = a;
Derivative[n_?Positive][a] := Derivative[n-1][Function[-Sin[b[#]]]]


Then:

a''[t]


-a[t] Cos[b[t]]

• Yes thank you this does work if I do Derivative[n_?Positive][b] := Derivative[n - 1][Function[a[#]]]; Derivative[n_?Positive][a] := Derivative[n - 1][Function[-Sin[b[#]]]]; – keagan_callis Feb 8 at 14:57
• Would you mind explaining what the ?Positive part and the # is for? I don't know much about mathematica. – keagan_callis Feb 8 at 15:04
• @keagan_callis [#](mathematica.stackexchange.com/a/25616/4999) is short for Slot[1], which represents the first argument to Function. Derivative operates only on functions, not expressions (one usually uses D, as in D[expr, t], to operate on expressions). – Michael E2 Feb 9 at 16:08