Intermediate Value theorem inequality problem Let $h:[0,1]\rightarrow \mathbb{R}$ be continuous. Prove that there exists $w\in[0,1]$ such that $$h(w)=\frac{w+1}{2}h(0)+\frac{2w+2}{9}h\left(\frac{1}{2}\right)+\frac{w+1}{12}h(1).$$
I tried several things with this problem. I first tried a new function
\begin{align*}
g(x)&=h(x)-\frac{x+1}{2}h(0)+\frac{2x+2}{9}h\left(\frac{1}{2}\right)+\frac{x+1}{12}h(1)\\
&=h(x)-(x+1)\left(\frac{1}{2}h(0)+\frac{2}{9}h\left(\frac{1}{2}\right)+\frac{1}{12}h(1)\right).
\end{align*}
Evaluating $g(0)$ and $g(1)$ didn't really work. 
Since I want to find a point $x_0$ where $g(x_0)>0$ and another $x_1$ where $g(x_1)<0$, I started thinking how I can make $g(x_0)>0$,or $$h(x_0)-(x_0+1)\left(\frac{1}{2}h(0)+\frac{2}{9}h\left(\frac{1}{2}\right)+\frac{1}{12}h(1)\right)>0,$$
or$$\frac{h(x_0)}{x_0+1}>\frac{1}{2}h(0)+\frac{2}{9}h\left(\frac{1}{2}\right)+\frac{1}{12}h(1).$$
Since the LHS is the gradient from the point $(-1,0)$ to $(x_0,h(x_0))$, I need to somehow prove that that $$\frac{1}{2}h(0)+\frac{2}{9}h\left(\frac{1}{2}\right)+\frac{1}{12}h(1)$$ is always less than the steepest gradient from $(-1,0)$ to $(x_0,h(x_0))$. However, I am stuck here. Any help?
 A: After suffering with this problem more than 3 hours here is the solution. 
For the sake of simplicity, we will call $H=\frac{1}{2}h(0)+\frac{2}{9}h(\frac{1}{2})+\frac{1}{12}h(1)$.
As in my question, we let $g(x)=h(x)-H(x+1)$. Now evaluate $g(0),g(\frac{1}{2}),g(1)$ to get the system:
$$g(0)=h(0)-H $$
$$g(\frac{1}{2})=h(\frac{1}{2})-\frac{3}{2}H$$
$$g(1)=h(1)-2H$$
Now if any of those evaluates to zero, then we are done and we found our $w$. However if none of them are zero, then we will show by contradiction that at least two of them must have opposite signs. 
Assume for the sake of contradiction that all the three $g(0),g(\frac{1}{2}),g(1)$ are of the same sign. Without loss of generality assume they are positive. Then we have:
$$g(0)>0 \Rightarrow h(0)>H $$
$$g(\frac{1}{2})>0 \Rightarrow h(\frac{1}{2})>\frac{3}{2}H$$
$$g(1)>0 \Rightarrow h(1)>2H$$
And hence we have 
$$H=\frac{1}{2}h(0)+\frac{2}{9}h(\frac{1}{2})+\frac{1}{12}h(1)>\frac{1}{2}H+\frac{1}{3}H+\frac{1}{6}H=H$$ or $H>H$  which is a clear contradiction, hence at least two of the three $g(0),g(\frac{1}{2}),g(1)$ must have a different sign. Suppose they are $g(a),g(b),a\neq b, a,b\in\{0,\frac{1}{2},1\},g(a)<0,g(b)>0$. Then by the intermediate value theorem, there is a $c\in(a,b)$ such that $g(c)=0$.
A: Let $g:[0,1]\rightarrow \mathbb{R}$ be defined by
$$
g(w)=h(w) - \left(\frac{w+1}{2}h(0)+\frac{2w+2}{9}h\left({\small{\frac{1}{2}}}\right)+\frac{w+1}{12}h(1)\right)
$$
It suffices to show that $g(0),g(1/2),g(1)$ cannot all be positive, and cannot all be negative.$\\[9pt]$
\begin{align*}
\text{Let}\;\, a &= h(0),\;b=h(1/2),\;c=h(1)\\[9pt]
\text{Then}\;\,g(0) &= h(0) - \left(\frac{1}{2}h(0)+\frac{2}{9}h\left({\small{\frac{1}{2}}}\right)+\frac{1}{12}h(1)\right)\\[0pt]
&=a - \left(\frac{1}{2}a+\frac{2}{9}b+\frac{1}{12}c\right)\\[0pt]
&=\frac{1}{2}a-\frac{2}{9}b-\frac{1}{12}c\\[9pt]
g\left({\small{\frac{1}{2}}}\right) &= h\left({\small{\frac{1}{2}}}\right) - \left(\frac{3}{4}h(0)+\frac{1}{3}h\left({\small{\frac{1}{2}}}\right)+\frac{1}{8}h(1)\right)\\[0pt]
&=b - \left(\frac{3}{4}a+\frac{1}{3}b+\frac{1}{8}c\right)\\[0pt]
&=-\frac{3}{4}a+\frac{2}{3}b-\frac{1}{8}c\\[9pt]
g(1) &= h(1) - \left(h(0)+\frac{4}{9}h\left({\small{\frac{1}{2}}}\right)+\frac{1}{6}h(1)\right)\\[0pt]
&=c - \left(\frac{1}{2}a+\frac{2}{9}b+\frac{1}{12}c\right)\\[0pt]
&=-a-\frac{4}{9}b+\frac{5}{6}c\\[9pt]
\text{Let}\;\,{\mathbf u} &= \langle g(0),g(1/2),g(1) \rangle\\[4pt]
{\mathbf v} &= \langle 18,8,3 \rangle\\[9pt]
\text{Then}\;\,
{\mathbf u}
\cdot
{\mathbf v}
&=
\langle g(0),g(1/2),g(1) \rangle
\cdot
\langle 18,8,3 \rangle\\[6pt]
&=
(18)g(0)
+
(8)g(1/2)
+
(3)g(1)
\\[4pt]
&=
(18)\left(\frac{1}{2}a-\frac{2}{9}b-\frac{1}{12}c\right)
+
(8)\left(-\frac{3}{4}a+\frac{2}{3}b-\frac{1}{8}c\right)
+
(3)\left(-a-\frac{4}{9}b+\frac{5}{6}c\right)
\\[4pt]
&=0\qquad\text{[identically]}
\end{align*}
It follows that $g(0),g(1/2),g(1)$ cannot all be positive, and cannot all be negative, as was to be shown.
