# Consider the function f(\mu)=\sum_{i=1}(x_{i}-\mu)^{2}, where x_[i}=i,\ i=1,\ 2,\ \cdots,\ n What is the

Consider the function
$$\displaystyle{f{{\left(\mu\right)}}}=\sum_{{{i}={1}}}{\left({x}_{{{i}}}-\mu\right)}^{{{2}}},$$ where
$$\displaystyle{x}_{{{i}}}={i},\ {i}={1},\ {2},\ \cdots,\ {n}$$
What is the first and second derivative os $$\displaystyle{f{{\left(\mu\right)}}}$$?

• Questions are typically answered in as fast as 30 minutes

### Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Janet Young
Step 1
$$\displaystyle{\frac{{{d}}}{{{d}\mu}}}{f{{\left(\mu\right)}}}=-{2}{\sum_{{{i}={1}}}^{{{n}}}}{\left({x}_{{{1}}}-\mu\right)}=-{2}{\sum_{{{i}={1}}}^{{{n}}}}{x}_{{{i}}}+{2}{n}\mu$$
$$\displaystyle{\frac{{{d}^{{{2}}}}}{{{d}\mu^{{{2}}}}}}{f{{\left(\mu\right)}}}={2}{n}$$
In the 1st step on line 1, the chain rule is applied. The term within the brackets is differentiated, producing a -1.
Then the bracket itself is differentiated, producing the 2 at the front. The 2nd step on line 1 involves no differentiation. Instead, the bracket is split into two terms.
The second term has an n because it is simply the summation from $$\displaystyle{i}={1}$$ to $$\displaystyle{i}={n}$$ of a constant.
The summation of a constant is equal to n multiplied by the constant. Then for the second line, there are no extra rules.
The first term becomes 0 because it's a constant and the second term loses $$\displaystyle\mu$$.
###### Not exactly what youâ€™re looking for?
accimaroyalde
Step 1
Adding an answer here to further clarify the other ones which are simply answers without steps. To get the first derivative, this can be re-written as:
$$\displaystyle{\frac{{{d}}}{{{d}\mu}}}{s}{u}{n}{\left({x}-\mu\right)}^{{{2}}}$$
$$\displaystyle=\sum{\frac{{{d}}}{{{d}\mu}}}{\left({x}-\mu\right)}^{{{2}}}$$
After that it's standard fare chain rule
$$\displaystyle=\sum-{1}\times{2}{\left({x}-\mu\right)}$$
$$\displaystyle=-{2}\sum{\left({x}-\mu\right)}$$
Second derivative: you can observe the same property of linear summation:
$$\displaystyle{\frac{{{d}}}{{{d}\mu}}}-{2}\sum{\left({x}-\mu\right)}$$
$$\displaystyle=-{2}\sum{\frac{{{d}}}{{{d}\mu}}}{\left({x}-\mu\right)}$$
$$\displaystyle=-{2}\sum{\left(-{1}\right)}$$
$$\displaystyle={2}{n}$$
nick1337

Step 1
Here we have one function $$(x_{i}-\mu)$$ that is part of a larger function in that it is raised to a power of 2, $$(\mu-i)^{2}$$
According to the extended power rule, we multiply the derivative of the outer function
$$(\mu-i)^{2}x$$
the derivative of the inner function $$(x_{i}-\mu)$$
The derivative of the outer function brings the 2 down in front as
$$2\times(x_{i}-\mu)$$
and the derivative of the inner function
$$(x_{i}-\mu)$$ is -1.
So the -2 comes from multiplying the two derivatives according to the extend power rule:
$$2\times(x_{i}-\mu)\times-1=-2(x_{i}-\mu)$$
$$f'(\mu)=-2\sum_{i=1}^{n}(x_{i}-\mu)$$ and $$f''(\mu)=2n$$