# How do I change the text color for a part of an equation after a pause in beamer?

I want this in the same frame, not a different frame. Here is an example of what I'd like:

\documentclass[mathserif]{beamer}
\usetheme{Copenhagen}
\usepackage{color,xcolor,ucs}
\usepackage{beamerthemesplit}
\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb,setspace,mathtools}
\begin{document}
\section{Introduction}
\frame{\frametitle{NPDE}
\begin{itemize}
\pause
\item item 1 here
\pause
\item item 2 here
\pause
\begin{equation*}
\frac{\partial u}{\partial t}= {\color{red}u(n,t)}u(n+1,t) -u(n,t)u(n-1,t)
\end{equation*}
%then I want this on the next click:
\pause
$$\notag \frac{\partial u}{\partial t}=u(n,t){\color{red}u(n+1,t)}-u(n,t)u(n-1,t)$$
\end{itemize}
}
\end{document}

-
But if you want the second part "on the next click", it will be on a different slide; perhaps you meant "I want this in the same frame, not a different frame"? – Gonzalo Medina Jul 22 '12 at 17:36

You can use the \only overlay specification:

\documentclass[mathserif]{beamer}
\usetheme{Copenhagen}
\usepackage{color,xcolor,ucs}
\usepackage{beamerthemesplit}
\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb,setspace,mathtools}
\begin{document}
\section{Introduction}
\frame{\frametitle{NPDE}
\begin{itemize}
\pause
\item item 1 here
\pause
\item item 2 here
\pause
\begin{equation*}
\frac{\partial u}{\partial t}= \only<4>{\textcolor{red}{u(n,t)}u(n+1,t)}\only<5>{u(n,t)\textcolor{red}{u(n+1,t)}} -u(n,t)u(n-1,t)
\end{equation*}
\end{itemize}
}
\end{document}


And here are the fourth and fifth slides showing the relevant equation:

-
YES!! thank you Gonzalo!! and yes I meant the same frame (I'm still new to latex, but thank you!) – norma Jul 22 '12 at 17:46
Adapting Gonzalo's suggestion, you could also define a command before \begin{document}, such as: \newcommand<>{\colorize}[4]{\only<#1>{#4}\only<#2>{\textcolor{#3}{#4}}} and use it as \colorize{4}{1-3,5-}{red}{u(n,t)} – anderstood Oct 1 '13 at 12:27