A stock price goes

* from US 10 to US 12 from January 1st to January 31,
* from US 12 to US 9 from February 1st to February 28th,
* from US 9 to US 15 from March 1st to March 31st

And the graph looks like this:

[![enter image description here](https://i.stack.imgur.com/9ezHj.png)](https://i.stack.imgur.com/9ezHj.png)

After I find out each function, I got these results.

$$\begin{align}
f(x) &=\phantom{-}\frac1{15}x+10 \\[4pt]
g(x) &=-\frac19x+12 \\[4pt]
h(x) &=\phantom{-}\frac15x+9
\end{align}$$

After I sketch on graph, the results turn out as expected.

$$\begin{align}
f(x) &=\phantom{-}\frac1{15}x+10\qquad\{\;1\leq x\leq31\} \\
g(x) &=-\frac19x+12\qquad\{31\leq x\leq59\}\\
h(x) &=\phantom{-}\frac15x+9\qquad\{59\leq x\leq90\}
\end{align}$$

[![enter image description here](https://i.stack.imgur.com/bQLJE.png)](https://i.stack.imgur.com/bQLJE.png)

What went wrong?