The following MWE provides \lboxed and \rboxed which are truncated \fboxes. Technically, this is identical to \fbox only with the right/left \vrule removed (the definition of \fbox is taken from latex.ltx). It also provides \llboxed and \rrboxed which are array-style boxes with the required side stripped of its vertical rule.

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand{\lboxed}[1]{\begin{array}{|l}\hline#1\\\hline\end{array}}
\newcommand{\rboxed}[1]{\begin{array}{r|}\hline#1\\\hline\end{array}}
\makeatletter
\newcommand{\llboxed}[1]{{%
\let\@frameb@x\l@frameb@x\fbox{#1}%
}}
\newcommand{\rrboxed}[1]{{%
\let\@frameb@x\r@frameb@x\fbox{#1}%
}}
\def\l@frameb@x#1{%
\@tempdima\fboxrule
\advance\@tempdima\fboxsep
\advance\@tempdima\dp\@tempboxa
\hbox{%
\lower\@tempdima\hbox{%
\vbox{%
\hrule\@height\fboxrule
\hbox{%
\vrule\@width\fboxrule
#1%
\vbox{%
\vskip\fboxsep
\box\@tempboxa
\vskip\fboxsep}%
#1%
%\vrule\@width\fboxrule% Right \vrule removed
}%
\hrule\@height\fboxrule}%
}%
}%
}
\def\r@frameb@x#1{%
\@tempdima\fboxrule
\advance\@tempdima\fboxsep
\advance\@tempdima\dp\@tempboxa
\hbox{%
\lower\@tempdima\hbox{%
\vbox{%
\hrule\@height\fboxrule
\hbox{%
%\vrule\@width\fboxrule% Left \vrule removed
#1%
\vbox{%
\vskip\fboxsep
\box\@tempboxa
\vskip\fboxsep}%
#1%
\vrule\@width\fboxrule}%
\hrule\@height\fboxrule}%
}%
}%
}
\makeatother
\begin{document}
This is my equation $\boxed{q_1^{\ast}}=\dfrac{26-2\cdot 1 -4\cdot 2}{2\cdot 1}=\boxed{8}$
This is my equation $\rboxed{q_1^{\ast}}=\dfrac{26-2\cdot 1 -4\cdot 2}{2\cdot 1}=\lboxed{8}$
This is my equation $\rrboxed{$q_1^{\ast}$}=\dfrac{26-2\cdot 1 -4\cdot 2}{2\cdot 1}=\llboxed{$8$}$
\end{document}
\let\@frameb@x\l@frameb@x\fbox{$#1$}instead to ease the use of\rrboxedand\llboxed? I've tried it and the log doesn't seem to give any error. – Alfredo Hernández Feb 01 '16 at 00:05