Find value of real number $k$ such that $\int_0^1{|x^2-k^2|}\,dx$ is minimized I reasoned that |$k$| $< 1$ to get the minimum value of the integral. Then I simply split the integral from $[0,k]$ and $[k,1]$, resulting in a function in terms of $k$, which I then minimized to get $k = \frac{1}{2}$.
Can anybody confirm if my answer is correct/incorrect? I found this problem from the Youngstown State University Calculus Competition (year 2000), but was unable to find any provided solution.
 A: Yes, you are correct. 
This works in the general case : find $m$ that minimizes the integral 
$$\int_I | f(x) - m| $$
The solution $m$ is the median, a value so for exactly half the values of $x$ we have $f(x) \le m$ ( almost exact definition). In particular, if your function $f$ is monotone then $m$ is the value of $f$ in the middle of the interval. 
Compare this with the average 
$$M = \frac{ \int_I f} {|I|}$$
which minimizes 
$$\int_I |f(x) -M|^2$$
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
Lets $\ds{\fermi\pars{k} \equiv \int_{0}^{1}\verts{x^{2} - k^{2}}\,\dd x}$. Then,
\begin{align}
\fermi\pars{k}&=\verts{1 - k^{2}}
-\int_{0}^{1}x\sgn\pars{x^{2} - k^{2}}\pars{2x}\,\dd x
\\[5mm]&=\verts{1 - k^{2}} - {2 \over 3}\,\sgn\pars{1 - k^{2}}
+\int_{0}^{1}{2 \over 3}\,x^{3}\bracks{2\delta\pars{x^{2} - k^{2}}\pars{2x}}\,\dd x
\\[5mm]&=\verts{1 - k^{2}}  - {2 \over 3}\,\sgn\pars{1 - k^{2}}
+{8 \over 3}\,k^{4}\int_{0}^{1}{\delta\pars{x - \verts{k}} \over 2\verts{k}}\,\dd x
\\[5mm]&=\verts{1 - k^{2}}  - {2 \over 3}\,\sgn\pars{1 - k^{2}}
+{4 \over 3}\,\verts{k}^{3}\,\Theta\pars{1 - \verts{k}}
\\[5mm]&=\color{#66f}{\large\left\{\begin{array}{lcl}
{4 \over 3}\,\verts{k}^{3} - k^{2} + {1 \over 3} & \mbox{if} & \verts{k} < 1
\\[2mm]
k^{2} - {1 \over 3} & \mbox{if} & \verts{k} > 1
\end{array}\right.}
\end{align}

