Vielleicht kann mir doch noch einer helfen. Ich habe es mit einer anderen Geraden probiert, allerdings weicht die total ab und wandert nicht mit dem Punkt B nach unten. Ich hoffe, mir kann jemand sagen, wo der Fehler liegt und wie ich ihn beheben kann. 
    \documentclass{article}
    \usepackage{tikz}
    \usepackage{animate}
    
    \usetikzlibrary{arrows.meta,backgrounds}
    
    \begin{document}
    	\begin{animateinline}[controls]{1}
    		\multiframe{10}{rd=0+0.2}{
    			\begin{tikzpicture}[scale=2, >=Stealth]
    			
    			\draw[loosely dotted] (0,0) grid (5,5);
    			\draw[->] (0,0) -- (5,0) node[right] {$x$};
    			\draw[->] (0,0) -- (0,5) node[above] {$y$};
    			\draw[thin,domain=0:4.3,smooth,black] plot(\x,{e^(\x -3)+1});
    			\coordinate[label=above left:$A$] (A) at (2,1.36);
    			\fill[black] (A) circle (1pt); 
    			
    		 \scoped [on background layer]  
    			\path [fill=black!10]  
    			(A) -|(4-\rd,{e^((4-\rd) -3)+1}) 
    			node [
    			fill=black, 
    			circle, 
    			inner sep=1.05pt,
    			label={[inner sep=1pt]above left:$B$}
    			] {}
    			;
    			\draw[domain=1.8:4.2-\rd] plot(\x,{(1.175-\rd)*\x-(0.99-\rd)});	%hier habe ich genauso die Variable \rd hinzugefügt
    			\end{tikzpicture}}
    	\end{animateinline}
    \end{document}