Did I Compute the Partial Derivative Correctly to Minimize This Function?

Click For Summary

Discussion Overview

The discussion revolves around the computation of the partial derivative of a function, specifically aimed at minimizing it with respect to a variable, ##a_n##. Participants explore the mathematical steps involved in the differentiation process, addressing potential issues and clarifications in their calculations.

Discussion Character

  • Mathematical reasoning
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant presents a detailed computation of the partial derivative of the function ##\varphi(x, y)## with respect to ##a_n##, seeking verification of their steps.
  • Another participant questions whether the change of summation indices from ##n## to ##m## is necessary, suggesting that the ranges of ##m## and ##n## are the same.
  • A participant expresses uncertainty about their understanding of the differentiation process, specifically regarding the implications of the summation indices.
  • Clarifications are made regarding the computation of the partial derivative, with one participant confirming that the derivative with respect to ##a_1## follows a specific form.
  • Further discussion includes the implications of treating the variables ##n## and ##\lambda## as independent, with one participant confirming this independence.
  • Participants engage in refining their understanding of the mathematical expressions and the implications of their calculations on the minimization process.

Areas of Agreement / Disagreement

Participants express varying levels of confidence in their computations, with some agreeing on the independence of variables while others remain uncertain about the necessity of changing summation indices. The discussion reflects multiple viewpoints on the correctness of the differentiation steps and the implications for minimizing the function.

Contextual Notes

Some participants highlight potential confusion regarding the summation indices and their implications in the differentiation process. There is also an acknowledgment of the need to compute partial derivatives for multiple variables to fully address the minimization problem.

ecastro
Messages
249
Reaction score
8
I tried calculating the partial derivative of

##\varphi\left(x, y\right) = \sum_\lambda\left\{H\left(\lambda\right) \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2\right\}##

with respect to ##a_n## and equating it to zero to minimise the function (please check my computation).

\begin{eqnarray*}
\frac{\partial \varphi\left(x, y\right)}{\partial a_n} &=& \frac{\partial}{\partial a_n} \sum_\lambda\left\{H\left(\lambda\right) \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2\right\} \\
&=& \sum_\lambda \frac{\partial}{\partial a_n} \left\{H\left(\lambda\right) \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2\right\} \\
&=& \sum_\lambda H\left(\lambda\right) \frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2 + \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2 \frac{\partial}{\partial a_n} H\left(\lambda\right)
\end{eqnarray*}

Since ##H\left(\lambda\right)## is not a function of ##a_n##, its partial derivative is zero, and thus the second term vanishes. For the partial differentiation in the first term

\begin{eqnarray*}
\frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2 &=& 2\left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] \times \frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right].
\end{eqnarray*}

The second term of the previous equation is

\begin{eqnarray*}
\frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] &=& \frac{\partial}{\partial a_n} C_E\left(\lambda; x, y\right) + \frac{\partial}{\partial a_n} \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)
\end{eqnarray*}

The first term is not a function of ##a_n##, thus it also vanishes, while the second term is

\begin{eqnarray*}
\frac{\partial}{\partial a_n} \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) &=& \sum_n \left[\frac{\partial}{\partial a_n} a_n\left(x, y\right) e_n\left(\lambda\right)\right] \\
&=& \sum_n \left[a_n\left(x, y\right)\frac{\partial}{\partial a_n} e_n\left(\lambda\right) + e_n\left(\lambda\right) \frac{\partial}{\partial a_n} a_n\left(x, y\right)\right] \\
&=& \sum_n e_n\left(\lambda\right)
\end{eqnarray*}

Plugging-in everything back,

\begin{eqnarray*}
\frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] &=& \sum_n e_n\left(\lambda\right) \\
\frac{\partial}{\partial a_n} \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]^2 &=& 2\left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] \times \sum_n e_n\left(\lambda\right) \\
\frac{\partial \varphi\left(x, y\right)}{\partial a_n} &=& \sum_\lambda H\left(\lambda\right) \times 2\left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] \times \sum_m e_m\left(\lambda\right) \\
&=& \sum_\lambda \left[2 H\left(\lambda\right) C_E\left(\lambda; x, y\right) \sum_m e_m\left(\lambda\right) + 2 H\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) \sum_m e_m\left(\lambda\right)\right]
\end{eqnarray*}

