سلام
میتونین از بستهٔ tcolorbox
استفاده کنین. من جاهایی رو که تغییر دادم یا اضافه کردم، مشخص کردم.
\documentclass[12pt]{article}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[fleqn,leqno]{amsmath} % <--- changed
\usepackage{amsfonts,amsthm,amssymb} % <--- changed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% added
\usepackage[skins, theorems]{tcolorbox}
\newtcbox{\greenbox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,interior style={top color=green!10!white,
bottom color=green!10!white,middle color=green!50!yellow},
fuzzy halo=1pt with green,#1}
\newtcbox{\graybox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,colback=gray!40,#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\doublespacing
\usepackage{marvosym}
\usepackage{MnSymbol,wasysym,boldline}
\usepackage{roundbox,graphicx,framed}
\usepackage{fontspec}
\usepackage{fancybox}
\usepackage{draftwatermark}
\usepackage{color,xcolor}
\usepackage{ptext}
\usepackage{tikz,pgf,pgfplots}
\usetikzlibrary{arrows.meta}
\newcommand{\tikzmark}[2]{\tikz[remember picture,baseline=(#1.base)] \node (#1) {#2};}
\usepackage{mathrsfs}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{plain}
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{lemma}[definition]{Lemma}
\newtheorem{conjecture}{Conjecture}[section]
%\usetikzlibrary{arrows}
%\pagestyle{empty}
\usepackage[top=20mm, bottom=20mm, left=20mm, right=20mm,nohead]{geometry}
%\usepackage{tikz}
%\usetikzlibrary{shapes,snakes}
\usepackage{enumitem}
\usepackage{xepersian}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% added
\makeatletter
\renewcommand\tagform@[1]{%
\maketag@@@{\ignorespaces\textcircled{#1}\unskip\@@italiccorr}%
}
\makeatother
\newcommand{\diff}{\ensuremath{\,\mathrm d}}
\newcommand{\E}{\ensuremath{\mathrm e}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\oldSetWatermarkText\SetWatermarkText
\renewcommand{\SetWatermarkText}[1]{\oldSetWatermarkText{\textbf{\textcolor{blue!20}{#1}}}}
\settextfont{XB Yas}%
\defpersianfont\CS{Lotus}
%\settextfont{Lotus}
%\setdigitfont{XB Yas}
\setdigitfont{IRLotusICEE}
\SetWatermarkLightness{0.90}
\SetWatermarkAngle{55}
\SetWatermarkScale{0.55}
\SetWatermarkText{{\lr{S.Mostafa Zebarjad}}}
\title{ {\Huge ریاضی عمومی}
\\ {\LARGE انتگرال }}
\author{
{\Large }}
%\date{}
\normalsize
\begin{document}
\maketitle
\begin{align}
& \greenbox{\int x\E^x \diff x=?} \label{eq:example1} \\
& \graybox{\int x\E^x \diff x=?} \label{eq:example2}
\end{align}
این انتگرال
\ref{eq:example1}
و
\eqref{eq:example2}
را به روش جزبهجز حل میکنیم. جهت یادآوری فرمول انتگرالگیری جزبهجز بازگو میشود.
\begin{equation}\label{eq:example3}
\graybox{xyz}
\end{equation}
\end{document}
خروجی: