# Change the type of equation numbering in document class article [duplicate]

I have written my thesis in document class 'article' (don't ask me why). Now I want to number my equations by sections, i.e. in section 1 they should go 1.1, 1.2, ..., in section 2 they should go 2.1, 2.2, ...

I don't want to change the document class (e.g. to 'report') because then I would have to change all sections to chapters, subsections to sections and because I fear a lot of other unintended consequences.

How can solve this?

Thanks for any help!

## marked as duplicate by lockstep, yo', cmhughes, Marco Daniel, Gonzalo MedinaMay 18 '12 at 3:17

The amsmath package provides the command \numberwithin which can be used in your document as

\numberwithin{equation}{section}


A MWE follows

\documentclass{article}
\usepackage{amsmath}

\numberwithin{equation}{section}
\begin{document}

\section{Here is a section}
$$f(x)=x^2+\sin(x)$$
\end{document}