Differentiate that expression of E[X] wrt 'k' and find the root of the differentiated equation. That will give you the required value of 'k'. Here goes the calculation in Wolframalpha using n=10 ( I have taken an integral value, since Wolframalpha won't give the result properly otherwise. You can take a general 'n' while calculating in hand. Observe the steps here. )
k=0 solves the equation. Hence E[X] will be minimized if k=0.