Let $K$ be an $n \times m$ matrix with $rank(K)=m$ and consider the pseudoinverse $K^+=(K^TK)^{-1}K^T$. What is the derivative of $K^+$ with respect to some scalar parameter $p$ (Derivative of the inverse of a matrix)?
Note: I figured out the solution but still asking the question (and adding the solution below) in case it's of interest to someone else (not sure about protocol here)
We take the derivative of $K^+=(K^TK)^{-1}K^T$ using the product rule for derivatives (see product rule for matrix functions?) and using $(K^TK)'=-(K^TK)^{-1}(K^TK)'(K^TK)^{-1} $ (see Derivative of the inverse of a matrix). I obtain, $$ (K^+)'=(K^TK)^{-1}(K^T)'-(K^TK)^{-1}(K^T)'KK^{+}-K^+K'K^+ $$ where $(.)'$ is the elementwise derivative of $(.)$ with respect to $p$.
As expected, the formula simplifies to $(K^{-1})'=-K^{-1}K'K^{-1}$ when $K$ is nonsingular.