# Matrix by matrix by vector partial derivative for backpropagation

I am having problems with implementing back propagation of this...

Let $$O,P \in R^{K \times K}$$ and $$x \in R^K$$.

I have this operation $$y:= OPx$$

How can I find $$\frac{\partial y}{\partial P}$$?

If I decompose $$y$$ into: $$q := Px$$ $$y := Oq$$

I know that $$\frac{\partial y}{\partial P} = \frac{\partial y}{\partial q} \frac{\partial q}{\partial P}$$ and $$\frac{\partial q}{\partial p} = x$$ but by trial and error I know that $$\frac{\partial y}{\partial q} \neq O$$

So how can I solve the optimization for $$P$$?