Determine the parameters a and b so that the function y =
Determine the parameters $a$ and $b$ so that the function $y = a\ln x+bx^{2}+x$ has extreme values at $x = 1$ and $x = 2$.
Explanation of Method
Two stationary conditions fix the two coefficients.
Step 1: The necessary conditions
The domain is $x\gt 0$, and
\[ y' = \frac{a}{x}+2bx+1. \tag{1} \]
If $x = 1$ and $x = 2$ are extrema then $y'$ must vanish at both: \[y'(1) = a+2b+1 = 0, \tag{2}\]
\[ y'(2) = \frac{a}{2}+4b+1 = 0. \tag{3} \]
Step 2: Solve the system
From (2), $a = -2b-1$; substituting into (3): \[\frac{-2b-1}{2}+4b+1 = -b-\frac12+4b+1 = 3b+\frac12 = 0 \;\Longrightarrow\; b = -\frac16,\]
\[ a = -2\left(-\frac16\right)-1 = \frac13-1 = -\frac23. \]
Step 3: Check that both points really are extrema
With these values, \[y' = -\frac{2}{3x}-\frac{x}{3}+1 = \frac{-2-x^{2}+3x}{3x} = \frac{-\bigl(x-1\bigr)\bigl(x-2\bigr)}{3x}. \tag{4}\]
On the domain $3x\gt 0$, so the sign of $y'$ is that of $-\bigl(x-1\bigr)\bigl(x-2\bigr)$: \[0\lt x\lt 1:\ -(-)(-) = -\ (\searrow); \qquad 1\lt x\lt 2:\ -(+)(-) = +\ (\nearrow); \qquad x\gt 2:\ -(+)(+) = -\ (\searrow).\]
So $x = 1$ is a local minimum and $x = 2$ a local maximum: \[y(1) = -\frac16+1 = \frac56, \qquad y(2) = -\frac23\ln2-\frac46+2 = \frac43-\frac{2\ln2}{3}.\]
Step 4: Verification
\[y(1) = 0.8333333 \lt y(2) = 0.8712352 \;\;\checkmark\ \text{(the minimum is below the maximum, as it must be here)}\]
\[y'(1) = \frac{-2-1+3}{3} = 0, \qquad y'(2) = \frac{-2-4+6}{6} = 0 \;\;\checkmark\]
\[y'' = \frac{2}{3x^{2}}-\frac13:\quad y''(1) = \frac13\gt 0 \ (\text{min}), \qquad y''(2) = -\frac16\lt 0 \ (\text{max}) \;\;\checkmark\]
Result
Final answer:
\[\boxed{\,a = -\frac23, \qquad b = -\frac16, \qquad y = -\frac23\ln x-\frac{x^{2}}{6}+x\,}\]
Remark
Remark. The two conditions are linear in $a$ and $b$, which is why a unique pair exists; a third prescribed extremum would in general be impossible. Note how modest the resulting hill and valley are — the two values differ by less than $0.04$ — because the roots $1$ and $2$ lie close together and the cubic-like factor $-(x-1)(x-2)$ is small between them.