Artificial intelligent assistant

How to factor this expression in the fireman's problem? I'm trying to solve the fireman's optimization problem. It boils down to factoring the following expression: $2\left ( q + \frac{pq}{a} \right )\cdot \left ( -\frac{pq}{a^2} \right ) + 2(p+a)$ I have spent around 5 pages of paper trying to solve this but to no avail. According to the solution you can factor out $2(p+a)$, but how? This is _not_ homework by the way. Any help is appreciated.

Since $q+\frac{pq}{a}=\frac{q}{a}(a+p)$, your expression factorises to $$2(p+a)\left(\frac{q}{a}\frac{-pq}{a^2}+1\right)=2(p+a)(1-pq^2/a^3).$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6062f296cd019f90a257af55089e0825