# How to find the derivative of a dynamic neuron model, which depends on previous states of the neuron?

This is the equation where n denotes the current state, (n-1) denotes the state in the previous step etc.

$\bar{y}(n)=b_{0}*net(n)+b_1*net(n-1)+b2*net(n-2)-a1*\bar{y}(n-1)-a2*\bar{y}(n-2)$

And to do back-propagation I need to find partial derivatives over each of the variables. For now let's just focus on $\frac{\partial&space;\bar{y}(n)}{\partial&space;b_0}$

The term $\bar{y}(n-1)$ in the above equation can be written as:

$\bar{y}(n-1)=b_{0}*net(n-1)+b_1*net(n-2)+b2*net(n-3)-a1*\bar{y}(n-2)-a2*\bar{y}(n-3)$

Since it also contains $b_{0}$, it needs to be substituted into the first equation. But this is where the issue starts. I also need to then substitute $\bar{y}(n-2)$ in the equation above with this:

$\bar{y}(n-2)=b_{0}*net(n-2)+b_1*net(n-3)+b2*net(n-4)-a1*\bar{y}(n-3)-a2*\bar{y}(n-4)$

Which contains $b_{0}$, and so does $\bar{y}(n-3)$ . And I end up in a never ending loop.

So how to do this?