There are a number of ways you can write the piecewise function. Here is one of them:
[tex]p(t)=\left\{\begin{array}{rcl}7t&\mbox{for}&t\leq40\\10.5t-140&\mbox{for}&t>40\end{array}\right.[/tex]
It could also be something like
p(t) = 7t + 3.50×max(0, t-40)
where the max(x,y) function returns the larger of x or y.