Let $f$ be a continuous real valued function on the compact interval $[a,b]$. Given $\epsilon > 0$, show that there is a polynomial $p$ such that:
$p(a)=f(a)$,
$p'(a)=0$
and $|p(x) - f(x)| < \epsilon$
This is a question I came across in Pugh's Real Mathematical Analysis.
Is this not a simple application of the Weierstrass Approximation Theorem and the fact that the set of polynomials is dense in $C^0([a, b], \mathbb{R})$.
Density means that for each $f \in C^0$ and each $\epsilon > 0$ there is a polynomial function $p(x)$ such that for all $x \in [a, b]$,
$|f(x) − p(x)| < \epsilon$. So the third property being asked is immediately satisfied.
Is this correct?
But how does this imply that $p(a)=f(a)$ and $p'(a)=0$?
Am I misreading the question or not understanding it at all? Any tips or clarifications would be greatly appreciated.
$\mathbf{Edit:} \mathbf{ Attempted} \mathbf{ Solution}$
$f(x)$ is a continuous function on the compact interval $[a,b]$.
By the Weierstrass Approximation Theorem we can find a polynomial $q(x)$ such that:
$|f(x)-q(x)|<\epsilon/2$
So, let $p(x)=q(x)-q(a) +f(a)$, then $p(a)=f(a)$
Given $\epsilon > 0$,
define $q(x) = (\frac{b-a}{n}$)$(\frac{x-a}{b-a})^n$ for large $n$
Then,
$q'(x)=(\frac{x-a}{b-a})^{n-1}$ so $q'(a)= 0$ and thus $p'(a)=0$
Finally,
$|p(x) - f(x)| < |q(x) - f(x)| + |q(a)-f(a)|$
$|p(x) - f(x)| < \epsilon/2 + \epsilon/2$
$|p(x) - f(x)| < \epsilon$
Is this a reasonable solution? Thank you kindly.