In my research in calculus of variations, I wish to take a derivative of the following seemingly complicated expression:
$\mathcal{L}(q(y|z))$= $ \sum_{z} ({\sum_y {|p(y|z)-q(y|z)|} })^2 $
Where $ q(y|z) $ is a variable function and $ p(y|z) $ is a constant function.
*** Comment: $ p(y|z),q(y|z) $ are conditional probability distributions
I wish to take the variational derivative with respect to a probability distribution $q(y|z)$, which is the one appearing in the above sum, meaning $ \frac{\delta\mathcal{L}}{\delta q(y|z)} = ? $
What is giving me trouble is the square that appears here, hence I need help in differentiating $ \mathcal{L} $ with respect to $ q(y|z) $. I would appreciate all help on this.