I was trying to get a better intuition about $A_\infty$-algebras, so I read this question and tried to fill the details of the answer.
Context
More precisely, let $(A, d_A)$ be a differential graded associative algebra and $(B, d_B)$ a deformation retract of $A$, in the sense that there are maps: $$\begin{align} p & : A \to B & i : B \to A \end{align}$$ such that $pi = id_B$ and there is a homotopy $h$ acting on $A$ such that $id_A - ip = h d_A + d_A h$.
Then if $\mu : A \otimes A \to A$ is the product on $A$, define a new product $m_2 = m : B \otimes B \to B$ on $B$ by: $$ m(x,y) = p(\mu(i(x), i(y)))$$
This product is not associative, but I want to prove that
$$m(m(x,y),z)-m(x,(m(y,z))=d_B m_3(x,y,z) + m_3(d_B x, y, z) + m_3(x, d_B y, z) + m_3(x, y, d_B z)$$
where $m_3 : B \otimes B \otimes B \to B$ is defined by $m_3(u,v,w) = -p \mu(i(u), h\mu(i(v), i(w))) + p \mu(h\mu(i(u), i(v)), i(w))$
Attempt
I first computed the associator of the product, because I wanted to gain intuition of why $m_3$ must be defined that way. On the one hand I have
$m(m(x,y),z)=m(p\mu(i(x),i(y)),z)=p\mu (ip(\mu(i(x),i(y))),i(z))$. Since $ip=id_A-hd_A+d_Ah$, using linearity I get
$m(x,m(y,z))=p\mu(\mu(i(x),i(y)),i(z))-p\mu(hd_A(\mu(i(x),i(y))),i(z))-p\mu(d_Ah(\mu(i(x),i(y))),i(z))$
Similarly, I get
$m(x,m(y,z))=p\mu(i(x),\mu(i(y),i(z)))-p\mu(i(x),hd_A(\mu(i(y),i(z))))-p\mu(i(x),d_Ah(\mu(i(y),i(z))))$
Since $\mu$ is associative, the first term of each association cancel, so we get
$$m(m(x,y),z)-m(x,(m(y,z))=$$
$$-p\mu(\mu(i(x),hd_A(\mu(i(y),i(z))))-p\mu(i(x),d_Ah(\mu(i(y),i(z))))+p\mu(hd_A(\mu(i(x),i(y))),i(z))+p\mu(d_Ah(\mu(i(x),i(y))),i(z))$$
After that, I can use that $d_A$ is a derivation, i.e. $d_A\mu=\mu(d_A\otimes 1+1\otimes d_A)$ to make $d_A\circ i=i\circ d_B$ appear in those places where I have $hd_A$.
Question
I don't know now how to make $d_B$ appear where I have $d_Ah$. The only way I can think of is replacing this again using the homotopy relation, but I would get some $ip$ that shouldn't appear. Can anybody help?
The answer is that you don't have to move $d_A$ inwards when you have $d_Ah$. Instead, you can move it outwards using $pd_A=d_Bp$. The parts where you move $d_A$ inwards gives you $m_3(d_Bx,y,z)$ and son on, and moving $d_A$ outwards gives you $d_Bm_3(x,y,z)$.