# Numbering specific lines in align environment

I want to number specific lines of an equation in the align environment. I've seen how to use gather instead of align here, but putting \usepackage[fleqn]{amsmath} in the preamble messes with the other equations in the document.

\documentclass[11pt,a4paper,openright]{book}
\usepackage[latin1]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage[left=1.00in, right=1.00in, top=1.00in, bottom=1.20in]{geometry}

\begin{document}

For any test function $\phi\in\mathcal{D}$,
\begin{align}
\langle f'(t),\phi(t) \rangle &= \int_{-\infty}^{\infty} f'(t)\phi(t) \mathrm{d}t \\
&= [f(t)\phi(t)]_{-\infty}^\infty - \int_{-\infty}^{\infty} f(t)\phi'(t) \mathrm{d}t \\ \nonumber
&= -\langle f(t),\phi'(t) \rangle
\end{align}

\end{document}


I want to number the first and third lines, not the first and second.

-
Your \nonumber should be before the \\ that ends the second line. –  Werner Jul 15 at 20:48
Yay! Care to submit this as an answer below? –  Medulla Oblongata Jul 15 at 20:53

In each line of your align environment, \\ ends the equation. So, any actions you want to perform on that particular line need to go before the ending \\.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

For any test function $\phi\in\mathcal{D}$,
\begin{align}
\langle f'(t),\phi(t) \rangle &= \int_{-\infty}^{\infty} f'(t)\phi(t) \mathrm{d}t \\
&= [f(t)\phi(t)]_{-\infty}^\infty
- \int_{-\infty}^{\infty} f(t)\phi'(t) \mathrm{d}t \nonumber \\ %%%%%%%%
&= -\langle f(t),\phi'(t) \rangle
\end{align}

\end{document}

-