At here How to make an environment star Exercise?, I posted make star Exercise.
How to make star Exercise and its environmet answer? Example, with Exercise 1.1, we have Answer 1.1, with Exercise 1.5*, we have Answer 1.5*.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityAt here How to make an environment star Exercise?, I posted make star Exercise.
How to make star Exercise and its environmet answer? Example, with Exercise 1.1, we have Answer 1.1, with Exercise 1.5*, we have Answer 1.5*.
The following provides the functionality you requested by defining the sol*
environment to be very similar to the ex*
environment:
\documentclass{book}
\usepackage{amsfonts,amssymb,amsmath}% http://ctan.org/pkg/{amsfonts,amssymb,amsmath}
\newtheorem{ex}{Exercise}[chapter]
\newenvironment{ex*}
{\renewcommand\theex{\thechapter.\arabic{ex}\rlap{$^*$}}%
\ex\edef\@currentlabel{\thechapter.\arabic{ex}}}
{\endex}
\newtheorem{sol}{Answer}[chapter]
\newenvironment{sol*}
{\renewcommand\thesol{\theex\rlap{$^*$}}%
\sol\edef\@currentlabel{\theex}}
{\endsol}
\renewcommand\thesol{\theex}
\begin{document}
\chapter{First Chapter}
\section{First section}
\begin{ex}
This is an Exercise.
\end{ex}
\begin{sol}
This is a Solution.
\end{sol}
\begin{ex}
This is an Exercise.
\end{ex}
\begin{ex*}
This is a difficult Exercise.
\end{ex*}
\begin{sol*}
This is an easy solution.
\end{sol*}
\end{document}
The base code was taken from egreg's answer.