# Equation on same line as proof

If a proof consists of only a single, less-than-a-line-long equation, there is no reason to put the \emph{Proof.} and the equation not on the same line. How can I tell LaTex this?

Here is a minimal non-working example, i.e. the proof equation is on a separate line even though I would like to have it on the same line as the \emph{Proof.}.

\documentclass{article}
\usepackage{amsmath, amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Binomial formula]
$(a+b)^2 = a^2 + 2ab + b^2$
\begin{proof}
$(a+b)^2 = a^2 + ab + ba + b^2 = a^2 + 2ab + b^2 \qedhere$
\end{proof}
\end{theorem}
\end{document}


Btw, I know that I could use inline math mode, but then the equation is no longer centered and this I would like to keep up.

• Add some text, you gain in pleasantness of typography and clarity. Jan 16 '15 at 15:55

You can center a single inline math formula by surrounding it with \hfill statements. (If you need the inline equation to be in display math mode, insert the instruction \displaystyle after the opening $.) \documentclass{article} \usepackage{amsmath, amsthm} \theoremstyle{plain} \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem}[Binomial formula] $(a+b)^2 = a^2 + 2ab + b^2$ \begin{proof} \hfill$(a+b)^2 = a^2 + ab + ba + b^2 = a^2 + 2ab + b^2.$\hfill \end{proof} \end{theorem} \end{document}  What about inline math? \documentclass{article} \usepackage{amsmath, amsthm} \theoremstyle{plain} \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem}[Binomial formula] $(a+b)^2 = a^2 + 2ab + b^2$ \begin{proof}$