The result of this code
var('x y p w0 g c')
assume(p>=0)
assume(p<=1)
U=function('U')(x)
EU(x,y,p)=p*U(x)+(1-p)*U(y)
show(EU(w0,g*w0-c,p))
show(diff(EU(w0,g*w0-c,p),w0))
uses $D_0(U)$ for the first order derivative of $U$. Is it possible to substitute $U^\prime$ to $D_0(U)$, to keep the path with textbook notations ?