[Tex/LaTex] How to automatically dot fill line in Math mode

align

I need to dot fill line in math mode even in aligned environment. I'm using \makebox[width]{\dotfill} but for presentation accommodations I want that dots reach the end of line.
I know that there exist linegoal to compute the missing space but I can't find how to apply this in math mode. Is there anyway to get the missing space.

\documentclass[a4paper,12pt]{article}
\usepackage{multido}
\usepackage{amsmath}
\usepackage{lipsum}

\begin{document}
\lipsum[8]\parskip 1\baselineskip
\noindent 
$f(x)=\frac{1}{\sqrt{x^7}}\Rightarrow 
                  \begin{aligned}[t]
                    f'(x) & =\makebox[.6\linewidth]{\dotfill} \\[1.5\baselineskip] 
                          & =\makebox[.6\linewidth]{\dotfill} 
                  \end{aligned}$
\end{document}

Best Answer

Since it seems you're interested in using the full width of the text block, you might as well use another mechanism to set the equation. Below I've used tabularx as it allows for a p-type column that stretches as far needed to fill (say) \textwidth:

enter image description here

\documentclass{article}
\usepackage{tabularx}
\usepackage{lipsum}

\begin{document}

\lipsum[8]

\vspace{\abovedisplayskip}

\noindent
\begin{tabularx}{\textwidth}{@{}l@{~}X@{}}
  $f(x) = \frac{1}{\sqrt{x^7}} \Rightarrow$
    & \dotfill \\[1.5\normalbaselineskip]
    & \dotfill
\end{tabularx}

\vspace{\belowdisplayskip}

\noindent
\lipsum[9]

\end{document}
Related Question