\documentclass[tikz,margin=5pt]{standalone}

\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=newest}

\begin{document}

  \begin{tikzpicture}

    \begin{axis}[
        axis lines = center,
        xlabel = {$x_1$},
        ylabel = {$w_1$},
        xmin=-.5, xmax=5,
        ymin=-1, ymax=18,
      ]
      \draw[name    path = U, red!90] (axis cs: {-.25}, {-1}) -- (axis cs: {4.25}, {17});
      \draw[name    path = A, black] (axis cs: {-.25}, {0}) -- (axis cs: {2}, {0});
      \draw[name    path = B, green!90] (axis cs: {0.75}, {-1}) -- (axis cs: {4}, {12});
      \draw[name    path = C, blue!90]  (axis cs: {2.5}, {4}) -- (axis cs: {4.25}, {18});
      \addplot[brown!60,samples=100, domain=0:4, no markers, solid, smooth] ({x}, {x^2});
      \addplot[teal!10,opacity=20] fill between [of = U and A, soft clip={domain=0:1}];
      \addplot[teal!10,opacity=20] fill between [of = U and B, soft clip={domain=1:3}];
      \addplot[teal!10,opacity=20] fill between [of = U and C, soft clip={domain=3:4}];
    \end{axis}
  \end{tikzpicture}
\end{document}
