[Tex/LaTex] How to get the straight vertical line next to derivatives

amsmathmath-modephysics

I am trying to get this to display:

enter image description here

My current attempt is :

\begin{equation}
\begin{align}
\frac{\dd{x_c^{*}(t,u)}}{\dd{u}}=\gamma + \alpha \lambda \{[r(t)-x(t,0)]\\
+ \frac{1}{1+\alpha\beta\lambda}[\frac{\dd{r(t)}}{\dd{t}}-\gamma]
\end{align}
\end{equation}

I have defined a macro \dd above as (uses the physics package) :

\newcommand{\dd}[1]{\mathrm{d}#1}

I couldn't find how to display that vertical line next to the derivative ( just left of the = sign ) with u=0 on it. Everything else displays fine with my code.

Best Answer

One way is to use a fake \mleft. and \mright\vert mathematical delimiter pair.

There might be better ways.

\documentclass[a4paper]{article}

\usepackage{mathtools}
\usepackage{mleftright}
\usepackage{physics}

\begin{document}


\begin{align}
 \mleft.\dfrac{\dd{x_c^{*}(t,u)}}{\dd{u}}\mright\vert_{u=0} &= \gamma + \alpha \lambda \mleft\{\mleft[r(t)-x(t,0)\mright] + \frac{1}{1+\alpha\beta\lambda}
\mleft[\frac{\dd{r(t)}}{\dd{t}}-\gamma\mright]\mright\}
\end{align}
\end{document}

enter image description here