# Derivative of an Implicit Function

So I'm having a bit of an issue in trying to take the derivative of an implicit function. The problem I'm trying to solve is this:

f(t,y(t)) = y' = e^(t-y)


Where the original function y(t) is some function of t, so I can't just treat y as a constant. I have to find the first four derivatives of this function, but I'm a bit confused on how to do this in Mathematica. I've looked at the documentation and it's not making much sense to me.

I did the first derivative by hand, and it becomes rather apparent that it's going to be tedious. Which is:

f'(t,y(t)) = (e^(t-y))(1-e^(t-y))

• Try defining functions using square brackets. i.e. f[t_,y_]:=Exp[t-y], then you can take the derivative in the way you want i.e. D[f[t,y[t]],{t,1}] for the first derivative. Later you can then try to simplify with D[y[t],{t,1}]==Exp[t-y] Mar 14 '17 at 21:17

Since y is a function of t, y' is also a function of t, not of both t and y. When we take the derivative, though, we need to put in the t dependence explicitly. Like this,

f[t] = Exp[t - y[t]]
y''[t] = D[f[t], t]
y''[t] /. y'[t] -> f[t]


which gives

(*  E^(t - y[t])
E^(t - y[t]) (1 - y'[t])
E^(t - 2 y[t]) (-E^t + E^y[t])  *)