Minimzing a function by lm in R

Are you working on a homework problem?