I would like to know how to find the partial derivatives of the following function please.

$$ E(a,b)=\sum_{i=1}^n(y_i-(a+bx_i))^2\tag1 $$

I believe that I should get two results

$$ \frac{\partial{E}}{\partial{a}} \text{and }\frac{\partial{E}}{\partial{b}}\tag2$$

and that when finding a partial derivative I can treat all other variables as constants. But, I am unsure as to how to treat both the summation and the fact that it is all squared.

If there are rules you use in your derivation, could you state the names please? Many thanks.

  • 1
    $\begingroup$ Yes, you treat the other variables as constants. The rules you need are linearity of the derivative and the chain rule. $\endgroup$ – J.R. Apr 11 '14 at 11:52

The derivative of a sum is a the sum of derivatives.

The derivative of $\frac{\partial (y_i-a-bx_i)^2}{\partial a}=2(y_i-a-bx_i)(-1)$

and $\frac{\partial (y_i-a-bx_i)^2}{\partial b}=2(y_i-a-bx_i)(-x_i)$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.