# Derivative of a sum

$$L(a,b) = {\sum_{i=1}^n (y^i - (ax^i +b)^2)^2})$$ $$\frac{dL}{da} = \sum_{i=1}^n \frac{(y^i-y^-)*(x^i-x^-))}{var(x)}$$

How can I canclulate the $$\frac{dL}{da}$$?

$$2(y^i - (ax^i +b))^2)* \frac{d(y^i - (ax^i +b)^2)}{da} =$$

• you should show your thought process and work of the problem May 15, 2019 at 0:32
• May I echo Eric's thoughts above. Also, you probably mean to find $\frac{\partial L}{\partial a}$? Are you familiar with the sum rule? May 15, 2019 at 0:37
• You are right. In fact, I am not used to the derivative of sums. Yes I mean the derivative of L based on a May 15, 2019 at 0:43

$$L(a,b) = {\sum_{i=1}^n (y^i - (ax^i +b)^2)^2}$$
\begin{align} \frac{\partial L}{\partial a} &= \sum_{i=1}^n 2(y^i-(ax^i+b)^2)\frac{\partial (y^i-(ax^i+b)^2)}{\partial a} \\ &= -2\sum_{i=1}^n (y^i-(ax^i+b)^2)\frac{\partial ((ax^i+b)^2)}{\partial a} \\ &=-4\sum_{i=1}^n (y^i-(ax^i+b)^2)(ax^i+b)x^i \\ \end{align}
• chain rule, $\frac{\partial v^2}{\partial a} = 2v\frac{\partial v}{\partial a}$ Jun 11, 2019 at 4:45