# Partial derivative form question

It's my understanding the partial derivative can take the following form:

Where $$y_0$$ is held constant as a plane slicing and $$x_0$$ is the point where the derivative is taken with respect to $$x$$.

I'm confused by the following notation in a Rojas AI book: In the third paragraph the partial derivative is taken with respect to $$a_i$$. I'm confused how this derivative is taken. I'm also confused also why $$f_i$$ is used when it is not part of the derivative of $$x^2$$. Can anyone provide guidance here?

The variables $$x_1,\cdots x_m$$ are integration variables that disappear after the integration on the given volume.

So the function $$E$$ is a function of the variable parameters $$a_i$$ and can be differentiatd with respect to these variables. Using the Leibniz's rule for differentiation under the integral sign the derivative can be calculated as : $$\frac{dE}{da_i}=\int_V \frac{\partial}{\partial a_i}F(a_i,x_j) dV$$

where $$F(a_i,x_j)=(f-(a_1f_1+a_2f_2+\cdots a_nf_n))^2$$

so: $$\frac{\partial F}{\partial a_1}=-2(f-(a_1f_1+a_2f_2+\cdots a_nf_n)) \cdot f_1$$ $$\frac{\partial F}{\partial a_2}=-2(f-(a_1f_1+a_2f_2+\cdots a_nf_n)) \cdot f_2$$

etc....

Maybe you are confused by the notation. The situation is as for function

$$F(x_1,x_2,y_1,y_2)= (f(x_1,x_2)-y_1f_1(x_1,x_2)-y_2f_2(x_1,x_2))^2$$

the derivative with respect to $$y_i$$ ( that is your $$a_i$$ ) can be evaluated considering the functions $$f_i$$ as constants, because there are not dependent form $$y_i$$, so, using the chain rule we have: $$\frac{\partial F}{\partial y_i}=$$ $$= 2(f(x_1,x_2)-y_1f_1(x_1,x_2)-y_2f_2(x_1,x_2)) \cdot \frac{\partial }{\partial y_i}(f(x_1,x_2)-y_1f_1(x_1,x_2)-y_2f_2(x_1,x_2))=$$ $$=2(f(x_1,x_2)-y_1f_1(x_1,x_2)-y_2f_2(x_1,x_2))(-f_i(x_1,x_2))$$

• where is $f_1$, $f_2$ coming from? – Nick Mar 2 '20 at 7:19
• $f_i$ is the ''coefficient'' of $a_i$. – Emilio Novati Mar 2 '20 at 9:18
• i'm still confused why the coefficient of $a_i$ is in the product after taking the derivative with respect to $a_1$. Am I missing something? – Nick Mar 2 '20 at 19:11
• I added to my answer. I hope it's useful :) – Emilio Novati Mar 2 '20 at 21:27
• I was missing the chain rule! Thanks – Nick Mar 3 '20 at 2:05

Maybe it's easier to see if we take a finite number of functions to expand upon. Let's say we take $$3$$ such functions $$f_1, f_2, f_3$$ and proceed to calculate the quadratic error as

$$E = \int_{V}(f-(a_1f_1+a_2f_2+a_3f_3))^2dV$$

Now we want to minimize the error, and so we calculate the derivative with respect to the expansion coefficients. For the first one

$$\frac{dE}{da_1} = \frac{d}{d a_1}\int_V(f-a_1f_1-a_2f_2-a_3f_3)^2dV = \int_V\frac{\partial}{\partial a_1}(f-a_1f_1-a_2f_2-a_3f_3)^2dV$$

so we just need to evaluate the partial derivative of the quantity in parenthesis. This is just the same as calculating the derivative of composite function like

$$\frac{d}{dt}g^2(t) = \color{red}{2}\color{green}{g(t)}\color{orange}{\frac{dg}{dt}}$$

and so

$$\frac{\partial}{\partial a_1}\overbrace{(f-a_1f_1-a_2f_2-a_3f_3)^2}^{g^2(a_1,a_2,a_3)} = \color{red}{2}\color{green}{(f-a_1f_1-a_2f_2-a_3f_3)}\color{orange}{\left[\frac{\partial}{\partial a_1}(f-a_1f_1-a_2f_2-a_3f_3)\right]}$$

We have to find the orange part which is the partial derivative wrt $$a_1$$ of the, no more squared, function. To make it easier I'll write it in the following manner, choosing

$$x = a_1f_1\qquad y=a_2f_2\qquad z=a_3f_3$$

this means that (remember that for the partial derivative, the $$f_i$$ are just coefficients, even though they are in practise functions)

$$f_1\frac{\partial}{\partial x} = f_1\frac{\partial}{f_1 \partial a_1} = \frac{\partial}{\partial a_1}$$

so that we can write the orange part as

$$\frac{\partial}{\partial a_1}(f-a_1f_1-a_2f_2-a_3f_3) = f_1\frac{\partial}{\partial x}(f-x-y-z) = -f_1$$

In the end what we get is

$$\frac{\partial}{\partial a_1}(f-a_1f_1-a_2f_2-a_3f_3)^2 = 2(f-a_1f_1-a_2f_2-a_3f_3)(-f_1) = -2f_1(f-a_1f_1-a_2f_2-a_3f_3)$$

You can do it by yourself for the other two coefficients and convince yourself that the result, indipendently of how many functions you expand on, the general result is given by

$$\frac{\partial}{\partial a_i}(f-a_1f_1-a_2f_2-a_3f_3-\cdots -a_nf_n)^2 = -2f_i(f-a_1f_1-a_2f_2-a_3f_3-\cdots -a_nf_n)$$

• I'm confused why $f_i$ in the final solution is appearing. Perhaps I'm overlooking something – Nick Mar 2 '20 at 7:18
• @Nick I'll add a explanation to my answer – Davide Morgante Mar 2 '20 at 8:26

If you differentiate

$$(p+qx+ry)^2$$ on $$q$$, you get $$2x(p+qx+ry).$$

Now consider $$p\leftrightarrow f$$, $$q\leftrightarrow-a_1$$, $$r\leftrightarrow-a_2$$, $$x\leftrightarrow f_1$$ and $$y\leftrightarrow f_2$$.