Originally Posted by

**VonNemo19** When working an optimization problem, when should I consider the domain of the primary equation?

Also, when it is determined that the interval of which the variable is an element is open, do I consider the endpoints? For example. Let's say that $\displaystyle f$ is continuous on the open interval $\displaystyle (a,b)$ and has a relative maximum at$\displaystyle x=c$. But at the point $\displaystyle x=d$, with $\displaystyle a<d<b$, $\displaystyle f(d)>f(c)$. This is strange because, when I differentiate with respect to the variable and find all values for which $\displaystyle f'(x)=0$, all I get is the relative extrema, And I can't consider the endpoints because they are not in the domain. What do I do?