The following code seems to give what you want: numbering equations within sections in the main matter and numbering with chapter in appendices. I have used the \numberwithin
command from amsmath
but other solutions exist.
I have no idea about Lyx
but, if I remember well, you can always edit your Lyx file with a text editor. The important is to insert the \numberwithin
commands.
\documentclass[a4paper,12pt]{book}
\usepackage{amsmath}
\begin{document}
\numberwithin{equation}{section}
\chapter{One}
\section{One}
\begin{equation}
a = b
\end{equation}
\section{Two}
\begin{equation}
a = b
\end{equation}
\begin{equation}
a = b = c
\end{equation}
\chapter{Two}
\section{One}
\begin{equation}
a = b
\end{equation}
\section{Two}
\begin{equation}
a = b
\end{equation}
\appendix\newpage\markboth{Appendix}{Appendix}
\renewcommand{\thesection}{\Alph{section}}
\numberwithin{equation}{section}
\section{Appendix}
\begin{equation}
a = b
\end{equation}
\chapter{Appendix two}
\begin{equation}
a = b
\end{equation}
\end{document}
Note that I have also modified the headings so that you have now proper headings without defining chapters in the appendix.