maximum of a two variable polynomial by fixing one of them

I have a Polynomial of two variables f(x,y) . I want to find the maximum of the function for a fixed value of y that depends on y and x changes on a closed interval. basically i want to find $Max f(x,b)$ : b$ is a constant and $0 \leq x \leq 1$ ). Is there any way to do that in sage and the result be a function in y.

The polynomials are of the form $(1-x)^4 x (1-2bx+x^2)^2$ and $(1-x)^2 x (1-2bx+x^2)$ and i would like to find maximum of these polynomials with $0 \leq x \leq 1$ , in terms of $b$ or $(1-b)$ what i know about b is that it is rational number close to 1 .

The general case now.
Things become involved.
Whatever we do, these results should be obtained as particular cases.

Let us fix the mathematical notation and framework.
Since $f(0,b)=f(1,b)=0$ we expect a maximal value of the function
$x\to f(x,b)$ for $x$ between zero and one. Let $x^*(b)$ be the point where
the maximum is reached, it is a root of $f'x$.
An in this special case there is exactly one in $(0,1)$.

The maximal value is $F(x^*(b),b)$.

In order to get it, we have to eliminate $x$ in the equations:
$$ f'_x(x,b) = 0\ , $$
$$ F = f(x,b)\ .$$
This may be done as follows.
(Note that after some point $x.b$ are no longer variables, but polynomial ring transcendental generators.)

The above $G$ is morally the dependence we are searching for.
The implicit function $F=F(b)$ which solves $G(b,F(b))=0$ is the searched function.

So we only need to solve an equation of degree three in $F$ for each value of $b$.
We test this for the mentioned values $9$, $1$, $1/2$. Well, i have to go back to variables.
And i will use the poor man's copy paste via string and eval.