# Can you differentiate the length of a function?

I came across a tricky issue while setting up an optimization problem. Is it possible to differentiate $$len^2(f(x)_B)$$, the squared length of some function $$f(x)$$ under some basis $$B$$?

I know this involves summing the squares of the quantities of each element of the basis used to construct the function, but I'm not sure how to express this fact in a form that could be differentiated.

• Differentiate with respect to ... what? – MachineLearner Mar 22 '19 at 6:09
• To $x$, ultimately I want to extend the operation to two variables, but I doubt that will be much harder. – user10478 Mar 22 '19 at 6:13

$$L^2(f(x)) \implies 2L(f(x))\dfrac{dL}{df}\dfrac{df}{dx}$$
• Are you sure that is correct? Should't the length be differentiated with respect to $f$ here? – Devashsih Kaushik Mar 22 '19 at 6:22
• @MachineLearner My trouble is with the $\frac{dL}{df}$ factor. How would I expend that part? – user10478 Mar 22 '19 at 16:14