\documentclass[11pt,fleqn]{book}  
\usepackage{amsmath,amsfonts,amssymb,amsthm}
%--------------------for \boxed
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[customcolors,shade]{hf-tikz}
%---------------------------------------------------
\usepackage{xepersian}
% put color to \boxed math command
\newcommand*{\boxcolor}{orange}
\makeatletter
\renewcommand{\boxed}[1]{\textcolor{\boxcolor}{%
 \tikz[baseline={([yshift=-1ex]current bounding box.center)}]\node [rectangle, minimum width=1ex,rounded corners,draw] {\normalcolor\m@th$\displaystyle#1$};}}
 \makeatother

\begin{document}
\begin{equation}
\boxed{ax^2+bx+c}
\end{equation}
\end{document}