# lagrange interpolation, polynomial of degree $2n-1$

Let $a_1, \dots, a_n$ and $b_1, \dots, b_n$ be real numbers. How would I go about showing the following?

1. If $x_1, \dots, x_n$ are distinct numbers, there is a polynomial function $f$ of degree $2n - 1$, such that $f(x_j) = f'(x_j) = 0$ for $j \neq i$, and $f(x_i) = a_i$ and $f'(x_i) = b_i$.
2. There is a polynomial function $f$ of degree $2n-1$ with $f(x_i) = a_i$ and $f'(x_i) = b_i$ for all $i$.

I have tried attacking the first part with Lagrange interpolation, not to too much success...

Clearly $f$ will have to be of the form$$f(x) = \prod_{\substack{j=1 \\ j\neq i}}^n (x- x_j)^2(ax+b)$$$($because each $x_j$, $j \neq i$ is a double root$)$. It therefore suffices to show that $a$ and $b$ can be picked so that $f(x_i) = a_i$ and $f'(x_i) = b_i$. If we write $f$ in the form $f(x) = g(x)(ax + b)$, then we must solve$$[g(x_i)x_i] \cdot a + g(x_i) \cdot b = a_i,$$$$[g'(x_i)x_i + g(x_i)] \cdot a + g'(x_i) \cdot b = b_i.$$These equations can always be solved because$$[g(x_i)x_i] \cdot g'(x_i) - [g'(x_i)x_i + g(x_i)]g(x_i) = [g(x_i)]^2 \neq 0.$$
Let $f_i$ be the function constructed as above, and let $f = \sum_{k=1}^n f_k$.