Note that I changed the last summation from ##n## to ##m## to avoid confusion with the other summation.

From here, I need to equate it to zero to minimise the function and solve for ##a_n##, but I don't know how.
 
Physics news on Phys.org
ecastro said:
Note that I changed the last summation from n to m to avoid confusion with the other summation.
Is that implied in the previous steps as well, or do you want to calculate the derivative with respect to the last element? Either way, the sum should go away, assuming
$$\frac \partial {\partial a_k} a_m \neq 1$$ in general.
 
I actually don't know what I am doing... Sorry.

The range of values of ##m## and ##n## are the same, so is it unnecessary to change the variables?

I also just thought of that the partial derivative goes from every value of ##a_n##. So, the partial derivative goes as ##\frac{\partial}{\partial a_1}##, then ##\frac{\partial}{\partial a_2}##, and so on.

mfb said:
Either way, the sum should go away,

Yes, I thought so too. Then, correcting my computation for ##n = 1## as an example,

\begin{equation*}
\frac{\partial}{\partial a_1} \sum_{n = 1}^{+\infty} a_n\left(x, y\right) e_n\left(\lambda\right) = e_1\left(\lambda\right).
\end{equation*}

Is this correct?
 
Right.

And it is useful to have separate names (n, m) everywhere.
 
Thank you. The partial derivative of the function with respect to ##a_1## as an example is

\begin{eqnarray*}
\frac{\partial \varphi\left(x, y\right)}{\partial a_1} &=& \sum_\lambda H\left(\lambda\right) \left\{2 \left[C_E\left(\lambda; x, y\right) + \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] \cdot e_1 \left(\lambda\right) \right\} \\
&=& \sum_\lambda \left[2 H\left(\lambda\right) C_E\left(\lambda; x, y\right) e_1\left(\lambda\right) + 2 H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right]
\end{eqnarray*}

And equating this to zero to minimise it,

\begin{eqnarray*}
\sum_\lambda \left[2 H\left(\lambda\right) C_E\left(\lambda; x, y\right) e_1\left(\lambda\right) + 2 H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)\right] &=& 0 \\
\sum_\lambda 2 H\left(\lambda\right) C_E\left(\lambda; x, y\right) e_1\left(\lambda\right) + \sum_\lambda 2 H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) &=& 0 \\
\sum_\lambda 2 H\left(\lambda\right) C_E\left(\lambda; x, y\right) e_1\left(\lambda\right) &=& - \sum_\lambda 2 H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) \\
\sum_\lambda H\left(\lambda\right) C_E\left(\lambda; x, y\right) e_1\left(\lambda\right) &=& - \sum_\lambda H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right)
\end{eqnarray*}

The missing variable here are the ##a_n## which I can solve by taking the partial derivate of ##\varphi \left(x, y\right)## with respect to ##a_2##, ##a_3##, and so on. I wonder if this is possible on the right-hand side of the previous equation:

\begin{eqnarray*}
- \sum_\lambda H\left(\lambda\right) e_1\left(\lambda\right) \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) &=& - \sum_\lambda \sum_n a_n\left(x, y\right) e_n\left(\lambda\right) H\left(\lambda\right) e_1\left(\lambda\right) \\
&=& - \sum_n \sum_\lambda a_n\left(x, y\right) e_n\left(\lambda\right) H\left(\lambda\right) e_1\left(\lambda\right) \\
&=& - \sum_n a_n\left(x, y\right) \sum_\lambda e_n\left(\lambda\right) H\left(\lambda\right) e_1\left(\lambda\right)
\end{eqnarray*}
 
If n does not depend on ##\lambda##, that is fine.
 
Alright. As far as I know, ##n## and ##\lambda## are independent from each other. Thank you for your help.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K