\catcode`@=11%
\newgray{ltg}{0.85}%
\def\formulaf{% formula for y = -1/2 x^2 + 3x
  -1 2 div x x mul mul 3 x mul add}%
\def\formulak{% formula for y = 1/2 x
  1 2 div x mul}%
\VDDdef O(0,0)X(1,0)Y(0,1) % OX and OY are unit vectors
\VDDdef W(-1,-1)W'(7,5) % W and W' determine the window
\VDDdeflinepoint x:OX % x-axis
\VDDdeflinepoint y:OY % y-axis
\VDDdcanvas1:1
  % first draw the areas, for that we use pscustoms
  % all the other stuff is drawn on top of this
  \pscustom[linetype=1,fillstyle=solid,fillcolor=ltg,linestyle=none]{%
    \psplot[plotpoints=2]{0}{5}{\formulak}%
    \psplot[plotpoints=100]{5}{6}{\formulaf}%
    \psline(6,0)(0,0)
  }%
  \pscustom[linetype=1,fillstyle=solid,fillcolor=gray,linestyle=none]{%
    \psplot[plotpoints=100]{0}{5}{\formulaf}%
    \psplot[plotpoints=2]{5}{0}{\formulak}%
  }%
  \rput(2.5,2.5){$W$}\rput(4.5,1){$V$}\rput(7.5,4){$k$}%
  \rput(4,4.5){$f$}%
  \VDDdwholeline xy
  \VDDdpoint XY
  \VDDllinepointany x:X:W':1:$1$
  \VDDllinepointany y:Y:W':1:$1$
  \VDDllinelinepointletter xy:OW':1:-1 % label O wrt W'
  \VDDllineedgeletter x:W':1:1 % label x axis wrt W'
  \VDDllineedgeletter y:W':-1:1 % label y axis wrt W'
  \psplot[plotpoints=400]{-1}{7}{\formulaf}%
  \psplot[plotpoints=2]{-2}{8}{\formulak}%
\VDDdcanvasend
