Quadratic spline?$f(x)=x$ when $x\in (-\infty, 1]$, $f(x)={-1\over 2}(2-x)^2+{3\over 2}$ when $x\in [1,2]$, and

947 Views Asked by At

Determine whether this is a quadratic spline $f(x)=x$ when $x\in (-\infty, 1]$, $f(x)={-1\over 2}(2-x)^2+{3\over 2}$ when $x\in [1,2]$, and $f(x)={3\over 2}$ when $x\in [2,\infty)$.

I think this is a quadratic spline since each interval is a polynomial of degree at most $2$ and each function is continuous on its domain. Is this correct? Any solutions/help is greatly appreciated?

1

There are 1 best solutions below

2
On

Besides being a polynomial (of second order) inside each interval, the function also needs to be continuous and continuously differentiable everywhere.

Define $f_1(x)\equiv x$, $f_2(x)\equiv -{1\over 2}(2-x)^2+{3\over 2}$ and $f_3\equiv {3\over 2}$.

You need to check if

$$f_1(1) = f_2(1), \;\;\; \text{and} \;\;\; f_2(2) = f_3(2) $$

to guarantee continuity, and if

$$f_1'(1) = f_2'(1), \;\;\; \text{and}\;\;\; f_2'(2) = f_3'(2) $$

to guarantee continuity of the derivative. (All these conditions are, in fact, satisfied.)