I'm stuck in getting the parametric solution to the Brachistochrone problem WITH friction. I've followed up to step 30, but I don't understand how the results in 32 and 33 were calculated.
In the image below is my work so far. I feel like I'm missing something; if anyone could help out, I would massively appreciate it. Trying the substitution of $y' = \cot(\frac{\theta}{2})$ by inspection of possible trigonometric identities present in the differential equation: \begin{align*} \frac{A}{y - \mu x} &= \frac{1 + \cot(\frac{\theta}{2})^2}{(1 + \mu \cot(\frac{\theta}{2}))^2}\\ y - \mu x &= A\frac{(1 + \mu \cot(\frac{\theta}{2}))^2}{1 + \cot(\frac{\theta}{2})^2}\\ y - \mu x &= A\left(\frac{1 + \mu \cot(\frac{\theta}{2})}{\csc(\frac{\theta}{2})}\right)^2\\ y - \mu x &= A\left(\sin\frac{\theta}{2} + \mu \frac{\frac{\cos\frac{\theta}{2}}{\sin\frac{\theta}{2}}}{\frac{1}{sin\frac{\theta}{2}}}\right)^2\\ y - \mu x &= A\left(\sin\frac{\theta}{2} + \mu \cos\frac{\theta}{2}\right)^2\\ y - \mu x &= A\left(\sin^2\frac{\theta}{2} + 2\mu\sin\frac{\theta}{2}\cos\frac{\theta}{2} + \mu^2\cos^2\frac{\theta}{2}\right)\\ y - \mu x &= A\left((1 - \cos\theta) + \mu \sin\theta + \mu^2\cos^2\frac{\theta}{2}\right) \end{align*}
This is as far as I've gotten. On the Wolfram alpha site, the steps are not clearly shown and hence I feel like I'm missing something obvious. Wolfram Solution