I'm trying to learn some maths on my own and have come across this problem.
Find $dy/dx$:
$$ \sqrt{x + y} = \cos(y^2)$$
My working has led me to the below:
$$ -\frac{2\sqrt{x + y}}{2\sqrt{x + y}(1 + 4\sin(y^2)\sqrt{x +y})}$$
Is it legal to cancel out... $$ 2\sqrt{x + y}$$ ...from the top and the bottom?
It is legal to cancel $2\sqrt{x + y}$ because it is being multiplied by all other terms in the denominator. If it was being added or subtracted to something, then you couldn't have canceled it out.