Hi Anna,
Are you intending that the u-dependence in maximum should be maintained during the solve? After doing the interpolation, there will be no symbolic record of where maximum's values came from.
That's probably not the cause of the error message though. It says that the form is not a linear form. This might mean that you accidentally included some TrialFunction (which turns it into a bilinear form) or perhaps forgot a factor of dx or dS somewhere (which stops it from being a form).
all the best
--cjc