An Alternate Solution to a Differential Equation

The trouble comes from the ambiguity of the symbol prime, which doesn't specifies with respect to which variable the differentiation is done.

Does $\quad f'(u)= \begin{cases} \frac{d}{du} f(u)\qquad(1)\\ \text{or} \\ \frac{d}{dx}f(u) \qquad(2) \end{cases}\quad $ ?

Does $\quad f'(\sin^2(x))= \begin{cases} \frac{d}{d(\sin^2(x))} f(\sin^2(x))\qquad(1)\\ \text{or} \\ \frac{d}{dx}f(\sin^2(x)) \qquad(2) \end{cases}\quad $ ?

It seems that, in writing $\quad f'(\sin^2x) = (1-\sin^2x) + \frac{\sin^2 x}{1-\sin^2 x}\quad$ you understand "prime" in sens of definition $(2)$ ,

while in writing $\quad f'(u) = (1 - u) + \frac{u}{1-u}\quad$ you understand "prime" in sens of definition $(1)$.

Both are different and leads to different further calculus. So, it is difficult to give a definitive answer to your question.

When two different variables, sometimes $u$ sometimes $x$, are involves in differentiations, it should be better to avoid the symbol prime. I suggest to edit your question with no symbol prime but with symbols $d$, in order to make it not ambiguous.